Moved icons from resources to data/ fixed bug with segmentation fault when starting...
authorMateusz Półrola <mateusz.polrola@comarch.pl>
Fri, 20 Aug 2010 09:45:57 +0000 (11:45 +0200)
committerMateusz Półrola <mateusz.polrola@comarch.pl>
Fri, 20 Aug 2010 09:45:57 +0000 (11:45 +0200)
25 files changed:
data/icons/48x48/edit-select-all.png [new file with mode: 0644]
data/icons/64x64/mdictionary.png
data/icons/96x96/staroff.png [new file with mode: 0644]
data/icons/96x96/staron.png [new file with mode: 0644]
data/icons/gui.qrc [new file with mode: 0644]
data/icons/logo/mdictionary.png [new file with mode: 0755]
debian/rules
trunk/src/base/base.pro
trunk/src/base/gui/AboutWidget.cpp
trunk/src/base/gui/MainWindow.cpp
trunk/src/base/gui/MainWindow.h
trunk/src/base/gui/MainWindow.ui [deleted file]
trunk/src/base/gui/SearchBarWidget.cpp
trunk/src/base/gui/SettingsWidget.cpp
trunk/src/base/gui/TranslationWidget.cpp
trunk/src/base/gui/TranslationWidget.h
trunk/src/base/gui/WelcomeScreenWidget.cpp
trunk/src/base/gui/WordListProxyStyle.cpp
trunk/src/base/gui/WordListWidget.cpp
trunk/src/base/gui/WordListWidget.h
trunk/src/base/gui/gui.qrc [deleted file]
trunk/src/base/gui/main.cpp
trunk/src/base/gui/mdictionary.png [deleted file]
trunk/src/base/gui/staroff.png [deleted file]
trunk/src/base/gui/staron.png [deleted file]

diff --git a/data/icons/48x48/edit-select-all.png b/data/icons/48x48/edit-select-all.png
new file mode 100644 (file)
index 0000000..16d2537
Binary files /dev/null and b/data/icons/48x48/edit-select-all.png differ
index 3768425..ccd74b2 100755 (executable)
Binary files a/data/icons/64x64/mdictionary.png and b/data/icons/64x64/mdictionary.png differ
diff --git a/data/icons/96x96/staroff.png b/data/icons/96x96/staroff.png
new file mode 100644 (file)
index 0000000..3512d5b
Binary files /dev/null and b/data/icons/96x96/staroff.png differ
diff --git a/data/icons/96x96/staron.png b/data/icons/96x96/staron.png
new file mode 100644 (file)
index 0000000..216e23d
Binary files /dev/null and b/data/icons/96x96/staron.png differ
diff --git a/data/icons/gui.qrc b/data/icons/gui.qrc
new file mode 100644 (file)
index 0000000..c637dce
--- /dev/null
@@ -0,0 +1,8 @@
+<RCC>
+    <qresource prefix="/icons">
+        <file>48x48/edit-select-all.png</file>
+        <file>logo/mdictionary.png</file>
+        <file>96x96/staroff.png</file>
+        <file>96x96/staron.png</file>
+    </qresource>
+</RCC>
diff --git a/data/icons/logo/mdictionary.png b/data/icons/logo/mdictionary.png
new file mode 100755 (executable)
index 0000000..3768425
Binary files /dev/null and b/data/icons/logo/mdictionary.png differ
index 71bcc21..0bfaffc 100755 (executable)
@@ -37,7 +37,7 @@ install: build
        dh_testroot
        dh_clean -k 
        dh_installdirs
-       cd builddir && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/$(APPNAME) install
+       cd builddir && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/$(APPNAME) install 
        ./rename-plugins "$(CURDIR)/debian/$(APPNAME)/usr/lib/mdictionary"
 # Build architecture-independent files here.
 binary-indep: build install
index d902b3c..c87d985 100644 (file)
@@ -62,9 +62,10 @@ HEADERS  += gui/MainWindow.h \
     ../includes/Notify.h \
     gui/TranslationTextEdit.h
 
