GUIInterface(parent),
ui(new Ui::MainWindow) {
- #ifdef Q_WS_MAEMO_5
- setAttribute(Qt::WA_Maemo5StackedWindow);
- #endif
-
this->backbone = backbone;
initializeUI();
void MainWindow::initializeUI() {
ui->setupUi(this);
- //showFullScreen();
- //sets attribute to maemo's stacked window
-
-
+ #ifdef Q_WS_MAEMO_5
+ setAttribute(Qt::WA_Maemo5StackedWindow);
+ #endif
searchBarWidget = new SearchBarWidget;
welcomeScreenWidget = new WelcomeScreenWidget;
+
#ifdef Q_WS_MAEMO_5
+ //At start we set widget as welcome screen widget
ui->centralWidget->layout()->addWidget(welcomeScreenWidget);
QVBoxLayout* vl = (QVBoxLayout*)(ui->centralWidget->layout());
vl->addWidget(searchBarWidget, 0, Qt::AlignBottom);
#else
translationWidget->hide();
+ //we add to splitter word list and welcome screen
splitter = new QSplitter(Qt::Horizontal);
splitter->addWidget(wordListWidget);
splitter->addWidget(welcomeScreenWidget);
aboutWidget->hide();
+ //creating menus
#ifdef Q_WS_MAEMO_5
menuWidget = new MenuWidget(this);
QHash<QString, QList<Translation*> > searchResult;
#ifdef Q_WS_MAEMO_5
+ //switch welcome screen with word list
if(!wordListWidget->isVisible()) {
int i = ui->centralWidget->layout()->indexOf(welcomeScreenWidget);
QBoxLayout* l = (QBoxLayout*)(ui->centralWidget->layout());
l->removeWidget(welcomeScreenWidget);
welcomeScreenWidget->deleteLater();
l->insertWidget(0, wordListWidget);
- qDebug()<<"changed";
}
#endif
}
else {
#ifndef Q_WS_MAEMO_5
+ //on desktop we show word list in exact search
emit showWordList(searchResult);
#endif
bool foundExactMatch = false;
void MainWindow::translationsReady() {
#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());
s->insertWidget(1,translationWidget);
s->setStretchFactor(1, 150);
welcomeScreenWidget->deleteLater();
- qDebug()<<"changed";
}
#endif
}
-void MainWindow::showAllBookmarks() {
- #ifdef Q_WS_MAEMO_5
- menuWidget->hideMenu();
- #endif
- backbone->fetchBookmarks();
-}
-
void MainWindow::connectBookmarksWidget() {
#ifdef Q_WS_MAEMO_5
+ //after removing bookmarks we search for it once again to clear word list
connect(bookmarksWidget, SIGNAL(removeAllBookmarks()),
backbone, SLOT(removeAllBookmark()));
+ connect(bookmarksWidget, SIGNAL(removeAllBookmarks()),
+ backbone, SLOT(fetchBookmarks()));
+
+
connect(bookmarksWidget, SIGNAL(showAllBookmarks()),
- this, SLOT(showAllBookmarks()));
+ menuWidget, SLOT(hideMenu()));
- connect(bookmarksWidget, SIGNAL(removeAllBookmarks()),
+ connect(bookmarksWidget, SIGNAL(showAllBookmarks()),
backbone, SLOT(fetchBookmarks()));
+
+
#else
connect(bookmarksShowAllAction, SIGNAL(triggered()),
backbone, SLOT(fetchBookmarks()));