Fixed caching dialog of new dictionary
authorMateusz Półrola <mateusz.polrola@comarch.pl>
Mon, 13 Sep 2010 11:23:38 +0000 (13:23 +0200)
committerMateusz Półrola <mateusz.polrola@comarch.pl>
Mon, 13 Sep 2010 11:23:38 +0000 (13:23 +0200)
src/plugins/xdxf/XdxfDictDialog.cpp
src/plugins/xdxf/XdxfDictDialog.h
src/plugins/xdxf/xdxfplugin.cpp

index 07b7b31..62e1f3d 100644 (file)
@@ -38,10 +38,14 @@ QWidget* XdxfDictDialog::lastDialogParent() {
     return _lastDialogParent;
 }
 
+void XdxfDictDialog::setLastDialogParent(QWidget *w) {
+    _lastDialogParent = w;
+}
+
 Settings* XdxfDictDialog::addNewDictionary(QWidget *parent) {
     XdxfDialog d(0, XdxfDialog::New, parent);
 
-    _lastDialogParent = parent;
+    setLastDialogParent(parent);
 
     connect(&d, SIGNAL(notify(Notify::NotifyType,QString)),
             this, SIGNAL(notify(Notify::NotifyType,QString)));
@@ -55,7 +59,7 @@ Settings* XdxfDictDialog::addNewDictionary(QWidget *parent) {
 void XdxfDictDialog::changeSettings(QWidget * parent) {
     XdxfDialog d(plugin, XdxfDialog::Change, parent);
 
-    _lastDialogParent = parent;
+    setLastDialogParent(parent);
 
     connect(&d, SIGNAL(notify(Notify::NotifyType,QString)),
             this, SIGNAL(notify(Notify::NotifyType,QString)));
index 1fdbb46..50b8ac3 100644 (file)
@@ -49,6 +49,8 @@ public:
 
     QWidget* lastDialogParent();
 
+    void setLastDialogParent(QWidget*);
+
 private:
     XdxfPlugin* plugin;
     QWidget* _lastDialogParent;
index e44e0ea..e39e1de 100644 (file)
@@ -320,6 +320,8 @@ DictDialog* XdxfPlugin::dictDialog() {
 CommonDictInterface* XdxfPlugin::getNew(const Settings *settings) const {
     XdxfPlugin *plugin = new XdxfPlugin();
 
+    ((XdxfDictDialog*)plugin->dictDialog())->setLastDialogParent(_dictDialog->lastDialogParent());
+
     if(settings && plugin->setSettings(settings)) {
         return plugin;
     }
@@ -482,6 +484,8 @@ bool XdxfPlugin::makeCache(QString) {
 
     XdxfCachingDialog d(_dictDialog->lastDialogParent());
 
+    qDebug()<<_dictDialog->lastDialogParent();
+
     connect(&d, SIGNAL(cancelCaching()),
             this, SLOT(stop()));