Partialy refactorized, fixed some bugs
authorMateusz Półrola <mateusz.polrola@comarch.pl>
Thu, 2 Sep 2010 07:05:15 +0000 (09:05 +0200)
committerMateusz Półrola <mateusz.polrola@comarch.pl>
Thu, 2 Sep 2010 07:05:15 +0000 (09:05 +0200)
35 files changed:
trunk/src/base/gui/AboutWidget.cpp
trunk/src/base/gui/AboutWidget.h
trunk/src/base/gui/BookmarksWidget.cpp
trunk/src/base/gui/BookmarksWidget.h
trunk/src/base/gui/DBusAdapter.cpp
trunk/src/base/gui/DBusAdapter.h
trunk/src/base/gui/DictManagerWidget.cpp
trunk/src/base/gui/DictManagerWidget.h
trunk/src/base/gui/DictTypeSelectDialog.cpp
trunk/src/base/gui/DictTypeSelectDialog.h
trunk/src/base/gui/HistoryListDialog.cpp
trunk/src/base/gui/HistoryListDialog.h
trunk/src/base/gui/MainWindow.cpp
trunk/src/base/gui/MainWindow.h
trunk/src/base/gui/MenuTabWidget.cpp
trunk/src/base/gui/MenuTabWidget.h
trunk/src/base/gui/MenuWidget.cpp
trunk/src/base/gui/MenuWidget.h
trunk/src/base/gui/NotifyManager.cpp
trunk/src/base/gui/NotifyManager.h
trunk/src/base/gui/SearchBarWidget.cpp
trunk/src/base/gui/SearchBarWidget.h
trunk/src/base/gui/SettingsWidget.cpp
trunk/src/base/gui/SettingsWidget.h
trunk/src/base/gui/TranslationTextEdit.cpp
trunk/src/base/gui/TranslationTextEdit.h
trunk/src/base/gui/TranslationWidget.cpp
trunk/src/base/gui/TranslationWidget.h
trunk/src/base/gui/WelcomeScreenWidget.cpp
trunk/src/base/gui/WelcomeScreenWidget.h
trunk/src/base/gui/WordListProxyStyle.cpp
trunk/src/base/gui/WordListProxyStyle.h
trunk/src/base/gui/WordListWidget.cpp
trunk/src/base/gui/WordListWidget.h
trunk/src/base/gui/main.cpp

index 7eea400..03bbf6c 100644 (file)
     Copyright 2010 Comarch S.A.
 
 *******************************************************************************/
-/*! \file AboutWidget.cpp
-\brief Simple "about" widget - product, company, license info
-
-
-\author Bartosz Szatkowski <bulislaw@linux.com>
-*/
+//! \file AboutWidget.cpp
+//! \brief Simple "about" widget - product, company, license info
+//! \author Bartosz Szatkowski <bulislaw@linux.com>
 
 #include "AboutWidget.h"
 
index a1cdda2..ea860ae 100644 (file)
     Copyright 2010 Comarch S.A.
 
 *******************************************************************************/
-/*! \file AboutWidget.h
-\brief Simple "about" widget - product, company, license info
 
+//! \file AboutWidget.h
+//! \brief Simple "about" widget - product, company, license info
+//! \author Bartosz Szatkowski <bulislaw@linux.com>
 
-\author Bartosz Szatkowski <bulislaw@linux.com>
-*/
 
 #ifndef ABOUTWIDGET_H
 #define ABOUTWIDGET_H
index 1536265..24ad0f0 100644 (file)
@@ -19,7 +19,6 @@
 
 *******************************************************************************/
 //! \file BookmarksWidget.cpp
-//! \brief Bookmarks management widget
 //! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #include "BookmarksWidget.h"
index 288b7e2..623e89f 100644 (file)
@@ -20,7 +20,6 @@
 *******************************************************************************/
 
 //! \file BookmarksWidget.h
-//! \brief Bookmarks management widget
 //! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #ifndef BOOKMARKSWIDGET_H
index a86624d..cf4dd44 100644 (file)
@@ -19,7 +19,8 @@
 
 *******************************************************************************/
 
-//Created by Mateusz Półrola
+//! \file DBusAdapter.cpp
+//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #include "DBusAdapter.h"
 #include <QDebug>
index 1c3f8c8..0680c8c 100644 (file)
@@ -19,7 +19,8 @@
 
 *******************************************************************************/
 
-//Created by Mateusz Półrola
+//! \file DBusAdapter.h
+//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #ifndef DBUSADAPTER_H
 #define DBUSADAPTER_H
