From f3c48923b83c7d4f8ddebc1f03ddf6acd93f64e3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mateusz=20P=C3=B3=C5=82rola?= Date: Mon, 6 Sep 2010 15:55:06 +0200 Subject: [PATCH] New xdxf dialog, one which provides methods to add new or change setting of existing one dictionary Fixed norifications of dialogs --- src/include/CommonDictInterface.h | 2 +- src/include/DictDialog.h | 4 + src/mdictionary/backbone/backbone.cpp | 6 +- src/mdictionary/backbone/backbone.h | 2 +- src/mdictionary/gui/DictManagerWidget.cpp | 10 +- src/mdictionary/gui/DictManagerWidget.h | 6 + src/mdictionary/gui/MainWindow.cpp | 11 +- src/mdictionary/gui/MainWindow.h | 2 +- src/mdictionary/gui/MenuWidget.cpp | 8 + src/mdictionary/gui/MenuWidget.h | 4 + src/mdictionary/gui/NotifyManager.cpp | 17 +- src/mdictionary/gui/NotifyManager.h | 3 +- src/plugins/xdxf/XdxfDialog.cpp | 241 +++++++++++++++++++++++++++++ src/plugins/xdxf/XdxfDialog.h | 96 ++++++++++++ src/plugins/xdxf/XdxfDictDialog.cpp | 22 ++- src/plugins/xdxf/xdxf.pro | 6 +- src/plugins/xdxf/xdxfplugin.cpp | 8 +- 17 files changed, 425 insertions(+), 23 deletions(-) create mode 100644 src/plugins/xdxf/XdxfDialog.cpp create mode 100644 src/plugins/xdxf/XdxfDialog.h diff --git a/src/include/CommonDictInterface.h b/src/include/CommonDictInterface.h index f09815d..329fd32 100644 --- a/src/include/CommonDictInterface.h +++ b/src/include/CommonDictInterface.h @@ -127,7 +127,7 @@ class CommonDictInterface : public QObject, public AccentsNormalizer { different ways \param QString text of the notification */ - void notify(Notify::NotifyType, QString); + void notify(Notify::NotifyType, QString, QWidget* parent = 0); protected: diff --git a/src/include/DictDialog.h b/src/include/DictDialog.h index fc83744..f5f5ee0 100644 --- a/src/include/DictDialog.h +++ b/src/include/DictDialog.h @@ -25,6 +25,7 @@ #define DICTDIALOG_H #include +#include "Notify.h" class Settings; @@ -46,6 +47,9 @@ public: \param parent parent widget on which dialog will be displayed */ virtual void changeSettings(QWidget *parent = 0) = 0; + +Q_SIGNALS: + void notify(Notify::NotifyType, QString, QWidget* parent = 0); }; #endif // DICTDIALOG_H diff --git a/src/mdictionary/backbone/backbone.cpp b/src/mdictionary/backbone/backbone.cpp index f61266e..36782d6 100644 --- a/src/mdictionary/backbone/backbone.cpp +++ b/src/mdictionary/backbone/backbone.cpp @@ -254,8 +254,8 @@ void Backbone::addInternalDictionary(CommonDictInterface* dict, bool active) { dict->setHash(++_dictNum); // Hash must be uniqe in every session but not between _dicts[dict] = active; connect(dict, SIGNAL(settingsChanged()), this, SLOT(dictUpdated())); - connect(dict, SIGNAL(notify(Notify::NotifyType,QString)), this, - SIGNAL(notify(Notify::NotifyType,QString))); + connect(dict, SIGNAL(notify(Notify::NotifyType,QString, QWidget*)), this, + SIGNAL(notify(Notify::NotifyType,QString, QWidget*))); } } @@ -363,6 +363,8 @@ void Backbone::loadPlugins() { if(!exists) { _plugins.append(plugin); plugin->retranslate(); + connect(plugin, SIGNAL(notify(Notify::NotifyType,QString, QWidget*)), + this, SIGNAL(notify(Notify::NotifyType,QString, QWidget*))); } } } diff --git a/src/mdictionary/backbone/backbone.h b/src/mdictionary/backbone/backbone.h index 89a9da7..2ef3bc7 100644 --- a/src/mdictionary/backbone/backbone.h +++ b/src/mdictionary/backbone/backbone.h @@ -274,7 +274,7 @@ Q_SIGNALS: different ways \param QString text of the notification */ - void notify(Notify::NotifyType, QString); + void notify(Notify::NotifyType, QString, QWidget*parent = 0); private Q_SLOTS: void bookmarksListReady(); diff --git a/src/mdictionary/gui/DictManagerWidget.cpp b/src/mdictionary/gui/DictManagerWidget.cpp index ba38115..2e96e65 100644 --- a/src/mdictionary/gui/DictManagerWidget.cpp +++ b/src/mdictionary/gui/DictManagerWidget.cpp @@ -27,6 +27,7 @@ #include "DictTypeSelectDialog.h" #include #include "../../include/DictDialog.h" +#include "MenuWidget.h" DictManagerWidget::DictManagerWidget(GUIInterface *parent) : QDialog(parent) { @@ -175,10 +176,13 @@ void DictManagerWidget::addNewDictButtonClicked() { #endif CommonDictInterface* selectedPlugin = - DictTypeSelectDialog::addNewDict(guiInterface->getPlugins(),this); + DictTypeSelectDialog::addNewDict( + guiInterface->getPlugins(), + menuWidget->applicationMenu()); + if(selectedPlugin != NULL) { Settings* settings = - selectedPlugin->dictDialog()->addNewDictionary(this); + selectedPlugin->dictDialog()->addNewDictionary(menuWidget->applicationMenu()); if(settings != NULL) { CommonDictInterface* newDict = selectedPlugin->getNew(settings); @@ -221,7 +225,7 @@ void DictManagerWidget::settingsButtonClicked() { #endif QList selected = dictListWidget->selectedItems(); if(selected.count() > 0) { - dictsHash[selected[0]]->dictDialog()->changeSettings(this); + dictsHash[selected[0]]->dictDialog()->changeSettings(menuWidget->applicationMenu()); } refreshDictsList(); } diff --git a/src/mdictionary/gui/DictManagerWidget.h b/src/mdictionary/gui/DictManagerWidget.h index ada3af8..56e5989 100644 --- a/src/mdictionary/gui/DictManagerWidget.h +++ b/src/mdictionary/gui/DictManagerWidget.h @@ -28,6 +28,7 @@ #include #include #include "../../include/GUIInterface.h" +#include "MenuWidget.h" //! Implements dictionaries management widget @@ -48,6 +49,8 @@ public: */ explicit DictManagerWidget(GUIInterface *parent = 0); + void setMenuWidget(MenuWidget *w) {menuWidget = w;} + protected: void showEvent(QShowEvent *e); void hideEvent(QHideEvent *e); @@ -73,6 +76,7 @@ Q_SIGNALS: public Q_SLOTS: + #ifndef Q_WS_MAEMO_5 void save(); #endif @@ -122,6 +126,8 @@ private: QPushButton* closeButton; bool _save; #endif + + MenuWidget* menuWidget; }; #endif // DICTMANAGERWIDGET_H diff --git a/src/mdictionary/gui/MainWindow.cpp b/src/mdictionary/gui/MainWindow.cpp index 16257c6..42bd584 100644 --- a/src/mdictionary/gui/MainWindow.cpp +++ b/src/mdictionary/gui/MainWindow.cpp @@ -123,6 +123,8 @@ void MainWindow::initializeMenu() { menuWidget->addSubMenu(tr("About"), aboutWidget); menuBar->addAction(menuWidget); + + dictManagerWidget->setMenuWidget(menuWidget); #else dictionariesAction = menuBar->addAction(tr("Dictionaries")); connect(dictionariesAction, SIGNAL(triggered()), @@ -143,6 +145,7 @@ void MainWindow::initializeMenu() { aboutAction = menuBar->addAction(tr("About")); connect(aboutAction, SIGNAL(triggered()), aboutWidget, SLOT(show())); + #endif } @@ -371,8 +374,8 @@ Settings* MainWindow::settings() { } -void MainWindow::showNotification(Notify::NotifyType type, QString text) { - notifyManager->showNotification(type, text); +void MainWindow::showNotification(Notify::NotifyType type, QString text, QWidget* parent) { + notifyManager->showNotification(type, text, parent); } void MainWindow::connectBackbone() { @@ -435,8 +438,8 @@ void MainWindow::connectBackbone() { connect(backbone, SIGNAL(searchCanceled()), this, SIGNAL(setIdle())); - connect(backbone, SIGNAL(notify(Notify::NotifyType,QString)), - this, SLOT(showNotification(Notify::NotifyType,QString))); + connect(backbone, SIGNAL(notify(Notify::NotifyType,QString, QWidget*)), + this, SLOT(showNotification(Notify::NotifyType,QString, QWidget*))); } void MainWindow::connectSearchBar() { diff --git a/src/mdictionary/gui/MainWindow.h b/src/mdictionary/gui/MainWindow.h index b4738b3..3e7e95c 100644 --- a/src/mdictionary/gui/MainWindow.h +++ b/src/mdictionary/gui/MainWindow.h @@ -220,7 +220,7 @@ public: \param type type of notification \param message notification message */ - void showNotification(Notify::NotifyType type, QString message); + void showNotification(Notify::NotifyType type, QString message, QWidget *parent=0); private Q_SLOTS: //! Disables menu diff --git a/src/mdictionary/gui/MenuWidget.cpp b/src/mdictionary/gui/MenuWidget.cpp index f2d894a..146b765 100644 --- a/src/mdictionary/gui/MenuWidget.cpp +++ b/src/mdictionary/gui/MenuWidget.cpp @@ -64,9 +64,17 @@ QWidget* MenuWidget::createWidget(QWidget *) { its parent to NULL and prevent it from delete, so we can still use this widget*/ return tabWidget; +} +QWidget* MenuWidget::applicationMenu() { + return tabWidget->parentWidget(); } void MenuWidget::hideMenu() { tabWidget->parentWidget()->hide(); } + + +void MenuWidget::showMenu() { + tabWidget->parentWidget()->show(); +} diff --git a/src/mdictionary/gui/MenuWidget.h b/src/mdictionary/gui/MenuWidget.h index 238bff8..448e31c 100644 --- a/src/mdictionary/gui/MenuWidget.h +++ b/src/mdictionary/gui/MenuWidget.h @@ -50,12 +50,16 @@ public: */ void removeSubMenu(QString title); + QWidget* applicationMenu(); + public Q_SLOTS: /*! Hides menu */ void hideMenu(); + void showMenu(); + protected: MenuTabWidget* tabWidget; QWidget* createWidget(QWidget *parent); diff --git a/src/mdictionary/gui/NotifyManager.cpp b/src/mdictionary/gui/NotifyManager.cpp index c054f8d..eeed43b 100644 --- a/src/mdictionary/gui/NotifyManager.cpp +++ b/src/mdictionary/gui/NotifyManager.cpp @@ -33,6 +33,7 @@ NotifyManager::NotifyManager(QObject *parent) : QObject(parent) { + } @@ -59,27 +60,33 @@ void NotifyManager::screenChanged() { } } -void NotifyManager::showNotification(Notify::NotifyType type, QString text) { +void NotifyManager::showNotification(Notify::NotifyType type, QString text, QWidget* parent) { if(activeNotifies.contains(text)) { return; } + if(parent == 0) + parent = qobject_cast(this->parent()); #ifdef Q_WS_MAEMO_5 QMaemo5InformationBox* mbox = - new QMaemo5InformationBox(0); + new QMaemo5InformationBox(parent); - QLabel* infoLabel = new QLabel(text); + QLabel* infoLabel = new QLabel(text, mbox); infoLabel->setAlignment(Qt::AlignCenter); infoLabel->setWordWrap(true); + infoLabel->setMargin(10); + mbox->setWidget(infoLabel); + #else QMessageBox* mbox = - new QMessageBox(qobject_cast(this->parent())); + new QMessageBox(parent); #endif + switch(type) { case Notify::Info: @@ -90,6 +97,7 @@ void NotifyManager::showNotification(Notify::NotifyType type, QString text) { mbox->setWindowTitle(tr("Information")); mbox->setIcon(QMessageBox::Information); + #endif break; @@ -111,7 +119,6 @@ void NotifyManager::showNotification(Notify::NotifyType type, QString text) { #endif break; } - activeNotifies.insert(text, mbox); connect(mbox, SIGNAL(finished(int)), this, SLOT(notificationClosed())); mbox->exec(); diff --git a/src/mdictionary/gui/NotifyManager.h b/src/mdictionary/gui/NotifyManager.h index 57bd309..f42645e 100644 --- a/src/mdictionary/gui/NotifyManager.h +++ b/src/mdictionary/gui/NotifyManager.h @@ -30,6 +30,7 @@ #include #include #include "../../include/Notify.h" +#include "MenuWidget.h" //! Manages notifications in applications /*! @@ -52,7 +53,7 @@ public slots: \param text text of notification \sa Notify::NotifyType */ - void showNotification(Notify::NotifyType type, QString text); + void showNotification(Notify::NotifyType type, QString text, QWidget*parent=0); //! Refresh all notifications when stacked widgets changes void screenChanged(); diff --git a/src/plugins/xdxf/XdxfDialog.cpp b/src/plugins/xdxf/XdxfDialog.cpp new file mode 100644 index 0000000..dee28ef --- /dev/null +++ b/src/plugins/xdxf/XdxfDialog.cpp @@ -0,0 +1,241 @@ +/******************************************************************************* + + This file is part of mDictionary. + + mDictionary is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + mDictionary is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with mDictionary. If not, see . + + Copyright 2010 Comarch S.A. + +*******************************************************************************/ + +//Created by Mateusz Półrola + +#include "XdxfDialog.h" +#include + +XdxfDialog::XdxfDialog(XdxfPlugin *plugin, + XdxfDialogType type, + QWidget *parent) : + QDialog(parent) { + this->plugin = plugin; + this->type = type; + + initializeUI(); + + connect(cacheCheckBox, SIGNAL(toggled(bool)), + this, SLOT(setGenerateCache(bool))); + + connect(accentsCheckBox, SIGNAL(toggled(bool)), + this, SLOT(setAccents(bool))); + + connect(accentsInfoToolButton, SIGNAL(clicked()), + this, SLOT(showAccentsInfo())); + + connect(cacheInfoToolButton, SIGNAL(clicked()), + this, SLOT(showCacheInfo())); + + if(type == New) { + connect(browseButton, SIGNAL(clicked()), + this, SLOT(selectFile())); + + connect(addButton, SIGNAL(clicked()), + this, SLOT(accept())); + } + else { + connect(saveButton, SIGNAL(clicked()), + this, SLOT(accept())); + } +} + + +void XdxfDialog::initializeUI() { + mainVerticalLayout = new QVBoxLayout; + widget = new QWidget; + widget->setLayout(mainVerticalLayout); + + if(type == New) { + setWindowTitle(tr("Add new XDXF dictionary")); + + + browseLayout = new QHBoxLayout; + browseButton = new QPushButton(tr("Browse")); + browseLabel = new QLabel(tr("Dictionary file: not selected")); + + browseLayout->addWidget(browseLabel, 0, Qt::AlignLeft); + browseLayout->addWidget(browseButton, 0, Qt::AlignRight); + + mainVerticalLayout->addLayout(browseLayout); + } + else { + setWindowTitle(tr("XDXF Settings")); + + + infoLabel = new QLabel; + + infoLabel->setText(tr("Plugin: ") + plugin->type().toUpper() +"\n" + + tr("From: ") + plugin->langFrom() + "\n" + + tr("To: ") + plugin->langTo() + "\n" + + tr("Description: ") + plugin->name() + "\n" + + tr("License: ") + plugin->infoNote()); + infoLabel->setWordWrap(true); + mainVerticalLayout->addWidget(infoLabel); + } + + accentsCheckBox = new QCheckBox(tr("Strip accents")); + accentsInfoToolButton = new QToolButton; + accentsInfoToolButton->setIcon(QIcon::fromTheme("general_information")); + + accentsLayout = new QHBoxLayout; + accentsLayout->addWidget(accentsCheckBox); + accentsLayout->addWidget(accentsInfoToolButton); + + + cacheCheckBox = new QCheckBox(tr("Optimize for quicker searches")); + cacheInfoToolButton = new QToolButton; + cacheInfoToolButton->setIcon(QIcon::fromTheme("general_information")); + + cacheLayout = new QHBoxLayout; + cacheLayout->addWidget(cacheCheckBox); + cacheLayout->addWidget(cacheInfoToolButton); + + 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; + } + else { + accentsCheckBox->setChecked(false); + _accents = false; + } + } + + if(type == New) { + addButton = new QPushButton(tr("Add")); + mainVerticalLayout->addWidget(addButton); + } + else { + saveButton = new QPushButton(tr("Save settings")); + mainVerticalLayout->addWidget(saveButton); + } + + scrollArea = new QScrollArea; + scrollArea->setWidget(widget); + scrollArea->setWidgetResizable(true); + scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + + layout = new QHBoxLayout; + layout->addWidget(scrollArea); + setLayout(layout); +} + + +void XdxfDialog::setAccents(bool accents) { + _accents = accents; +} + +void XdxfDialog::setGenerateCache(bool generate) { + _generateCache = generate; + + if(generate) { + _lastAccents = _accents; + accentsCheckBox->setChecked(true); + } + else + accentsCheckBox->setChecked(_lastAccents); + + accentsCheckBox->setEnabled(!generate); +} + +void XdxfDialog::selectFile() { + QString fileName = QFileDialog::getOpenFileName(this, + tr("Select dictionary file"), + _dictionaryFilePath, + tr("XDXF Files (*.xdxf)"), + NULL, + NULL); + + if (!fileName.isEmpty()) { + browseLabel->setText(tr("Dictionary file: %1").arg(fileName)); + _dictionaryFilePath = fileName; + } +} + +void XdxfDialog::saveSettings() { + _settings = new Settings; + if(plugin) { + foreach(QString key, plugin->settings()->keys()) + _settings->setValue(key, plugin->settings()->value(key)); + } + else { + _settings->setValue("path", _dictionaryFilePath); + } + + if(_generateCache) + _settings->setValue("generateCache", "true"); + else + _settings->setValue("generateCache", "false"); + + if(_accents) + _settings->setValue("strip_accents", "true"); + else + _settings->setValue("strip_accents", "false"); +} + +void XdxfDialog::accept() { + if(type == New && _dictionaryFilePath.isEmpty()) { + Q_EMIT notify(Notify::Warning, tr("File path is not set"), this); + + return; + } + + saveSettings(); + QDialog::accept(); +} + +Settings* XdxfDialog::getSettings() { + return _settings; +} + +void XdxfDialog::showCacheInfo() { + Q_EMIT notify(Notify::Info, tr("Optimize for quicker searches (may take some time)"), this); +} + +void XdxfDialog::showAccentsInfo() { + Q_EMIT notify(Notify::Info, tr("Strip accents (searching takes more " + "time, but spelling don't have to be exact)"), this); +} + diff --git a/src/plugins/xdxf/XdxfDialog.h b/src/plugins/xdxf/XdxfDialog.h new file mode 100644 index 0000000..a9af3d8 --- /dev/null +++ b/src/plugins/xdxf/XdxfDialog.h @@ -0,0 +1,96 @@ +/******************************************************************************* + + This file is part of mDictionary. + + mDictionary is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + mDictionary is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with mDictionary. If not, see . + + Copyright 2010 Comarch S.A. + +*******************************************************************************/ + +//Created by Mateusz Półrola + +#ifndef XDXFDIALOG_H +#define XDXFDIALOG_H + +#include +#include "../../include/settings.h" +#include +#include "xdxfplugin.h" + +class XdxfDialog : public QDialog +{ + Q_OBJECT +public: + enum XdxfDialogType {New, Change}; + + explicit XdxfDialog(XdxfPlugin* plugin = 0, XdxfDialogType type = New, + QWidget *parent = 0); + + Settings* getSettings(); + +Q_SIGNALS: + void notify(Notify::NotifyType, QString, QWidget*); + +public Q_SLOTS: + void accept(); + +private Q_SLOTS: + void selectFile(); + void saveSettings(); + void setGenerateCache(bool); + void setAccents(bool); + + void showCacheInfo(); + void showAccentsInfo(); + + +private: + void initializeUI(); + + QLabel* browseLabel; + QPushButton* browseButton; + QHBoxLayout* browseLayout; + + QLabel* infoLabel; + + QCheckBox* cacheCheckBox; + QCheckBox* accentsCheckBox; + QHBoxLayout* cacheLayout; + QHBoxLayout* accentsLayout; + QToolButton* cacheInfoToolButton; + QToolButton* accentsInfoToolButton; + + QPushButton* saveButton; + QPushButton* addButton; + + QString _dictionaryFilePath; + + QScrollArea* scrollArea; + + QWidget* widget; + QHBoxLayout* layout; + + QVBoxLayout* mainVerticalLayout; + bool _generateCache; + bool _accents; + bool _lastAccents; + + Settings* _settings; + + XdxfPlugin* plugin; + XdxfDialogType type; +}; + +#endif // XDXFDIALOG_H diff --git a/src/plugins/xdxf/XdxfDictDialog.cpp b/src/plugins/xdxf/XdxfDictDialog.cpp index 2deb306..f1bcad2 100644 --- a/src/plugins/xdxf/XdxfDictDialog.cpp +++ b/src/plugins/xdxf/XdxfDictDialog.cpp @@ -27,6 +27,8 @@ #include "XdxfLoadDialog.h" #include "XdxfSettingsDialog.h" #include "xdxfplugin.h" +#include "XdxfDialog.h" +#include XdxfDictDialog::XdxfDictDialog(XdxfPlugin *plugin, QObject *parent) : DictDialog(parent) { @@ -34,9 +36,25 @@ XdxfDictDialog::XdxfDictDialog(XdxfPlugin *plugin, QObject *parent) : } Settings* XdxfDictDialog::addNewDictionary(QWidget *parent) { - return XdxfLoadDialog::getSettings(parent); + qDebug()<setSettings(d.getSettings()); + } } diff --git a/src/plugins/xdxf/xdxf.pro b/src/plugins/xdxf/xdxf.pro index 1fe7ee8..03e714e 100644 --- a/src/plugins/xdxf/xdxf.pro +++ b/src/plugins/xdxf/xdxf.pro @@ -8,7 +8,8 @@ SOURCES += \ XdxfLoadDialog.cpp \ XdxfDictDialog.cpp \ XdxfSettingsDialog.cpp \ - XdxfCachingDialog.cpp + XdxfCachingDialog.cpp \ + XdxfDialog.cpp HEADERS += \ @@ -21,7 +22,8 @@ HEADERS += \ ../../include/settings.h \ ../../include/CommonDictInterface.h \ XdxfSettingsDialog.h \ - XdxfCachingDialog.h + XdxfCachingDialog.h \ + XdxfDialog.h RESOURCES += \ xdxf.qrc diff --git a/src/plugins/xdxf/xdxfplugin.cpp b/src/plugins/xdxf/xdxfplugin.cpp index 33a15d4..533350b 100644 --- a/src/plugins/xdxf/xdxfplugin.cpp +++ b/src/plugins/xdxf/xdxfplugin.cpp @@ -30,9 +30,15 @@ XdxfPlugin::XdxfPlugin(QObject *parent) : CommonDictInterface(parent), _langFrom(""), _langTo(""),_name(""), _infoNote("") { _settings = new Settings(); - _dictDialog = new XdxfDictDialog(this); + _dictDialog = new XdxfDictDialog(this, this); + + connect(_dictDialog, SIGNAL(notify(Notify::NotifyType,QString, QWidget*)), + this, SIGNAL(notify(Notify::NotifyType,QString, QWidget*))); + cachingDialog = new XdxfCachingDialog(this); + + _settings->setValue("type","xdxf"); _icon = QIcon("/usr/share/mdictionary/xdxf.png"); _wordsCount = -1; -- 1.7.9.5