projects
/
mdictionary
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'qml' of ssh://drop.maemo.org/git/mdictionary into qml
[mdictionary]
/
src
/
mdictionary
/
gui
/
MainWindow.cpp
diff --git
a/src/mdictionary/gui/MainWindow.cpp
b/src/mdictionary/gui/MainWindow.cpp
index
c7356f8
..
e5a0b61
100644
(file)
--- a/
src/mdictionary/gui/MainWindow.cpp
+++ b/
src/mdictionary/gui/MainWindow.cpp
@@
-19,8
+19,11
@@
*******************************************************************************/
*******************************************************************************/
-//! \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>
#include "MainWindow.h"
#include <QtGui>
@@
-113,7
+116,8
@@
void MainWindow::initializeSearchWidgets() {
splitter->setStretchFactor(1, 150);
mainLayout->addWidget(splitter, 1);
splitter->setStretchFactor(1, 150);
mainLayout->addWidget(splitter, 1);
- mainLayout->addWidget(searchBarWidget, 0, Qt::AlignBottom);
+
+ mainLayout->addWidget(searchBarWidget,0, Qt::AlignBottom);
#endif
}
#endif
}
@@
-231,6
+235,8
@@
void MainWindow::wordListReady() {
setExactSearch(false);
}
}
setExactSearch(false);
}
}
+
+ wordListWidget->setFocus();
}
bool MainWindow::checkExactSearch(
}
bool MainWindow::checkExactSearch(
@@
-254,7
+260,8
@@
void MainWindow::translationsReady() {
hideWelcomeScreen();
#endif
hideWelcomeScreen();
#endif
- Q_EMIT showTranslation(backbone->htmls());
+ Q_EMIT showTranslation(backbone->xmls());
+ wordListWidget->setFocus();
#ifdef Q_WS_MAEMO_5
notifyManager->screenChanged();
#endif
#ifdef Q_WS_MAEMO_5
notifyManager->screenChanged();
#endif
@@
-288,10
+295,16
@@
QHash<CommonDictInterface*, bool> MainWindow::getDictionaries() {
return backbone->getDictionaries();
}
return backbone->getDictionaries();
}
-
+/**/
void MainWindow::search(QString word) {
setExactSearch(false);
searchBarWidget->search(word);
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::searchExact(QString word) {
@@
-359,16
+372,11
@@
void MainWindow::enableMenu() {
}
void MainWindow::showHistory(QPoint p) {
}
void MainWindow::showHistory(QPoint p) {
-
- HistoryListDialog historyDialog(backbone->history()->list(), searchBarWidget);
-
+ HistoryListDialog historyDialog(backbone->history()->list(), this );// searchBarWidget);
#ifndef Q_WS_MAEMO_5
#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() - 80);
+ historyDialog.move(p);
#endif
if(historyDialog.exec() == QDialog::Accepted) {
#endif
if(historyDialog.exec() == QDialog::Accepted) {
@@
-416,7
+424,7
@@
void MainWindow::connectBackbone() {
backbone, SLOT(search(QString)));
connect(this, SIGNAL(searchTranslations(QList<Translation*>)),
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(this, SIGNAL(stopSearching()),
backbone, SLOT(stopSearching()));
@@
-437,14
+445,14
@@
void MainWindow::connectBackbone() {
connect(backbone, SIGNAL(ready()),
this, SIGNAL(setIdle()));
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()));
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()),
this, SLOT(translationsReady()));
connect(backbone, SIGNAL(searchCanceled()),
@@
-455,6
+463,13
@@
void MainWindow::connectBackbone() {
connect(backbone, SIGNAL(closeOk()),
this, SLOT(close()));
connect(backbone, SIGNAL(closeOk()),
this, SLOT(close()));
+
+
+ //connect(wordListWidget, SIGNAL(addBookmark(QList<Translation*>)),
+ // this, SIGNAL(setBusy()));
+
+ //connect(backbone, SIGNAL(bookmarkReady()),
+ // this, SIGNAL(setIdle()));
}
void MainWindow::connectSearchBar() {
}
void MainWindow::connectSearchBar() {
@@
-518,12
+533,14
@@
void MainWindow::connectTranslationWidget() {
#ifdef Q_WS_MAEMO_5
connect(translationWidget, SIGNAL(search(QString)),
this, SLOT(search(QString)));
#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
#else
connect(translationWidget, SIGNAL(search(QString)),
this, SLOT(searchExact(QString)));
#endif
-
}
void MainWindow::connectDictManager() {
}
void MainWindow::connectDictManager() {