Fixed bugs in pro file
authorMateusz Półrola <mateusz.polrola@comarch.pl>
Tue, 5 Oct 2010 13:58:33 +0000 (15:58 +0200)
committerMateusz Półrola <mateusz.polrola@comarch.pl>
Tue, 5 Oct 2010 13:58:33 +0000 (15:58 +0200)
src/plugins/stardict/StarDialog.cpp
src/plugins/stardict/StarDialog.h
src/plugins/stardict/stardict.pro

index 3874fba..c8deb1b 100644 (file)
@@ -31,24 +31,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) {
@@ -71,7 +64,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"));
@@ -83,7 +76,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" +
@@ -103,40 +96,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;
@@ -197,7 +173,7 @@ void StarDialog::selectFile() {
     QString fileName = QFileDialog::getOpenFileName(this,
                                      tr("Select dictionary file"),
                                      _dictionaryFilePath,
-                                     tr("XDXF Files (*.xdxf)"),
+                                     tr("StarDict Files (*.dict *dict.dz *.idx *idx.gz *.ifo)"),
                                      NULL,
                                      NULL);
 
@@ -217,12 +193,6 @@ void StarDialog::saveSettings() {
     else {
         _settings->setValue("path", _dictionaryFilePath);
     }
-
-    if(_generateCache)
-        _settings->setValue("generateCache", "true");
-    else
-        _settings->setValue("generateCache", "false");
-
     if(_accents)
         _settings->setValue("strip_accents", "true");
     else
index 5348b17..1a15ffa 100644 (file)
@@ -110,16 +110,12 @@ private:
     QHBoxLayout* browseLayout;
 
 
-    QCheckBox* cacheCheckBox;
     QCheckBox* accentsCheckBox;
-    QHBoxLayout* cacheLayout;
     QHBoxLayout* accentsLayout;
 
-    QString cacheToolTip;
     QString accentsToolTip;
 
     #ifdef Q_WS_MAEMO_5
-        QToolButton* cacheInfoToolButton;
         QToolButton* accentsInfoToolButton;
     #endif
 
@@ -134,7 +130,6 @@ private:
     QHBoxLayout* layout;
 
     QVBoxLayout* mainVerticalLayout;
-    bool _generateCache;
     bool _accents;
     bool _lastAccents;
 
index 93c4f12..1d683f1 100644 (file)
@@ -16,7 +16,7 @@ SOURCES +=  \
     TranslationStarDict.cpp \
     StarDictDialog.cpp \
     StarDialog.cpp \
-    StarDictSettings.cpp
+    StarDictSettings.cpp \
     CompressedReader.cpp \
     UncompressedReader.cpp \
     StarDictReaderFactory.cpp
@@ -31,7 +31,7 @@ HEADERS += \
     ../../include/settings.h \
     ../../include/CommonDictInterface.h \
     StarDialog.h \
-    StarDictSettings.h
+    StarDictSettings.h \
     CompressedReader.h \
     UncompressedReader.h \
     StarDictReaderFactory.h \