Added option for stripping accents on add dict dialog;
[mdictionary] / trunk / src / plugins / xdxf / src / XdxfLoadDialog.cpp
index 310d63b..99f6759 100644 (file)
 
 *******************************************************************************/
 
+/*! \file XdxfLoadDialog.cpp
+*/
 //Created by Mateusz Półrola
 
 #include "XdxfLoadDialog.h"
 
 XdxfLoadDialog::XdxfLoadDialog(QWidget *parent) :
     QDialog(parent) {
-    verticalLayout = new QVBoxLayout;
+    verticalLayout = new QVBoxLayout(this);
     setLayout(verticalLayout);
 
     setWindowTitle(tr("Add new XDXF dictionary"));
 
-    browseLayout = new QHBoxLayout;
+    browseLayout = new QHBoxLayout(this);
     verticalLayout->addLayout(browseLayout);
 
-    browseButton =  new QPushButton(tr("Browse"));
-    browseLabel = new QLabel(tr("Dictionary file: not selected"));
+    browseButton =  new QPushButton(tr("Browse"),this);
+    browseLabel = new QLabel(tr("Dictionary file: not selected"),this);
 
     browseLayout->addWidget(browseLabel);
     browseLayout->addWidget(browseButton,0, Qt::AlignRight);
 
 
-    cacheLayout = new QHBoxLayout;
+    cacheLayout = new QHBoxLayout(this);
     verticalLayout->addLayout(cacheLayout);
+    accentsCheckBox = new QCheckBox(tr("Strip accents \n(searching takes more time, "
+                 "but spelling don't have to be exact)"));
+    verticalLayout->addWidget(accentsCheckBox);
 
-    cacheCheckBox = new QCheckBox(tr("Optimize for quicker searches (may take some time)"));
+    cacheCheckBox = new QCheckBox(tr("Optimize for quicker searches (may take some time)"),this);
     cacheCheckBox->setChecked(true);
     cacheLayout->addWidget(cacheCheckBox);
 
-    addButton = new QPushButton(tr("Add"));
+    addButton = new QPushButton(tr("Add"),this);
 
     verticalLayout->addWidget(addButton);
 
@@ -105,6 +110,11 @@ Settings* XdxfLoadDialog::getSettings(QWidget *parent) {
         else {
             settings->setValue("generateCache", "false");
         }
+        if(loadDialog.accentsCheckBox->isChecked())
+            settings->setValue("strip_accents", "true");
+        else
+            settings->setValue("strip_accents", "false");
+
 
         return settings;
     }