Modified google plugin dialog
[mdictionary] / src / plugins / google / GoogleDictDialog.cpp
index a4125c4..bd6bd37 100644 (file)
@@ -24,6 +24,7 @@
 */
 
 #include "GoogleDictDialog.h"
+#include "GoogleDialog.h"
 
 GoogleDictDialog::GoogleDictDialog(GooglePlugin *plugin, QObject *parent) :
     DictDialog(parent) {
@@ -31,10 +32,26 @@ GoogleDictDialog::GoogleDictDialog(GooglePlugin *plugin, QObject *parent) :
 }
 
 Settings* GoogleDictDialog::addNewDictionary(QWidget *parent) {
-   return GoogleSettingsDialog::getSettings(parent);
+    GoogleDialog d(0, GoogleDialog::New, parent);
+
+    connect(&d, SIGNAL(notify(Notify::NotifyType,QString)),
+            this, SIGNAL(notify(Notify::NotifyType,QString)));
+
+    if(d.exec() == QDialog::Accepted) {
+        return d.getSettings();
+    }
+
+    return 0;
 }
 
 void GoogleDictDialog::changeSettings(QWidget * parent) {
-    GoogleSettingsDialog::changeSettings(plugin,parent);
+    GoogleDialog d(plugin, GoogleDialog::Change, parent);
+
+    connect(&d, SIGNAL(notify(Notify::NotifyType,QString)),
+            this, SIGNAL(notify(Notify::NotifyType,QString)));
+
+    if(d.exec() == QDialog::Accepted) {
+        plugin->setSettings(d.getSettings());
+    }
 }