index aee710e..4157889 100644 (file)
@@ -20,7 +20,6 @@
 *******************************************************************************/
 
 //! \file DictManagerWidget.cpp
-//! \brief Dicrionaries management widget
 //! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #include "DictManagerWidget.h"
@@ -193,13 +192,14 @@ void DictManagerWidget::itemSelected(QListWidgetItem *) {
 }
 
 void DictManagerWidget::removeButtonClicked() {
+    qDebug()<<dictsHash.count();
     if(QMessageBox::question(this, tr("Remove dictionary"),
             tr("Do you want to remove selected dictionary?"),
-            QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok) {
+            QMessageBox::Yes, QMessageBox::Cancel) == QMessageBox::Yes) {
         QList<QListWidgetItem*> selected = dictListWidget->selectedItems();
         if(selected.count() > 0) {
-            refreshDictsList();
             emit removeDictionary(dictsHash[selected[0]]);
+            refreshDictsList();
         }
    }
 }
index 56abbd5..fc7daf4 100644 (file)
@@ -20,7 +20,6 @@
 *******************************************************************************/
 
 //! \file DictManagerWidget.h
-//! \brief Dictionary management widget
 //! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #ifndef DICTMANAGERWIDGET_H
index 4d0e317..886a377 100644 (file)
@@ -19,7 +19,8 @@
 
 *******************************************************************************/
 
-//Created by Mateusz Półrola
+//! \file DictTypeSelectDialog.cpp
+//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #include "DictTypeSelectDialog.h"
 
index 622ca60..d953aff 100644 (file)
@@ -19,7 +19,6 @@
 
 *******************************************************************************/
 //! \file DictTypeSelectDialog.h
-//! \brief Implements plugin selection dialog
 //! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #ifndef DICTTYPESELECTDIALOG_H
index ad2ffd9..a9d4765 100644 (file)
@@ -19,7 +19,8 @@
 
 *******************************************************************************/
 
-//Created by Mateusz Półrola
+//! \file HistoryListDialog.cpp
+//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #include "HistoryListDialog.h"
 
index b9aea76..7a19236 100644 (file)
@@ -19,7 +19,6 @@
 
 *******************************************************************************/
 //! \file HistoryListDialog.h
-//! \brief Implements history list dialog
 //! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #ifndef HISTORYLISTDIALOG_H