-FORMS += gui/MainWindow.ui
+FORMS +=
 
-RESOURCES += gui/gui.qrc
+RESOURCES += \
+    ../../../data/icons/gui.qrc
 unix { 
     # VARIABLES
     isEmpty(PREFIX):PREFIX = /usr
index f363e18..d2edb32 100644 (file)
@@ -5,65 +5,65 @@ AboutWidget::AboutWidget(GUIInterface *parent): QDialog(parent)
     QString infoNote, licenseNote, comarchNote;
     infoNote = "<center><h2><u>mDictionary</u></h2></center>";
     comarchNote = "<center>Meamo/Meego Mulitlingual Dictionary</center>";
-    comarchNote += "<center>Copyright 2006-2010, Comarch S.A. <br />";
+    comarchNote += "<center>Copyright 2006-2010, Comarch S.A. <br>";
     comarchNote += "<a href=\"http://mdictionary.garage.maemo.org\">http://mdictionary.garage.maemo.org</a></center>";
-    licenseNote = "<br><p><font size=\"small\">This program is free software: you can redistribute it and/or modify\n"
-                  "it under the terms of the GNU General Public License as published by\n"
-                  "the Free Software Foundation, either version 3 of the License, or\n"
-                  "(at your option) any later version.<br />"
-                  "This program is distributed in the hope that it will be useful,\n"
-                  "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-                  "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
-                  "GNU General Public License for more details.<br />"
-                  "You should have received a copy of the GNU General Public License\n"
-                  "along with this program.  If not, see"
-                  "&lt;<a href=\"http://www.gnu.org/licenses/\">"
-                  "http://www.gnu.org/licenses/</a>&gt;."
-                  "</p></font>";
+    licenseNote = QString("<br><p><font size=\"small\">This program is free software: you can redistribute it and/or modify\n")+
+                  QString("it under the terms of the GNU General Public License as published by\n")+
+                  QString("the Free Software Foundation, either version 3 of the License, or\n")+
+                  QString("(at your option) any later version.<br>")+
+                  QString("This program is distributed in the hope that it will be useful,\n")+
+                  QString("but WITHOUT ANY WARRANTY; without even the implied warranty of\n")+
+                  QString("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n")+
+                  QString("GNU General Public License for more details.<br>") +
+                  QString("You should have received a copy of the GNU General Public License<br>") +
+                  QString("along with this program.  If not, see") +
+                  QString("&lt;<a href=\"http://www.gnu.org/licenses/\">") +
+                  QString("http://www.gnu.org/licenses/</a>&gt;.") +
+                  QString("</p></font>");
 
     setWindowTitle(tr("About"));
-    mainLayout = new QVBoxLayout(this);
+    mainLayout = new QVBoxLayout;
 
     #ifndef Q_WS_MAEMO_5
-        scrollLayout = new QVBoxLayout(this);
-        scroll = new QScrollArea(this);
+        scrollLayout = new QVBoxLayout;
+        scroll = new QScrollArea;
         w = new QWidget(this);
 
     #endif
 
 
-    imageLabel = new QLabel(this);
-    mainLabel = new QLabel(this);
-    licenseLabel = new QLabel(this);
+    imageLabel = new QLabel;
+    mainLabel = new QLabel;
+    licenseLabel = new QLabel;
 
-    mainLayout->addWidget(imageLabel, 0, Qt::AlignHCenter);
-    mainLayout->addWidget(mainLabel, 0, Qt::AlignHCenter);
-    mainLayout->addWidget(licenseLabel, 0, Qt::AlignHCenter);
 
-    QImage img(":/icons/mdictionary.png");
+    QImage img(":/icons/logo/mdictionary.png");
     imageLabel->setPixmap(QPixmap::fromImage(img));
-    imageLabel->resize(imageLabel->pixmap()->size());
     imageLabel->setMinimumSize(imageLabel->pixmap()->size());
 
     mainLabel->setText(infoNote + comarchNote);
     mainLabel->setOpenExternalLinks(true);
+    mainLabel->setMinimumSize(mainLabel->sizeHint());
+
 
-    licenseLabel->setText(licenseNote);
     licenseLabel->setWordWrap(true);
+    licenseLabel->setText(licenseNote);
     licenseLabel->setOpenExternalLinks(true);
+    licenseLabel->setMinimumSize(licenseLabel->sizeHint());
 
-    #ifndef Q_WS_MAEMO_5
-    w->setLayout(mainLayout);
-    scroll->setWidget(w);
-    scrollLayout->addWidget(scroll, 0, Qt::AlignHCenter);
-        this->setLayout(scrollLayout);
 
-    #endif
+    mainLayout->addWidget(imageLabel, 0, Qt::AlignHCenter);
+    mainLayout->addWidget(mainLabel, 0, Qt::AlignHCenter);
+    mainLayout->addWidget(licenseLabel, 0, Qt::AlignHCenter);
 
-    #ifdef Q_WS_MAEMO_5
+
+    #ifndef Q_WS_MAEMO_5
+        w->setLayout(mainLayout);
+        scroll->setWidget(w);
+        scrollLayout->addWidget(scroll, 0, Qt::AlignHCenter);
+        this->setLayout(scrollLayout);
+        this->resize(img.width()*1.65, img.height()*2.60);
+    #else
         setLayout(mainLayout);
-        mainLayout->addSpacing(20);
     #endif
-
-    this->resize(img.width()*1.65, img.height()*2.60);
 }
