connectBookmarksWidget();
+
setExactSearch(false);
setWindowTitle("mDictionary");
//if nothing was found
if(res.count() == 0) {
- #ifdef Q_WS_MAEMO_5
- QMaemo5InformationBox::information(this,
- tr("Can't find any matching words"),
- QMaemo5InformationBox::DefaultTimeout);
- #endif
+ showNotify(Notify::Info, tr("Can't find any matching words"));
+
//show empty list to remove results of old search
emit showWordList(searchResult);
}
}
if(!foundExactMatch) {
- #ifdef Q_WS_MAEMO_5
- QMaemo5InformationBox::information(this,
- tr("Can't find exactly matching word"),
- QMaemo5InformationBox::DefaultTimeout);
- #endif
+ showNotify(Notify::Info,
+ tr("Can't find exactly matching word"));
emit showWordList(searchResult);
}
#ifndef Q_WS_MAEMO_5
//switch welcome screen with translation widget
if(!translationWidget->isVisible()) {
- int i = ui->centralWidget->layout()->indexOf(welcomeScreenWidget);
QBoxLayout* l = (QBoxLayout*)(ui->centralWidget->layout());
QSplitter* s = (QSplitter*)((QWidgetItem*)(l->itemAt(0))->widget());
s->insertWidget(1,translationWidget);
return backbone->settings();
}
+
+void MainWindow::showNotify(Notify::NotifyType type, QString text) {
+ switch(type) {
+ case Notify::Info:
+ #ifdef Q_WS_MAEMO_5
+ QMaemo5InformationBox::information(this,
+ text,
+ QMaemo5InformationBox::DefaultTimeout);
+ #else
+ QMessageBox::information(this, "Information", text);
+ #endif
+ break;
+
+ case Notify::Warning:
+ #ifndef Q_WS_MAEMO_5
+ QMessageBox::warning(this, "Warning", text);
+ break;
+ #endif
+
+ case Notify::Error:
+ #ifdef Q_WS_MAEMO_5
+ QMaemo5InformationBox::information(this,
+ text,
+ QMaemo5InformationBox::NoTimeout);
+ #else
+ QMessageBox::critical(this, "Error", text);
+ #endif
+ break;
+ }
+}
+
void MainWindow::connectBackbone() {
connect(this, SIGNAL(quit()),
backbone, SLOT(quit()));