Fixed bug in XdxfLoadDialog class
authorMateusz Półrola <mateusz.polrola@comarch.pl>
Thu, 5 Aug 2010 13:07:01 +0000 (15:07 +0200)
committerMateusz Półrola <mateusz.polrola@comarch.pl>
Thu, 5 Aug 2010 13:07:01 +0000 (15:07 +0200)
trunk/src/base/gui/SearchBarWidget.cpp
trunk/src/plugins/xdxf/src/XdxfPlugin/XdxfLoadDialog.cpp
trunk/src/plugins/xdxf/src/XdxfPlugin/XdxfLoadDialog.h

index 6ff6694..a73e6d4 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "SearchBarWidget.h"
 #include <QDebug>
-
+#include "../../includes/DictDialog.h"
 
 
 SearchBarWidget::SearchBarWidget(Backbone* backbone, QWidget *parent) :
@@ -179,6 +179,8 @@ void SearchBarWidget::searchFinished() {
 
 void SearchBarWidget::historyNextToolButtonClicked() {
 
+    CommonDictInterface*p = backbone->getPlugins()[0];
+    p->dictDialog()->addNewDictionary(this);
 }
 
 void SearchBarWidget::historyPrevToolButtonClicked() {
index 937c2db..2666ffa 100644 (file)
@@ -59,7 +59,7 @@ XdxfLoadDialog::XdxfLoadDialog(QWidget *parent) :
     connect(addButton, SIGNAL(clicked()),
             this, SLOT(addDictionary()));
 
-    dicitonaryFilePath = QString();
+    _dicitonaryFilePath = QString();
 }
 
 void XdxfLoadDialog::selectFile() {
@@ -71,22 +71,30 @@ void XdxfLoadDialog::selectFile() {
                                      NULL);
     if (!fileName.isEmpty()) {
         browseLabel->setText(tr("Dictionary file: ") + fileName);
-        dicitonaryFilePath = fileName;
+        _dicitonaryFilePath = fileName;
     }
 }
 
 void XdxfLoadDialog::addDictionary() {
-    generateCache = cacheCheckBox->isChecked();
+    _generateCache = cacheCheckBox->isChecked();
     accept();
 }
 
+QString XdxfLoadDialog::dicitonaryFilePath() {
+    return _dicitonaryFilePath;
+}
+
+bool XdxfLoadDialog::generateCache() {
+    return _generateCache;
+}
+
 Settings* XdxfLoadDialog::getSettings(QWidget *parent) {
     XdxfLoadDialog loadDialog(parent);
     Settings* settings = new Settings;
 
     if(loadDialog.exec()==QDialog::Accepted) {
-        settings->setValue("dictionaryFile", dicitonaryFilePath);
-        if(generateCache) {
+        settings->setValue("dictionaryFile", loadDialog.dicitonaryFilePath());
+        if(loadDialog.generateCache()) {
             settings->setValue("cache", "1");
         }
         else {
@@ -98,3 +106,5 @@ Settings* XdxfLoadDialog::getSettings(QWidget *parent) {
 
     return NULL;
 }
+
+
index 99c8368..88c3711 100644 (file)
@@ -34,6 +34,8 @@ class XdxfLoadDialog : public QDialog {
 public:
     explicit XdxfLoadDialog(QWidget *parent = 0);
     static Settings* getSettings(QWidget *parent);
+    QString dicitonaryFilePath();
+    bool generateCache();
 
 signals:
 
@@ -51,8 +53,9 @@ private:
     QVBoxLayout* verticalLayout;
     QHBoxLayout* browseLayout;
     QHBoxLayout* cacheLayout;
-    static QString dicitonaryFilePath;
-    static bool generateCache;
+    QString _dicitonaryFilePath;
+    bool _generateCache;
+
 };
 
 #endif // XDXFLOADDIALOG_H