target.path =$$BINDIR
+maemo5 {
desktop.path = $$DATADIR/applications/hildon
- desktop.files += ../../../data/other/$${TARGET}.desktop
-
icon64.path = $$DATADIR/icons/hicolor/64x64/hildon
+}
+
+unix {
+ desktop.path = $$DATADIR/applications
+ icon64.path = $$DATADIR/icons
+}
+ desktop.files += ../../../data/other/$${TARGET}.desktop
icon64.files += ../../../data/icons/64x64/$${TARGET}.png
}
#include "../../includes/DictDialog.h"
DictManagerWidget::DictManagerWidget(GUIInterface *parent) :
- QWidget(parent) {
+ QDialog(parent) {
+
- this->guiInterface = parent;
+ setWindowTitle(tr("Dictionaries"));
+ this->guiInterface = parent;
verticalLayout = new QVBoxLayout;
setLayout(verticalLayout);
change settings of selected dict. All changes are saved automatically after
hiding of this widget.
*/
-class DictManagerWidget : public QWidget {
+class DictManagerWidget : public QDialog {
Q_OBJECT
public:
//! Constructor
//only create it with this widget as parent
translationWidget = new TranslationWidget(this);
- ui->centralWidget->layout()->addWidget(wordListWidget);
+ #ifdef Q_WS_MAEMO_5
+ ui->centralWidget->layout()->addWidget(wordListWidget);
+ #else
+ splitter = new QSplitter(Qt::Horizontal);
+ splitter->addWidget(wordListWidget);
+ splitter->addWidget(translationWidget);
+ splitter->setStretchFactor(1, 150);
+ ui->centralWidget->layout()->addWidget(splitter);
+ #endif
ui->centralWidget->layout()->addWidget(searchBarWidget);
dictManagerWidget = new DictManagerWidget(this);
+ dictManagerWidget->hide();
+ #ifdef Q_WS_MAEMO_5
+ menuWidget = new MenuWidget(this);
+ menuWidget->addSubMenu(tr("Dictionaries"), dictManagerWidget);
+ menuWidget->addSubMenu(tr("Settings"), new QPushButton("Settings"));
+ menuWidget->addSubMenu(tr("About"), new QPushButton("About"));
+ ui->menuBar->addAction(menuWidget);
+ #else
+ dictionariesAction = ui->menuBar->addAction(tr("Dictionaries"));
+ connect(dictionariesAction, SIGNAL(triggered()),
+ dictManagerWidget, SLOT(show()));
+ #endif
- menuWidget = new MenuWidget(this);
- menuWidget->addSubMenu(tr("Dictionaries"), dictManagerWidget);
- menuWidget->addSubMenu(tr("Settings"), new QPushButton("Settings"));
- menuWidget->addSubMenu(tr("About"), new QPushButton("About"));
-
- ui->menuBar->addAction(menuWidget);
}
void MainWindow::closeEvent(QCloseEvent *event) {
}
void MainWindow::disableMenu() {
- if(ui->menuBar->actions().contains(menuWidget)) {
- ui->menuBar->removeAction(menuWidget);
- }
+ #ifdef Q_WS_MAEMO_5
+ if(ui->menuBar->actions().contains(menuWidget)) {
+ ui->menuBar->removeAction(menuWidget);
+ }
+ #else
+ ui->menuBar->setEnabled(false);
+ #endif
}
void MainWindow::enableMenu() {
- if(!ui->menuBar->actions().contains(menuWidget)) {
- ui->menuBar->addAction(menuWidget);
- }
+ #ifdef Q_WS_MAEMO_5
+ if(!ui->menuBar->actions().contains(menuWidget)) {
+ ui->menuBar->addAction(menuWidget);
+ }
+ #else
+ ui->menuBar->setEnabled(true);
+ #endif
}
void MainWindow::showHistory() {
MenuWidget* menuWidget;
DictManagerWidget* dictManagerWidget;
+ #ifndef Q_WS_MAEMO_5
+ QSplitter* splitter;
+ QAction* dictionariesAction;
+ //QAction* edit;
+ // QAction* settingsAction;
+ //QAction* aboutAction;
+ #endif
+
bool _exactSearch;
QString searchString;
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralWidget">
- <property name="palette">
- <palette>
- <active>
- <colorrole role="Base">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>255</red>
- <green>255</green>
- <blue>255</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="Window">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </brush>
- </colorrole>
- </active>
- <inactive>
- <colorrole role="Base">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>255</red>
- <green>255</green>
- <blue>255</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="Window">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </brush>
- </colorrole>
- </inactive>
- <disabled>
- <colorrole role="Base">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="Window">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </brush>
- </colorrole>
- </disabled>
- </palette>
- </property>
<property name="autoFillBackground">
- <bool>true</bool>
+ <bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout"/>
</widget>
</rect>
</property>
</widget>
- <widget class="QToolBar" name="mainToolBar">
- <attribute name="toolBarArea">
- <enum>TopToolBarArea</enum>
- </attribute>
- <attribute name="toolBarBreak">
- <bool>false</bool>
- </attribute>
- </widget>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
initializeUI();
- setMaximumHeight(150);
_isSearching = false;
void SearchBarWidget::initializeUI() {
+
+ #ifdef Q_WS_MAEMO_5
+ setMaximumHeight(150);
+ #else
+ setMaximumHeight(100);
+ #endif
+
+
horizontalLayout = new QHBoxLayout();
verticalLayout = new QVBoxLayout();
#endif
-
//create layout for lineEdit to have clear button on it
QHBoxLayout* lineEditLayout = new QHBoxLayout;
searchWordLineEdit->setLayout(lineEditLayout);
clearSearchWordToolButton = new QToolButton();
-
#ifdef Q_WS_MAEMO_5
clearSearchWordToolButton->setIcon(QIcon::fromTheme("general_stop"));
//tool buttons will have size 2 times smaller
clearSearchWordToolButton->sizeHint().height()*2);
#endif
+
+
historyPrevToolButton = new QToolButton();
#ifdef Q_WS_MAEMO_5
historyPrevToolButton->setIcon(
clearSearchWordToolButton->sizeHint().height()*2);
#endif
+
+
historyShowToolButton = new QToolButton();
#ifdef Q_WS_MAEMO_5
historyShowToolButton->setIcon(
searchingProgressBar->setMinimum(0);
searchingProgressBar->setMaximum(0);
searchingProgressBar->hide();
- searchingProgressBar->setMaximumHeight(50);
+ #ifdef Q_WS_MAEMO_5
+ searchingProgressBar->setMaximumHeight(50);
+ #endif
setLayout(verticalLayout);
wordListModel = new QStringListModel();
-
connect(this, SIGNAL(clicked(QModelIndex)),
this, SLOT(itemClicked(QModelIndex)));
+
setModel(wordListModel);
}
QModelIndex newWordIndex = wordListModel->index(wordsCount);
wordListModel->setData(newWordIndex, word);
+
}
void WordListWidget::clear() {
cancelButton = new QPushButton(tr("Cancel"));
+ cachingLabel = new QLabel();
+ cachingLabel->hide();
+
+
+ verticalLayout->addWidget(cachingLabel);
verticalLayout->addWidget(cachingProgressBar);
verticalLayout->addWidget(cancelButton);
void XdxfCachingDialog::updateCachingProgress(int progress, int time) {
cachingProgressBar->setValue(progress);
+ if(!cachingLabel->isVisible())
+ cachingLabel->show();
int seconds = float((100 - progress)*time) / (5*1000);
- setWindowTitle(tr("Caching dictionary, please wait ") + "( " +
- QString::number(seconds) + tr(" seconds left") + " )");
+ cachingLabel->setText(tr("Estimated time left: ") +
+ QString::number(seconds) + tr(" seconds"));
}
QXmlStreamReader reader(&dictionaryFile);
-
db.setDatabaseName(cachePathN);
if(!db.open()) {
- qDebug() << "Database error" << endl;
+ qDebug() << "Database error" << db.lastError().text() << endl;
return false;
}
QCoreApplication::processEvents();
while (!reader.atEnd() && !stopped) {
QCoreApplication::processEvents();
- usleep(50);
+ //usleep(50);
reader.readNext();
if(reader.tokenType() == QXmlStreamReader::StartElement) {