Merge branch 'stardict' of ssh://drop.maemo.org/git/mdictionary into stardict
[mdictionary] / src / plugins / stardict / StarDialog.cpp
index 8ca8b3a..b6b4e78 100644 (file)
@@ -32,24 +32,17 @@ StarDialog::StarDialog(StarDictPlugin *plugin,
     this->plugin = plugin;
     this->type = type;
 
-
-    cacheToolTip = tr("Optimize for quicker searches (may take some time)");
     accentsToolTip = tr("Strip accents (searching takes more time, but spelling doesn't have to be exact)");
 
     initializeUI();
 
-    connect(cacheCheckBox, SIGNAL(toggled(bool)),
-            this, SLOT(setGenerateCache(bool)));
 
     connect(accentsCheckBox, SIGNAL(toggled(bool)),
             this, SLOT(setAccents(bool)));
 
     #ifdef Q_WS_MAEMO_5
         connect(accentsInfoToolButton, SIGNAL(clicked()),
-                 this, SLOT(showAccentsInfo()));
 
-        connect(cacheInfoToolButton, SIGNAL(clicked()),
-                 this, SLOT(showCacheInfo()));
     #endif
 
     if(type == New) {
@@ -72,7 +65,7 @@ void StarDialog::initializeUI() {
     infoLabel->setWordWrap(true);
 
     if(type == New) {
-        setWindowTitle(tr("Add new XDXF dictionary"));
+        setWindowTitle(tr("Add new StarDict dictionary"));
 
         browseLayout = new QHBoxLayout;
         browseButton = new QPushButton(tr("Browse"));
@@ -84,7 +77,7 @@ void StarDialog::initializeUI() {
         mainVerticalLayout->addLayout(browseLayout);
     }
     else {
-        setWindowTitle(tr("XDXF Settings"));
+        setWindowTitle(tr("StarDict Settings"));
 
         infoLabel->setText(tr("Plugin: ") + plugin->type().toUpper() +"\n" +
                        tr("From: ") + plugin->langFrom() + "\n" +
@@ -104,40 +97,23 @@ void StarDialog::initializeUI() {
         accentsLayout->addWidget(accentsInfoToolButton);
     #endif
 
-    cacheLayout = new QHBoxLayout;
-    cacheCheckBox = new QCheckBox(tr("Optimize"));
-    cacheCheckBox->setToolTip(cacheToolTip);
-    cacheLayout->addWidget(cacheCheckBox);
-    #ifdef Q_WS_MAEMO_5
-        cacheInfoToolButton = new QToolButton;
-        cacheInfoToolButton->setIcon(QIcon::fromTheme("general_information"));
-        cacheLayout->addWidget(cacheInfoToolButton);
-    #endif
 
-    mainVerticalLayout->addLayout(cacheLayout);
     mainVerticalLayout->addLayout(accentsLayout);
 
 
     //load old setting if exists
     if(!plugin) {
-        cacheCheckBox->setChecked(true);
         accentsCheckBox->setChecked(true);
         accentsCheckBox->setEnabled(false);
-        _generateCache = true;
         _accents = true;
         _dictionaryFilePath = "";
     }
     else if(plugin && plugin->settings()->value("cached") == "true") {
-        cacheCheckBox->setChecked(true);
         accentsCheckBox->setChecked(true);
         accentsCheckBox->setEnabled(false);
-        _generateCache = true;
         _accents = true;
     }
     else {
-        cacheCheckBox->setChecked(false);
-        _generateCache = false;
-
         if(plugin->settings()->value("strip_accents") == "true") {
             accentsCheckBox->setChecked(true);
             _accents = true;
@@ -198,7 +174,7 @@ void StarDialog::selectFile() {
     QString fileName = QFileDialog::getOpenFileName(this,
                                      tr("Select dictionary file"),
                                      _dictionaryFilePath,
-                                     tr(".ifo Files (*.ifo)"),
+                                     tr("StarDict Files (*.dict *dict.dz *.idx *idx.gz *.ifo)"),
                                      NULL,
                                      NULL);
 
@@ -230,12 +206,6 @@ void StarDialog::saveSettings() {
                 _settings->setValue("synFileName", _dictName + ".syn");
         }
     }
-
-    if(_generateCache)
-        _settings->setValue("generateCache", "true");
-    else
-        _settings->setValue("generateCache", "false");
-
     if(_accents)
         _settings->setValue("strip_accents", "true");
     else