*******************************************************************************/
-//! \file MainWindow.cpp
-//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
+/*! \file MainWindow.cpp
+ \brief Implements interface for GUI
+
+ \author Mateusz Półrola <mateusz.polrola@comarch.pl>
+*/
#include "MainWindow.h"
#include <QtGui>
splitter->setStretchFactor(1, 150);
mainLayout->addWidget(splitter, 1);
- mainLayout->addWidget(searchBarWidget, 0, Qt::AlignBottom);
+
+ mainLayout->addWidget(searchBarWidget,0, Qt::AlignBottom);
#endif
}
connect(menuWidget, SIGNAL(setApplicationMenu(QWidget*)),
notifyManager, SLOT(setMenu(QWidget*)));
#else
- dictionariesAction = menuBar->addAction(tr("Dictionaries"));
+ dictionariesAction = menuBar->addAction(tr("&Dictionaries"));
connect(dictionariesAction, SIGNAL(triggered()),
dictManagerWidget, SLOT(show()));
- settingsAction = menuBar->addAction(tr("Settings"));
+ settingsAction = menuBar->addAction(tr("&Settings"));
connect(settingsAction, SIGNAL(triggered()),
settingsWidget, SLOT(show()));
- QMenu* m = menuBar->addMenu(tr("Bookmarks"));
+ QMenu* m = menuBar->addMenu(tr("&Bookmarks"));
bookmarksShowAllAction = new QAction(tr("Show all"), m);
bookmarksRemoveAllAction = new QAction(tr("Remove all"), m);
m->addAction(bookmarksShowAllAction);
m->addAction(bookmarksRemoveAllAction);
- aboutAction = menuBar->addAction(tr("About"));
+ aboutAction = menuBar->addAction(tr("&About"));
connect(aboutAction, SIGNAL(triggered()),
aboutWidget, SLOT(show()));
setExactSearch(false);
}
}
+ wordListWidget->setFocus();
}
bool MainWindow::checkExactSearch(
hideWelcomeScreen();
#endif
- Q_EMIT showTranslation(backbone->htmls());
+ Q_EMIT showTranslation(backbone->xmls());
+ wordListWidget->setFocus();
#ifdef Q_WS_MAEMO_5
notifyManager->screenChanged();
#endif
return backbone->getDictionaries();
}
-
+/**/
void MainWindow::search(QString word) {
setExactSearch(false);
searchBarWidget->search(word);
+ #ifdef Q_WS_MAEMO_5
+ if(translationWidget->isVisible()) {
+ translationWidget->hide();
+ update();
+ }
+ #endif
}
void MainWindow::searchExact(QString word) {
}
void MainWindow::showHistory(QPoint p) {
-
- HistoryListDialog historyDialog(backbone->history()->list(), searchBarWidget);
-
+ HistoryListDialog historyDialog(backbone->history()->list(), this );// searchBarWidget);
#ifndef Q_WS_MAEMO_5
- QPoint newPos = mapFromGlobal(p);
- newPos.setY(searchBarWidget->pos().y() -
- historyDialog.sizeHint().height());
- newPos.setX(width() - historyDialog.sizeHint().width());
-
- historyDialog.move(newPos);
+ p.setX(p.x() - historyDialog.sizeHint().width() + 5);
+ p.setY(p.y() - historyDialog.sizeHint().height()- 10); //- 80);
+ historyDialog.move(p);
#endif
if(historyDialog.exec() == QDialog::Accepted) {
backbone, SLOT(search(QString)));
connect(this, SIGNAL(searchTranslations(QList<Translation*>)),
- backbone, SLOT(searchHtml(QList<Translation*>)));
+ backbone, SLOT(searchXml(QList<Translation*>)));
connect(this, SIGNAL(stopSearching()),
backbone, SLOT(stopSearching()));
connect(backbone, SIGNAL(ready()),
this, SIGNAL(setIdle()));
- connect(backbone, SIGNAL(htmlReady()),
+ connect(backbone, SIGNAL(xmlReady()),
this, SIGNAL(setIdle()));
connect(backbone, SIGNAL(ready()),
this, SLOT(wordListReady()));
- connect(backbone, SIGNAL(htmlReady()),
+ connect(backbone, SIGNAL(xmlReady()),
this, SLOT(translationsReady()));
connect(backbone, SIGNAL(searchCanceled()),
connect(backbone, SIGNAL(closeOk()),
this, SLOT(close()));
+
+ connect(backbone, SIGNAL(bookmarkMode()),
+ this, SIGNAL(bookmarkMode()));
+
+
+ //connect(wordListWidget, SIGNAL(addBookmark(QList<Translation*>)),
+ // this, SIGNAL(setBusy()));
+
+ //connect(backbone, SIGNAL(bookmarkReady()),
+ // this, SIGNAL(setIdle()));
}
void MainWindow::connectSearchBar() {
connect(this, SIGNAL(setIdle()),
wordListWidget, SLOT(unlockList()));
+ connect(this, SIGNAL(bookmarkMode()),
+ wordListWidget, SLOT(bookmarkModeActive()));
+
connect(wordListWidget, SIGNAL(addBookmark(QList<Translation*>)),
backbone, SLOT(addBookmark(QList<Translation*>)));
#ifdef Q_WS_MAEMO_5
connect(translationWidget, SIGNAL(search(QString)),
this, SLOT(search(QString)));
+
+ connect(translationWidget, SIGNAL(notify(Notify::NotifyType, QString)),
+ this, SLOT(showNotification(Notify::NotifyType,QString)));
#else
connect(translationWidget, SIGNAL(search(QString)),
this, SLOT(searchExact(QString)));
#endif
-
}
void MainWindow::connectDictManager() {
backbone->removeAllBookmarks();
((WordListWidget*)wordListWidget)->clear();
}
-
-
}