#ifndef Q_WS_MAEMO_5
qmlView = new QDeclarativeView(this);
- qmlView->setSource(QUrl::fromLocalFile("/usr/share/mdictionary/qml/DictManagerWidget.qml"));
+
ctxt = qmlView->rootContext();
refreshDictsList();
ctxt->setContextProperty("dictModel", &(*model));
+ qmlView->setSource(QUrl::fromLocalFile("/usr/share/mdictionary/qml/DictManagerWidget.qml"));
QGraphicsObject *rootObject = qmlView->rootObject();
- //connect(rootObject, SIGNAL(selectedRow(int)),
- // this, SLOT(pluginSelected(int)));
qmlView->setResizeMode(QDeclarativeView::SizeRootObjectToView);
verticalLayout->addWidget(qmlView);
- //connecty zwrotne
#endif
#ifdef Q_WS_MAEMO_5
#endif
#ifndef Q_WS_MAEMO_5
- //pozmieniać connecty
+ connect(rootObject, SIGNAL(addButtonClicked()),
+ this, SLOT(saveChanges()));
+ connect(rootObject, SIGNAL(addButtonClicked()),
+ this, SLOT(addNewDictButtonClicked()));
+
+ connect(rootObject, SIGNAL(removeButtonClicked()),
+ this, SLOT(saveChanges()));
+ connect(rootObject, SIGNAL(removeButtonClicked()),
+ this, SLOT(removeButtonClicked()));
+
+ connect(rootObject, SIGNAL(settingsButtonClicked()),
+ this, SLOT(saveChanges()));
+ connect(rootObject, SIGNAL(settingsButtonClicked()),
+ this, SLOT(settingsButtonClicked()));
+
+ //z modelu sygnał, oraz z okienka zmian ustawień w pluginie, gdy są zmiany
+// oryginalnie:
+// connect(dictList, SIGNAL(itemChanged(QListWidgetItem*)),
+// this, SLOT(changed()));
+ connect(model, SIGNAL(itemChanged()),
+ this, SLOT(changed()));
+ //pozmieniać connecty, to jest na dwuklik mysza na liście, sprawdzić, zrobic alternatywne sloty
+ connect(rootObject, SIGNAL(itemActivated(int)),
+ this, SLOT(saveChanges()));
+ connect(rootObject, SIGNAL(itemActivated(int)),
+ this, SLOT(settingsButtonClicked()));
+
// connect(dictList, SIGNAL(itemActivated(QListWidgetItem*)),
// this, SLOT(saveChanges()));
// connect(dictList, SIGNAL(itemActivated(QListWidgetItem*)),
// setMinimumHeight(sizeHint().height());
// setMaximumHeight(sizeHint().height()*2);
//connect(closeButton, SIGNAL(clicked()), this, SLOT(save()));
+ connect(rootObject, SIGNAL(saveButtonClicked()), this, SLOT(save()));
#endif
}
QHash<CommonDictInterface*, bool> dicts = guiInterface->getDictionaries();
if (model == 0){
- qDebug("ok");
model = new DictManagerModel(dicts, this);
} else {
- qDebug("lol");
model->clear();
model->setDictionaries(dicts);
}