#include <QDebug>
#include "../../includes/DictDialog.h"
-DictManagerWidget::DictManagerWidget(Backbone* backbone, QWidget *parent) :
+DictManagerWidget::DictManagerWidget(GUIInterface *parent) :
QWidget(parent) {
- this->backbone = backbone;
+ this->guiInterface = parent;
verticalLayout = new QVBoxLayout;
removeDictButton->setEnabled(false);
settingsButton->setEnabled(false);
- QHash<CommonDictInterface*, bool> dicts = backbone->getDictionaries();
-
+ QHash<CommonDictInterface*, bool> dicts = guiInterface->getDictionaries();
QHashIterator<CommonDictInterface*, bool> i(dicts);
}
void DictManagerWidget::showEvent(QShowEvent *e) {
-
refreshDictsList();
QWidget::showEvent(e);
}
checkedDicts.push_back(dictsHash[item]);
}
}
- backbone->selectedDictionaries(checkedDicts);
+ emit selectedDictionaries(checkedDicts);
QWidget::hideEvent(e);
}
void DictManagerWidget::addNewDictButtonClicked() {
CommonDictInterface* selectedPlugin =
- DictTypeSelectDialog::addNewDict(backbone->getPlugins(),this);
+ DictTypeSelectDialog::addNewDict(guiInterface->getPlugins(),this);
if(selectedPlugin != NULL) {
Settings* settings =
selectedPlugin->dictDialog()->addNewDictionary(this);
if(settings != NULL) {
CommonDictInterface* newDict = selectedPlugin->getNew(settings);
- backbone->addDictionary(newDict);
+ emit addDictionary(newDict);
refreshDictsList();
}
}
void DictManagerWidget::removeButtonClicked() {
QList<QListWidgetItem*> selected = dictListWidget->selectedItems();
if(selected.count() > 0) {
- backbone->removeDictionary(dictsHash[selected[0]]);
+ emit removeDictionary(dictsHash[selected[0]]);
refreshDictsList();
}
}