index 34fcec1..24d699b 100644 (file)
 
 
 MainWindow::MainWindow(Backbone *backbone, QWidget *parent):
-    GUIInterface(parent),
-    ui(new Ui::MainWindow) {
+    GUIInterface(parent) {
 
     this->backbone = backbone;
 
+
     initializeUI();
 
     connectBackbone();
@@ -45,8 +45,6 @@ MainWindow::MainWindow(Backbone *backbone, QWidget *parent):
     connectMenu();
     connectBookmarksWidget();
 
-
-
     setExactSearch(false);
 
     setWindowTitle("mDictionary");
@@ -55,33 +53,39 @@ MainWindow::MainWindow(Backbone *backbone, QWidget *parent):
 }
 
 MainWindow::~MainWindow() {
-    delete ui;
+
 }
 
 
 void MainWindow::initializeUI() {
-    ui->setupUi(this);
 
     #ifdef Q_WS_MAEMO_5
         setAttribute(Qt::WA_Maemo5StackedWindow);
     #endif
 
-    searchBarWidget = new SearchBarWidget;
-
-    wordListWidget = new WordListWidget;
-
     //translationWidget is antoher stacked window, so we don't add it to layout
     //only create it with this widget as parent
     translationWidget = new TranslationWidget(this);
 
+
+    mainLayout = new QVBoxLayout;
+    QWidget* w = new QWidget;
+    w->setLayout(mainLayout);
+    setCentralWidget(w);
+    menuBar = new QMenuBar;
+    setMenuBar(menuBar);
+
+    searchBarWidget = new SearchBarWidget;
+
+    wordListWidget = new WordListWidget;
+
     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);
+        mainLayout->addWidget(welcomeScreenWidget);
+        mainLayout->addWidget(searchBarWidget, 0, Qt::AlignBottom);
     #else
         translationWidget->hide();
         //we add to splitter word list and welcome screen
@@ -89,12 +93,11 @@ void MainWindow::initializeUI() {
         splitter->addWidget(wordListWidget);
         splitter->addWidget(welcomeScreenWidget);
         splitter->setStretchFactor(1, 150);
-        ui->centralWidget->layout()->addWidget(splitter);
-        ui->centralWidget->layout()->addWidget(searchBarWidget);
+        mainLayout->addWidget(splitter);
+        mainLayout->addWidget(searchBarWidget);
     #endif
 
 
-
     dictManagerWidget = new DictManagerWidget(this);
     dictManagerWidget->hide();
 
@@ -107,7 +110,6 @@ void MainWindow::initializeUI() {
     aboutWidget = new AboutWidget(this);
     aboutWidget->hide();
 
-
     //creating menus
 
     #ifdef Q_WS_MAEMO_5
@@ -116,17 +118,17 @@ void MainWindow::initializeUI() {
         menuWidget->addSubMenu(tr("Dictionaries"), dictManagerWidget);
         menuWidget->addSubMenu(tr("Bookmarks"), bookmarksWidget);
         menuWidget->addSubMenu(tr("About"), aboutWidget);
-        ui->menuBar->addAction(menuWidget);
+        menuBar->addAction(menuWidget);
     #else
-        dictionariesAction = ui->menuBar->addAction(tr("Dictionaries"));
+        dictionariesAction = menuBar->addAction(tr("Dictionaries"));
         connect(dictionariesAction, SIGNAL(triggered()),
                 dictManagerWidget, SLOT(show()));
 
-        settingsAction = ui->menuBar->addAction(tr("Settings"));
+        settingsAction = menuBar->addAction(tr("Settings"));
         connect(settingsAction, SIGNAL(triggered()),
                 settingsWidget, SLOT(show()));
 
-        QMenu* m = ui->menuBar->addMenu(tr("Bookmarks"));
+        QMenu* m = menuBar->addMenu(tr("Bookmarks"));
         bookmarksShowAllAction = new QAction(tr("Show all"), m);
 
         bookmarksRemoveAllAction = new QAction(tr("Remove all"), m);
@@ -134,11 +136,10 @@ void MainWindow::initializeUI() {
         m->addAction(bookmarksShowAllAction);
         m->addAction(bookmarksRemoveAllAction);
 
-        aboutAction = ui->menuBar->addAction(tr("About"));
+        aboutAction = menuBar->addAction(tr("About"));
         connect(aboutAction, SIGNAL(triggered()),
                 aboutWidget, SLOT(show()));
     #endif
-
 }
 
 void MainWindow::closeEvent(QCloseEvent *event) {
@@ -167,8 +168,8 @@ void MainWindow::wordListReady() {
     #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());
+        int i = mainLayout->indexOf(welcomeScreenWidget);
+        QBoxLayout* l = (QBoxLayout*)(mainLayout);
         l->removeWidget(welcomeScreenWidget);
         welcomeScreenWidget->deleteLater();
         l->insertWidget(0, wordListWidget);
@@ -224,7 +225,7 @@ void MainWindow::translationsReady() {
     #ifndef Q_WS_MAEMO_5
     //switch welcome screen with translation widget
     if(!translationWidget->isVisible()) {
-        QBoxLayout* l = (QBoxLayout*)(ui->centralWidget->layout());
+        QBoxLayout* l = (QBoxLayout*)(mainLayout);
         QSplitter* s = (QSplitter*)((QWidgetItem*)(l->itemAt(0))->widget());
         s->insertWidget(1,translationWidget);
         s->setStretchFactor(1, 150);
@@ -267,7 +268,6 @@ void MainWindow::breakSearching() {
 void MainWindow::addToHistory(QList<Translation *> trans) {
     if(trans.count() > 0) {
         backbone->history()->add(trans[0]->key());
-        translationWidget->setWindowTitle(trans[0]->key());
     }
 }
 
@@ -293,21 +293,21 @@ void MainWindow::historyPrev() {
 
 void MainWindow::disableMenu() {
     #ifdef Q_WS_MAEMO_5
-        if(ui->menuBar->actions().contains(menuWidget)) {
-              ui->menuBar->removeAction(menuWidget);
+        if(menuBar->actions().contains(menuWidget)) {
+              menuBar->removeAction(menuWidget);
         }
     #else
-        ui->menuBar->setEnabled(false);
+        menuBar->setEnabled(false);
     #endif
 }
 
 void MainWindow::enableMenu() {
     #ifdef Q_WS_MAEMO_5
-        if(!ui->menuBar->actions().contains(menuWidget)) {
-            ui->menuBar->addAction(menuWidget);
+        if(!menuBar->actions().contains(menuWidget)) {
+            menuBar->addAction(menuWidget);
         }
     #else
-        ui->menuBar->setEnabled(true);
+        menuBar->setEnabled(true);
     #endif
 }
 
index b950080..6e8e44f 100644 (file)
@@ -40,9 +40,6 @@
 #include "WelcomeScreenWidget.h"
 #include "AboutWidget.h"
 
-namespace Ui {
-    class MainWindow;
-}
 
 //! Implements interface for GUI
 /*!
@@ -204,11 +201,9 @@ protected:
 
 private:
     Backbone* backbone;
-    Ui::MainWindow *ui;
 
     void initializeUI();
 
-
     SearchBarWidget* searchBarWidget;
     QWidget* translationWidget;
     QWidget* wordListWidget;
@@ -218,6 +213,8 @@ private:
     BookmarksWidget* bookmarksWidget;
     QWidget* welcomeScreenWidget;
     AboutWidget* aboutWidget;
+    QVBoxLayout* mainLayout;
+    QMenuBar* menuBar;
 
     #ifndef Q_WS_MAEMO_5
         QSplitter* splitter;
diff --git a/trunk/src/base/gui/MainWindow.ui b/trunk/src/base/gui/MainWindow.ui
deleted file mode 100644 (file)
index 31e98e2..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>400</width>
-    <height>300</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>MainWindow</string>
-  </property>
-  <widget class="QWidget" name="centralWidget">
-   <property name="autoFillBackground">
-    <bool>false</bool>
-   </property>
-   <layout class="QVBoxLayout" name="verticalLayout"/>
-  </widget>
-  <widget class="QMenuBar" name="menuBar">
-   <property name="geometry">
-    <rect>
-     <x>0</x>
-     <y>0</y>
-     <width>400</width>
-     <height>23</height>
-    </rect>
-   </property>
-  </widget>
- </widget>
- <layoutdefault spacing="6" margin="11"/>
- <resources/>
- <connections/>
-</ui>
index 82ccd2e..6534ef3 100644 (file)
@@ -185,7 +185,7 @@ void SearchBarWidget::initializeUI() {
                 clearSearchWordToolButton->sizeHint().height()*2);
     #endif
 
-    fullScreenToolButton = new QToolButton();
+    /*fullScreenToolButton = new QToolButton();
     #ifdef Q_WS_MAEMO_5
         fullScreenToolButton->setIcon(
                 generateIcon(QIcon::fromTheme("general_fullsize")));
@@ -195,7 +195,7 @@ void SearchBarWidget::initializeUI() {
         fullScreenToolButton->setMinimumSize(
                 fullScreenToolButton->sizeHint().height()*2,
                 fullScreenToolButton->sizeHint().height()*2);
-    #endif
+    #endif*/
 
 
     searchingProgressBar = new QProgressBar();
@@ -219,7 +219,7 @@ void SearchBarWidget::initializeUI() {
     horizontalLayout->addWidget(historyPrevToolButton);
     horizontalLayout->addWidget(historyShowToolButton);
     horizontalLayout->addWidget(historyNextToolButton);
-    horizontalLayout->addWidget(fullScreenToolButton);
+   // horizontalLayout->addWidget(fullScreenToolButton);
 
     //adding clear toolButton to textEdit with right alignment
     lineEditLayout->addWidget(clearSearchWordToolButton, 0,
index 937aee1..2d72d99 100644 (file)
@@ -65,6 +65,8 @@ SettingsWidget::SettingsWidget(GUIInterface *parent) :
     verticalLayout->addWidget(searchInBookmarksCheckBox);
 
 
+    settings = 0;
+
     #ifndef Q_WS_MAEMO_5
         setMinimumWidth(250);
         setMaximumWidth(250);
@@ -73,9 +75,9 @@ SettingsWidget::SettingsWidget(GUIInterface *parent) :
 
 void SettingsWidget::showEvent(QShowEvent *e) {
 
-    settings = guiInterface->settings();
+   settings = guiInterface->settings();
 
-    historySizeSpinBox->setValue(
+   historySizeSpinBox->setValue(
             settings->value("history_size").toInt());
 
     searchResultSizeSpinBox->setValue(
@@ -95,30 +97,36 @@ void SettingsWidget::showEvent(QShowEvent *e) {
 }
 
 void SettingsWidget::hideEvent(QHideEvent *e) {
-    Settings* newSettings = new Settings;
-    newSettings->setValue("history_size",
-                          QString::number(historySizeSpinBox->value()));
-    newSettings->setValue("search_limit",
-                          QString::number(searchResultSizeSpinBox->value()));
-
-    if(searchInDictionariesCheckBox->isChecked())
-        newSettings->setValue("search_dictionaries", "true");
-    else
-        newSettings->setValue("search_dictionaries", "false");
+    QDialog::hideEvent(e);
 
-    if(searchInBookmarksCheckBox->isChecked())
-        newSettings->setValue("search_bookmarks", "true");
-    else
-        newSettings->setValue("search_bookmarks", "false");
-
-    //setting new settings only if their are different that old ones
-    QString key;
-    foreach(key, newSettings->keys()) {
-        if(settings->value(key) != newSettings->value(key)) {
-            guiInterface->setSettings(newSettings);
-            break;
+    if(settings) {
+        Settings* newSettings = new Settings;
+        newSettings->setValue("history_size",
+                              QString::number(historySizeSpinBox->value()));
+        newSettings->setValue("search_limit",
+                              QString::number(
+                                      searchResultSizeSpinBox->value()));
+
+        if(searchInDictionariesCheckBox->isChecked())
+            newSettings->setValue("search_dictionaries", "true");
+        else
+            newSettings->setValue("search_dictionaries", "false");
+
+        if(searchInBookmarksCheckBox->isChecked())
+            newSettings->setValue("search_bookmarks", "true");
+        else
+            newSettings->setValue("search_bookmarks", "false");
+
+        //setting new settings only if their are different that old ones
+        QString key;
+        foreach(key, newSettings->keys()) {
+            if(settings->value(key) != newSettings->value(key)) {
+                guiInterface->setSettings(newSettings);
+                break;
+            }
         }
-    }
 
-    QDialog::hideEvent(e);
+        delete settings;
+        settings = 0;
+    }
 }
index 16216c2..2589afc 100644 (file)
 TranslationWidget::TranslationWidget(QWidget *parent):
     QScrollArea(parent) {
 
+    qDebug()<<parent;
     #ifdef Q_WS_MAEMO_5
         setAttribute(Qt::WA_Maemo5StackedWindow);
+        setWindowFlags(windowFlags() | Qt::Window);
     #endif
-    setWindowFlags(windowFlags() | Qt::Window);
+
 
     initializeUI();
-    //Q_INIT_RESOURCE(xslt);
-    setWindowTitle(tr("Translation"));
+
+    setWindowTitle("mDictionary");
 
     connect(textEdit, SIGNAL(search()),
-            this, SLOT(searchSelected()));
+           this, SLOT(searchSelected()));
 
 }
 
@@ -52,6 +54,7 @@ void TranslationWidget::show() {
     QScrollArea::show();
 }
 
+
 void TranslationWidget::show(QStringList translations) {
 
     showMaximized();
@@ -70,7 +73,8 @@ void TranslationWidget::show(QStringList translations) {
     }
 
 
-    trans=tr("<?xml version=\"1.0\" encoding=\"UTF-8\"?>") + tr("\n <ar>") + trans + tr("\n </ar>");
+    trans=QString("<?xml version=\"1.0\" encoding=\"UTF-8\"?>") +
+          QString("\n <ar>") + trans + QString("\n </ar>");
 //    trans.replace("&","&amp;");
     trans=XslConversion(trans);
     qDebug()<<trans;
@@ -205,14 +209,14 @@ void TranslationWidget::initializeUI() {
     verticalLayout = new QVBoxLayout(w);
     verticalLayout->addWidget(textEdit);
 
-    textEdit->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-    textEdit->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-
+    #ifndef Q_WS_MAEMO_5
+        textEdit->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+        textEdit->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+    #endif
 
     this->setWidget(w);
     this->setWidgetResizable(true);
 
-
     #ifdef Q_WS_MAEMO_5
         zoomInButton = new QToolButton(this);
         zoomInButton->setIcon(QIcon::fromTheme("pdf_zoomin"));
@@ -223,7 +227,7 @@ void TranslationWidget::initializeUI() {
         zoomOutButton->setMinimumSize(zoomOutButton->sizeHint());
 
         selectAllButton = new QToolButton(this);
-        selectAllButton->setIcon(QIcon::fromTheme("pdf_zoomout"));
+        selectAllButton->setIcon(QIcon(":/icons/48x48/edit-select-all.png"));
         selectAllButton->setMinimumSize(selectAllButton->sizeHint());
 
         copyButton = new QToolButton(this);
@@ -237,7 +241,7 @@ void TranslationWidget::initializeUI() {
         searchButton->setEnabled(false);
 
         showButtonsButton = new QToolButton(this);
-        showButtonsButton->setArrowType(Qt::UpArrow);
+        showButtonsButton->setIcon(QIcon::fromTheme("general_sent"));
         showButtonsButton->setMinimumSize(searchButton->sizeHint());
 
         connect(zoomInButton, SIGNAL(clicked()),
@@ -284,13 +288,13 @@ void TranslationWidget::showButtons() {
         buttonsAnimation->start();
         buttonsVisible = true;
 
-        showButtonsButton->setArrowType(Qt::DownArrow);
+        showButtonsButton->setIcon(QIcon::fromTheme("general_received"));
     }
     else if(buttonsVisible) {
         buttonsAnimation->setDirection(QAbstractAnimation::Backward);
         buttonsAnimation->start();
         buttonsVisible = false;
-        showButtonsButton->setArrowType(Qt::UpArrow);
+        showButtonsButton->setIcon(QIcon::fromTheme("general_sent"));
     }
 }
 
@@ -316,6 +320,13 @@ void TranslationWidget::grabZoomKeys(bool grab) {
          1);
 }
 
+void TranslationWidget::hideEvent(QHideEvent* e) {
+    if(buttonsVisible)
+        showButtons();
+
+    QScrollArea::hideEvent(e);
+}
+
 void TranslationWidget::keyPressEvent(QKeyEvent* event) {
     switch (event->key()) {
         case Qt::Key_F7:
index c9134d3..46ac8c1 100644 (file)
@@ -59,6 +59,7 @@ public Q_SLOTS:
 protected:
     #ifdef Q_WS_MAEMO_5
         void keyPressEvent(QKeyEvent *);
+        void hideEvent(QHideEvent *);
     #endif
 
 private Q_SLOTS:
index e72c88c..953b590 100644 (file)
@@ -41,7 +41,7 @@ WelcomeScreenWidget::WelcomeScreenWidget(QWidget *parent) :
     mainLayout->addWidget(mainLabel, 0, Qt::AlignCenter);
     mainLayout->addStretch(0);
 
-    QImage img(":/icons/mdictionary.png");
+    QImage img(":/icons/logo/mdictionary.png");
     imageLabel->setPixmap(QPixmap::fromImage(img));
     imageLabel->resize(imageLabel->pixmap()->size());
 
index 571ba9b..0d60b72 100644 (file)
@@ -28,8 +28,8 @@ WordListProxyStyle::WordListProxyStyle() :
     QProxyStyle()
 {
     //load pixmap from resources
-    starPixmapOn = QPixmap(":/icons/staron.png");
-    starPixmapOff = QPixmap(":/icons/staroff.png");
+    starPixmapOn = QPixmap(":/icons/96x96/staron.png");
+    starPixmapOff = QPixmap(":/icons/96x96/staroff.png");
 }
 
 
index dcca883..bde5e7b 100644 (file)
@@ -91,16 +91,17 @@ void WordListWidget::addWord(QString word, int row) {
 void WordListWidget::showSearchResults(
         QHash<QString, QList<Translation *> > result) {
 
-    model->clear();
-    searchResult.clear();
+    clear();
+    qDebug()<<searchResult.count();
+    searchResult = result;
+
 
     model->setColumnCount(2);
     model->setRowCount(result.count());
 
-    searchResult = result;
     int row=0;
     QHash<QString, QList<Translation*> >::iterator i;
-    for(i = result.begin(); i != result.end(); i++) {
+    for(i = searchResult.begin(); i != searchResult.end(); i++) {
            addWord(i.key(), row++);
     }
 
@@ -110,6 +111,7 @@ void WordListWidget::showSearchResults(
 
 void WordListWidget::wordClicked(QModelIndex index) {
     //we're getting translation based on data in index
+    qDebug()<<searchResult[index.data().toString()].at(0)->dictionaryInfo();
     emit showTranslation(
             searchResult[index.data().toString()]);
 }
@@ -173,7 +175,7 @@ void WordListWidget::resizeEvent(QResizeEvent *event) {
 }
 
 void WordListWidget::resizeColumns() {
-    setColumnWidth(0, viewport()->width() -checkBoxWidth - 20);
+    setColumnWidth(0, viewport()->width() -checkBoxWidth);
     setColumnWidth(1, checkBoxWidth);
 }
 
@@ -184,3 +186,17 @@ void WordListWidget::lockList() {
 void WordListWidget::unlockList() {
     setEnabled(true);
 }
+
+void WordListWidget::clear() {
+    model->clear();
+    qDebug()<<"asdasdas";
+
+   /* QHash<QString, QList<Translation*> >::iterator i;
+    for(i = searchResult.begin(); i != searchResult.end(); i++) {
+           Translation*t;
+           foreach(t, i.value()) {
+               delete t;
+           }
+    }*/
+    searchResult.clear();
+}
index 9dc011f..1ff0c12 100644 (file)
@@ -89,6 +89,8 @@ private Q_SLOTS:
     //! Signal is emitted only when star was clicked.
     void wordChecked(QModelIndex index);
 
+    void clear();
+
 private:
     //! Adds word to model. Row is row in the model
     void addWord(QString word, int row);
diff --git a/trunk/src/base/gui/gui.qrc b/trunk/src/base/gui/gui.qrc
deleted file mode 100644 (file)
index dc740a5..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<RCC>
-    <qresource prefix="/icons">
-        <file>staroff.png</file>
-        <file>staron.png</file>
-        <file>mdictionary.png</file>
-    </qresource>
-</RCC>
index fe6a9c3..c5879c5 100644 (file)
@@ -60,13 +60,13 @@ int main(int argc, char *argv[]) {
 
     qRegisterMetaType<Translation*>("Translation*");
     qRegisterMetaType<QList<Translation*> >("QList<Translation*>");
-    Backbone* backbone = new Backbone;
-    MainWindow* w = new MainWindow(backbone);
-    w->show();
+    Backbone backbone;
+    MainWindow w(&backbone);
+    w.show();
 
     if(search.count() > 0) {
-        w->setExactSearch(true);
-        w->searchExact(search[0]);
+        w.setExactSearch(true);
+        w.searchExact(search[0]);
     }
 
     return a.exec();
diff --git a/trunk/src/base/gui/mdictionary.png b/trunk/src/base/gui/mdictionary.png
deleted file mode 100755 (executable)
index 3768425..0000000
Binary files a/trunk/src/base/gui/mdictionary.png and /dev/null differ
diff --git a/trunk/src/base/gui/staroff.png b/trunk/src/base/gui/staroff.png
deleted file mode 100644 (file)
index 7b0c1bc..0000000
Binary files a/trunk/src/base/gui/staroff.png and /dev/null differ
diff --git a/trunk/src/base/gui/staron.png b/trunk/src/base/gui/staron.png
deleted file mode 100644 (file)
index 2291707..0000000
Binary files a/trunk/src/base/gui/staron.png and /dev/null differ