add draft of googleDictDialog class
authorJakub Jaszczynski <j.j.jaszczynski@gmail.com>
Tue, 24 Aug 2010 10:17:13 +0000 (12:17 +0200)
committerJakub Jaszczynski <j.j.jaszczynski@gmail.com>
Tue, 24 Aug 2010 10:17:13 +0000 (12:17 +0200)
trunk/src/plugins/google/src/GoogleDictDialog.cpp [new file with mode: 0644]
trunk/src/plugins/google/src/GoogleDictDialog.h [new file with mode: 0644]

diff --git a/trunk/src/plugins/google/src/GoogleDictDialog.cpp b/trunk/src/plugins/google/src/GoogleDictDialog.cpp
new file mode 100644 (file)
index 0000000..5c4eabc
--- /dev/null
@@ -0,0 +1,25 @@
+#include "GoogleDictDialog.h"
+
+GoogleDictDialog::GoogleDictDialog(GooglePlugin *plugin, QObject *parent) :
+    DictDialog(parent) {
+
+    this->plugin = plugin;
+}
+
+
+Settings* GoogleDictDialog::addNewDictionary(QWidget *parent) {
+    Settings *settings = new Settings();
+    settings->setValue("langTo","en");
+    settings->setValue("langFrom","pl");
+    return settings;
+    //return GoogleLoadDialog::getSettings(parent);
+}
+
+void GoogleDictDialog::changeSettings(QWidget * parent) {
+
+    Settings* settings = new Settings;
+    foreach(QString key, plugin->settings()->keys())
+        settings->setValue(key, plugin->settings()->value(key));
+    plugin->setSettings(settings);
+    delete settings;
+}
diff --git a/trunk/src/plugins/google/src/GoogleDictDialog.h b/trunk/src/plugins/google/src/GoogleDictDialog.h
new file mode 100644 (file)
index 0000000..94d53d1
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef GOOGLEDICTDIALOG_H
+#define GOOGLEDICTDIALOG_H
+
+#include "../../../includes/DictDialog.h"
+#include "GooglePlugin.h"
+
+class GooglePlugin;
+
+class GoogleDictDialog : public DictDialog
+{
+     Q_OBJECT
+public:
+    explicit GoogleDictDialog(GooglePlugin* plugin, QObject *parent = 0);
+    /*!
+      Shows add new xdxf dictionary dialog and returns settings of new dict
+      \param parent parent widget on which will be displayed dialog
+      */
+    Settings* addNewDictionary(QWidget *parent);
+
+    /*!
+      Shows settings dialog and save new settings in plugin
+      \param parent parent widget on which will be displayed dialog
+      */
+    void changeSettings(QWidget *parent);
+
+private:
+    GooglePlugin* plugin;
+};
+
+#endif // GOOGLEDICTDIALOG_H