@@ -34,7 +33,8 @@
 //! Implements history list dialog
 /*!
   Shows history list and allows user to select one word of it.
-  */
+  On desktop it is shown as popup.
+*/
 class HistoryListDialog : public QDialog
 {
     Q_OBJECT
@@ -43,7 +43,7 @@ public:
     /*!
       \param words list of history words
       \param parent widget
-      */
+    */
     explicit HistoryListDialog(QStringList words, QWidget* parent = 0);
 
     //! Returns word selected by user
index b706572..6a592f5 100644 (file)
@@ -189,7 +189,7 @@ void MainWindow::wordListReady() {
 
     //if nothing was found
     if(backboneResult.count() == 0) {
-        showNotify(Notify::Info, tr("Can't find any matching words"));
+        showNotification(Notify::Info, tr("Can't find any matching words"));
 
         //show empty list to remove results of old search
         Q_EMIT showWordList(searchResult);
@@ -212,7 +212,7 @@ void MainWindow::wordListReady() {
                 Q_EMIT searchTranslations(exactTranslation);
             }
             else {
-                showNotify(Notify::Info,
+                showNotification(Notify::Info,
                            tr("Can't find exactly matching word"));
             }
 
@@ -372,8 +372,8 @@ Settings* MainWindow::settings() {
 }
 
 
-void MainWindow::showNotify(Notify::NotifyType type, QString text) {
-    notifyManager->showNotify(type, text);
+void MainWindow::showNotification(Notify::NotifyType type, QString text) {
+    notifyManager->showNotification(type, text);
 }
 
 void MainWindow::connectBackbone() {
@@ -437,7 +437,7 @@ void MainWindow::connectBackbone() {
             this, SIGNAL(setIdle()));
 
     connect(backbone, SIGNAL(notify(Notify::NotifyType,QString)),
-            this, SLOT(showNotify(Notify::NotifyType,QString)));
+            this, SLOT(showNotification(Notify::NotifyType,QString)));
 }
 
 void MainWindow::connectSearchBar() {
index 4ed7c8d..db76e51 100644 (file)
@@ -220,7 +220,7 @@ public:
       \param type type of notify
       \param message notify message
     */
-    void showNotify(Notify::NotifyType type, QString message);
+    void showNotification(Notify::NotifyType type, QString message);
 
 private Q_SLOTS:
     //! Disables menu
index f2585bb..e4320eb 100644 (file)
@@ -19,7 +19,8 @@
 
 *******************************************************************************/
 
-//Created by Mateusz Półrola
+//! \file MenuTabWidget.cpp
+//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #include "MenuTabWidget.h"
 #include <QDebug>
index cb7c915..3f625d4 100644 (file)
@@ -19,7 +19,6 @@
 
 *******************************************************************************/
 //! \file MenuTabWidget.h
-//! \brief Implements menu tab widget
 //! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #ifndef MENUTABWIDGET_H
index 0df9e24..e5c2fd1 100644 (file)
@@ -19,7 +19,8 @@
 
 *******************************************************************************/
 
-//Created by Mateusz Półrola
+//! \file MenuWidget.cpp
+//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #include "MenuWidget.h"
 #include <QDebug>
index 1b23106..4fe7278 100644 (file)
@@ -19,7 +19,6 @@
 
 *******************************************************************************/
 //! \file MenuWidget.h
-//! \brief Implements custom menu
 //! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #ifndef MENUWIDGET_H
index 257f611..6b9c022 100644 (file)
@@ -19,7 +19,8 @@
 
 *******************************************************************************/
 
-//Created by Mateusz Półrola
+//! \file NotifyManager.cpp
+//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #include "NotifyManager.h"
 #include <QMessageBox>
@@ -34,7 +35,8 @@ NotifyManager::NotifyManager(QObject *parent) :
 {
 }
 
-void NotifyManager::notifyClosed() {
+
+void NotifyManager::notificationClosed() {
     QObject* dialog = QObject::sender();
 
     QHash<QString, QDialog*>::Iterator it;
@@ -56,7 +58,7 @@ void NotifyManager::screenChanged() {
     }
 }
 
-void NotifyManager::showNotify(Notify::NotifyType type, QString text) {
+void NotifyManager::showNotification(Notify::NotifyType type, QString text) {
 
     if(activeNotifies.contains(text)) {
         return;
@@ -111,6 +113,6 @@ void NotifyManager::showNotify(Notify::NotifyType type, QString text) {
     }
 
     activeNotifies.insert(text, mbox);
-    connect(mbox, SIGNAL(finished(int)), this, SLOT(notifyClosed()));
+    connect(mbox, SIGNAL(finished(int)), this, SLOT(notificationClosed()));
     mbox->exec();
 }
index be5507f..f554b7e 100644 (file)
@@ -19,7 +19,8 @@
 
 *******************************************************************************/
 
-//Created by Mateusz Półrola
+//! \file NotifyManager.h
+//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #ifndef NOTIFYMANAGER_H
 #define NOTIFYMANAGER_H
 #include <QDialog>
 #include "../../includes/Notify.h"
 
+//! Manages notifications in applications
+/*!
+    Shows notifications to user, assures that couple of the same notification
+    will not be displayed at the same time. It automatically delete
+    notifications after user accept or reject it.
+*/
+
 class NotifyManager : public QObject
 {
     Q_OBJECT
@@ -37,11 +45,21 @@ public:
     NotifyManager(QObject *parent = 0);
 
 public slots:
-    void showNotify(Notify::NotifyType type, QString text);
+    //! Shows notification
+    /*!
+        Displays new notification of passed type containing passed text
+        \param type type of notification
+        \param text text of notification
+        \sa Notify::NotifyType
+    */
+    void showNotification(Notify::NotifyType type, QString text);
+
+    //! Refresh all notifications when stacked widgets changes
     void screenChanged();
 
 private slots:
-    void notifyClosed();
+    //! Informs that notification was closed and can be deleted
+    void notificationClosed();
 
 private:
     QHash<QString, QDialog*> activeNotifies;
index 4f4f84a..6c62be5 100644 (file)
@@ -19,7 +19,8 @@
 
 *******************************************************************************/
 
-//Created by Mateusz Półrola
+//! \file SearchBarWidget.cpp
+//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 
 #include "SearchBarWidget.h"
@@ -34,7 +35,7 @@ SearchBarWidget::SearchBarWidget(QWidget *parent) :
     initializeUI();
 
 
-    _isSearching = false;
+    busy = false;
 
     connect(searchPushButton, SIGNAL(clicked()),
             this, SLOT(searchPushButtonClicked()));
@@ -64,6 +65,7 @@ SearchBarWidget::SearchBarWidget(QWidget *parent) :
     historyPrevToolButton->setEnabled(false);
     historyNextToolButton->setEnabled(false);
     historyShowToolButton->setEnabled(false);
+
     setEnabled(true);
 }
 
@@ -142,7 +144,6 @@ void SearchBarWidget::initializeUI() {
     clearSearchWordToolButton = new QToolButton;
     #ifdef Q_WS_MAEMO_5
         clearSearchWordToolButton->setIcon(QIcon::fromTheme("general_stop"));
-        //tool buttons will have size 2 times smaller
         clearSearchWordToolButton->setMaximumSize(
                 clearSearchWordToolButton->sizeHint().height()/2,
                 clearSearchWordToolButton->sizeHint().height()/2);
@@ -218,7 +219,7 @@ void SearchBarWidget::initializeUI() {
 
 
 void SearchBarWidget::searchPushButtonClicked() {
-    if(_isSearching) {
+    if(busy) {
         Q_EMIT stopSearching();
     }
     else {
@@ -228,7 +229,7 @@ void SearchBarWidget::searchPushButtonClicked() {
 
 
 void SearchBarWidget::search(QString word) {
-    if(!_isSearching && !word.isEmpty()) {
+    if(!busy && !word.isEmpty()) {
         completerModel->insertRow(completerModel->rowCount());
         QModelIndex index =
                 completerModel->index(completerModel->rowCount() -1);
@@ -242,7 +243,7 @@ void SearchBarWidget::search(QString word) {
 }
 
 void SearchBarWidget::searchDelay(QString word) {
-    if(!_isSearching && !word.isEmpty()) {
+    if(!busy && !word.isEmpty()) {
         searchWordLineEdit->setText(word);
 
 
@@ -257,7 +258,7 @@ void SearchBarWidget::searchDelay(QString word) {
 
 void SearchBarWidget::delaySearchTimeout() {
     delayTimer.stop();
-    if(!_isSearching) {
+    if(!busy) {
         Q_EMIT searchForTranslations(delayString);
     }
 }
@@ -273,19 +274,19 @@ void SearchBarWidget::setEnabled(bool enabled) {
 }
 
 void SearchBarWidget::setBusy() {
-    if(_isSearching) return;
+    if(busy) return;
     searchingProgressBar->show();
     searchPushButton->setText(tr("Stop"));
     setEnabled(false);
-    _isSearching = true;
+    busy = true;
 }
 
 void SearchBarWidget::setIdle() {
-    if(!_isSearching) return;
+    if(!busy) return;
     searchingProgressBar->hide();
     searchPushButton->setText(tr("Search"));
     setEnabled(true);
-    _isSearching = false;
+    busy = false;
     Q_EMIT refreshHistoryButtons();
 }
 
@@ -297,7 +298,7 @@ void SearchBarWidget::clearSearchWordToolButtonClicked() {
 
 
 void SearchBarWidget::updateHistoryButtons(bool prev, bool next, bool list) {
-    if(!_isSearching) {
+    if(!busy) {
         historyPrevToolButton->setEnabled(prev);
         historyNextToolButton->setEnabled(next);
         historyShowToolButton->setEnabled(list);
@@ -305,11 +306,11 @@ void SearchBarWidget::updateHistoryButtons(bool prev, bool next, bool list) {
 }
 
 void SearchBarWidget::showHistoryButtonClicked() {
-    #ifndef Q_WS_MAEMO_5
+    #ifdef Q_WS_MAEMO_5
+        emit historyShow();
+    #else
         QPoint p = historyShowToolButton->pos();
         p.setY(p.y());
         emit historyShow(mapToGlobal(p));
-    #else
-        emit historyShow();
     #endif
 }
index 1972053..c6d2c99 100644 (file)
@@ -19,7 +19,6 @@
 
 *******************************************************************************/
 //! \file SearchBarWidget.h
-//! \brief Implements search bar
 //! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 
@@ -141,12 +140,17 @@ private:
     QProgressBar* searchingProgressBar;
 
 
-    //! generates icon for maemo
+    //! generates icon for maemo (some of icons we use don't have inactive
+    //! pixmaps, so we generate them
+    /*!
+      \param oryginal oryginal icon
+      \param rotation rotation of resulting icon
+    */
     QIcon generateIcon(QIcon oryginal, qreal rotation=0);
 
     QVBoxLayout* verticalLayout;
 
-    bool _isSearching;
+    bool busy;
 
     QTimer delayTimer;
     QString delayString;
index ce21f4f..25ccc90 100644 (file)
@@ -19,7 +19,8 @@
 
 *******************************************************************************/
 
-//Created by Mateusz Półrola
+//! \file SettingsWidget.cpp
+//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #include "SettingsWidget.h"
 #include <QDebug>
@@ -31,26 +32,34 @@ SettingsWidget::SettingsWidget(GUIInterface *parent) :
 
     setWindowTitle(tr("Settings"));
 
+    initalizeUI();
+}
+
+void SettingsWidget::initalizeUI() {
     verticalLayout = new QVBoxLayout;
     setLayout(verticalLayout);
 
     historySizeSpinBox = new QSpinBox;
     searchResultSizeSpinBox = new QSpinBox;
+
     limitTip = "Limit maximal number of finded words, affect only when "
-                "searching in file.";
+                "searching in file";
     searchResultSizeSpinBox->setToolTip(limitTip);
 
-    spinBoxesFormLayout = new QFormLayout;
 
+    spinBoxesFormLayout = new QFormLayout;
     spinBoxesFormLayout->addRow(tr("Search result size"),
                                 searchResultSizeSpinBox);
-
     spinBoxesFormLayout->addRow(tr("History size"),
                                 historySizeSpinBox);
 
     searchResultSizeSpinBox->setMinimum(0);
+    searchResultSizeSpinBox->setSpecialValueText(tr("Unlimited"));
     historySizeSpinBox->setMinimum(1);
 
+    searchResultSizeSpinBox->setMaximum(500);
+    historySizeSpinBox->setMaximum(50);
+
     #ifdef Q_WS_MAEMO_5
         verticalLayout->addSpacing(20);
     #endif
@@ -97,6 +106,7 @@ void SettingsWidget::showEvent(QShowEvent *e) {
    #ifndef Q_WS_MAEMO_5
        _save = false;
    #endif
+
    settings = guiInterface->settings();
 
    historySizeSpinBox->setValue(
@@ -123,10 +133,12 @@ void SettingsWidget::hideEvent(QHideEvent *e) {
     QDialog::hideEvent(e);
 
     #ifndef Q_WS_MAEMO_5
-    if(settings && _save) {
+        if(settings && _save) {
     #else
-    if(settings && _changed &&
-            QMessageBox::question(this, tr("Save"), tr("Do you want to save changes?"),
+        if(settings && _changed &&
+           QMessageBox::question(this,
+                                 tr("Save"),
+                                 tr("Do you want to save changes?"),
              QMessageBox::Save, QMessageBox::Cancel) == QMessageBox::Save) {
 
     #endif
index a19b864..6af03bc 100644 (file)
@@ -20,7 +20,6 @@
 *******************************************************************************/
 
 //! \file DictManagerWidget.h
-//! \brief Settings widget
 //! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #ifndef SETTINGSWIDGET_H
@@ -57,7 +56,14 @@ protected:
     void showEvent(QShowEvent *);
     void hideEvent(QHideEvent *);
 
+private Q_SLOTS:
+    void changed();
+    #ifndef Q_WS_MAEMO_5
+        void save();
+    #endif
+
 private:
+    void initalizeUI();
     QSpinBox* historySizeSpinBox;
     QSpinBox* searchResultSizeSpinBox;
     QVBoxLayout* verticalLayout;
@@ -75,13 +81,9 @@ private:
         QPushButton* closeButton;
         QHBoxLayout* footerLayout;
         bool _save;
-
-        private Q_SLOTS:
-            void save();
     #endif
 
-private Q_SLOTS:
-    void changed();
+
 
 };
 
index 4bf961c..2f8fbc1 100644 (file)
@@ -19,7 +19,8 @@
 
 *******************************************************************************/
 
-//Created by Mateusz Półrola
+//! \file TranslationTextEdit.cpp
+//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #include <QtGui>
 #include "TranslationTextEdit.h"
index 7fdd2dc..0150a81 100644 (file)
@@ -19,7 +19,8 @@
 
 *******************************************************************************/
 
-//Created by Mateusz Półrola
+//! \file TranslationTextEdit.h
+//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #ifndef TRANSLATIONTEXTEDIT_H
 #define TRANSLATIONTEXTEDIT_H
index 689bef0..064789d 100644 (file)
@@ -19,7 +19,8 @@
 
 *******************************************************************************/
 
-//Created by Mateusz Półrola
+//! \file TranslationWidget.cpp
+//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #include "TranslationWidget.h"
 #include <QDebug>
index 055aaad..12d4089 100644 (file)
@@ -19,7 +19,6 @@
 
 *******************************************************************************/
 //! \file TranslationWidget.h
-//! \brief Implements translation widget
 //! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #ifndef TRANSLATIONWIDGET_H
index df39c37..ee4d286 100644 (file)
@@ -19,7 +19,8 @@
 
 *******************************************************************************/
 
-//Created by Mateusz Półrola
+//! \file WelcomeScreenWidget.cpp
+//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #include "WelcomeScreenWidget.h"
 
index aedc0e3..cbfec7e 100644 (file)
@@ -19,7 +19,6 @@
 
 *******************************************************************************/
 //! \file WelcomeScreenWidget.h
-//! \brief Implements widget that display welcome screen to user
 //! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #ifndef WELCOMESCREENWIDGET_H
index 350e741..af9d65a 100644 (file)
@@ -19,7 +19,8 @@
 
 *******************************************************************************/
 
-//Created by Mateusz Półrola
+//! \file WordListProxyStyle.cpp
+//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #include "WordListProxyStyle.h"
 
index 6843298..7965a96 100644 (file)
@@ -20,7 +20,6 @@
 
 *******************************************************************************/
 //! \file WordListProxyStyle.h
-//! \brief Implements custom style which draws checkboxes as stars
 //! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #ifndef WORDLISTPROXYSTYLE_H
index 7b4550a..1624c5e 100644 (file)
 
 *******************************************************************************/
 
-//Created by Mateusz Półrola
+//! \file WordListWidget.cpp
+//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #include "WordListWidget.h"
-#include <QDebug>
-#include "../../includes/translation.h"
-#include <QMultiHash>
 #include "WordListProxyStyle.h"
+#include "../../includes/translation.h"
 
 
-#ifdef Q_WS_MAEMO_5
-    #include <QMaemo5InformationBox>
-#endif
-
 WordListWidget::WordListWidget(QWidget *parent):
     QTreeView(parent) {
 
@@ -94,7 +89,6 @@ void WordListWidget::showSearchResults(
     clear();
     searchResult = result;
 
-
     model->setColumnCount(2);
     model->setRowCount(result.count());
 
@@ -104,8 +98,8 @@ void WordListWidget::showSearchResults(
            addWord(i.key(), row++);
     }
 
-    resizeColumns();
     model->sort(0);
+    resizeColumns();    
 }
 
 void WordListWidget::wordClicked(QModelIndex index) {
@@ -121,7 +115,6 @@ void WordListWidget::wordChecked(QModelIndex index) {
             Qt::CheckState(index.data(Qt::CheckStateRole).toInt());
 
 
-
     //getting index of item which contains word which should be added/removed
     //from bookmarks
     QModelIndex item = selectedIndexes().at(0);
index 877be76..cc6d72e 100644 (file)
 
 *******************************************************************************/
 //! \file WordListwidget.h
-//! \brief Implements word list widget
 //! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #ifndef WORDLISTWIDGET_H
 #define WORDLISTWIDGET_H
 
-#include <QWidget>
 #include <QtGui>
 #include <QStringListModel>
 #include "../backbone/backbone.h"
-#include "SearchBarWidget.h"
 
 //! Displays list of words found in dictionaries
 /*!
@@ -89,6 +86,7 @@ private Q_SLOTS:
     //! Signal is emitted only when star was clicked.
     void wordChecked(QModelIndex index);
 
+    //! clears list
     void clear();
 
 private:
@@ -96,6 +94,7 @@ private:
     void addWord(QString word, int row);
 
     QStandardItemModel* model;
+
     //! Describes width of star checkbox in pixels
     int checkBoxWidth;
 
index 71cd63a..531258c 100644 (file)
@@ -19,7 +19,8 @@
 
 *******************************************************************************/
 
-//Created by Mateusz Półrola
+//! \file main.cpp
+//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
 
 #include <QtGui/QApplication>
 #include "MainWindow.h"
@@ -71,6 +72,8 @@ int main(int argc, char *argv[]) {
     QTranslator qtTranslator;
     qtTranslator.load("qt_" + QLocale::system().name(),
     QLibraryInfo::location(QLibraryInfo::TranslationsPath));
+
+    qDebug()<<QLibraryInfo::location(QLibraryInfo::TranslationsPath);
     a.installTranslator(&qtTranslator);
 
     QTranslator myTranslator;