#endif
- setWindowIcon(QIcon(":/icons/64x64/mdictionary.png"));
- setWindowTitle("mDictionary");
-
/*translationWidget is another stacked window, so we don't add it to
- layout only create it with this widget as parent
+ layout, only create it with this widget as parent
it must be created as first object in main window, otherwise sometimes
- when app starts in maemo, when trying to set stacked window attribure
+ when app starts in maemo, when trying to set stacked window attribute
it segfaults*/
translationWidget = new TranslationWidget(this);
+
+
+
+ setWindowIcon(QIcon(":/icons/64x64/mdictionary.png"));
+ setWindowTitle("mDictionary");
+
mainLayout = new QVBoxLayout();
QWidget* w = new QWidget();
w->setLayout(mainLayout);
menuBar = new QMenuBar();
setMenuBar(menuBar);
+ notifyManager = new NotifyManager(this);
+
initializeSearchWidgets();
initializeMenu();
-
- notifyManager = new NotifyManager(this);
}
void MainWindow::initializeSearchWidgets() {
mainLayout->addWidget(searchBarWidget, 0, Qt::AlignBottom);
#else
translationWidget->hide();
- //we add to splitter word list and welcome screen
+ //we add word list and welcome screen to splitter
splitter = new QSplitter(Qt::Horizontal);
splitter->addWidget(wordListWidget);
splitter->addWidget(welcomeScreenWidget);
menuWidget->addSubMenu(tr("About"), aboutWidget);
menuBar->addAction(menuWidget);
+
+ connect(menuWidget, SIGNAL(setApplicationMenu(QWidget*)),
+ notifyManager, SLOT(setMenu(QWidget*)));
#else
dictionariesAction = menuBar->addAction(tr("Dictionaries"));
connect(dictionariesAction, SIGNAL(triggered()),
aboutAction = menuBar->addAction(tr("About"));
connect(aboutAction, SIGNAL(triggered()),
aboutWidget, SLOT(show()));
+
#endif
}
settingsWidget = new SettingsWidget(this);
settingsWidget->hide();
+ connect(settingsWidget, SIGNAL(notify(Notify::NotifyType,QString)),
+ this, SLOT(showNotification(Notify::NotifyType,QString)));
+
bookmarksWidget = new BookmarksWidget(this);
bookmarksWidget->hide();
void MainWindow::connectBookmarksWidget() {
#ifdef Q_WS_MAEMO_5
- //after removing bookmarks we search for it once again to clear word list
+ //after removing bookmarks we search for them once again to clear word list
connect(bookmarksWidget, SIGNAL(removeAllBookmarks()),
this, SLOT(removeBookmarks()));
#endif
if(QMessageBox::question(par, tr("Delete all bookmarks"),
tr("Do you want to delete all bookmarks? (This action cannot be revoked)"),
- QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok) {
+ QMessageBox::Yes, QMessageBox::Cancel) == QMessageBox::Yes) {
backbone->removeAllBookmarks();
if(searchString.size())
backbone->search(searchString);