+++ /dev/null
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Type=Application
-Categories=Office
-Name=mDictionary
-Icon = mdictonary
-Exec=/usr/bin/mdictionary
-X-Maemo-Category = Main
-
+++ /dev/null
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Type=Application
-Categories=Office
-Name=mDictionary
-Icon = mdictonary
-Exec=/usr/bin/mdictionary
-X-Maemo-Category = Main
-
+++ /dev/null
-Package: mdictionary
-Version: 1.0.0-2
-Architecture: i386
-Maintainer: Mateusz Polrola <mateusz.polrola@comarch.pl>
-Installed-Size: 128
-Depends: libc6 (>= 2.5.0-1), libgcc1 (>= 1:4.2.1), libqt4-core (>= 4.6.2~git20100401), libqt4-gui (>= 4.6.2~git20100401), libstdc++6 (>= 4.2.1)
-Section: user/multimedia
-Priority: optional
-Description: Multilanguage dictionary
- Long desc
+++ /dev/null
-d45ee4b6faabfa5b22950fc2ac5390a2 usr/share/doc/mdictionary/README.Debian
-149c5fa98facd4cc7d708c96c11fe028 usr/share/doc/mdictionary/copyright
-d985aecef87f4ab660ca2d5396aac6ff usr/share/doc/mdictionary/changelog.Debian.gz
-35612a2bf496e172d7abcf76c0d8b47b usr/share/applications/hildon/mdictionary.desktop
-30a33a60d95c3518fce3cf69a7bfc288 usr/share/icons/hicolor/64x64/apps/mdictionary.png
-c125649ba95d59ea878802095c178213 usr/bin/mdictionary
+++ /dev/null
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Type=Application
-Categories=Office
-Name=mDictionary
-Icon=mdictonary
-Exec=/usr/bin/mdictionary
-X-Maemo-Category=Main
-
+++ /dev/null
-mdictionary for Debian
-----------------------
-
-<possible notes regarding this package - if none, delete this file>
-
- -- Mateusz Polrola <mateusz.polrola@comarch.pl>, Tue, 3 Aug 2010 13:44:27 +0200
+++ /dev/null
-This package was debianized by Mateusz Polrola <mateusz.polrola@comarch.pl> on
-Tue, 3 Aug 2010 13:44:27 +0200.
-
-It was downloaded from <fill in ftp site>
-
-Copyright:
-
-Upstream Author(s): <put author(s) name and email here>
-
-License:
-
- This package is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 dated June, 1991.
-
- This package is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this package; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA.
-
-On Debian systems, the complete text of the GNU General
-Public License can be found in `/usr/share/common-licenses/GPL'.
-
gui/SearchBarWidget.cpp \
gui/WordListWidget.cpp \
gui/TranslationWidget.cpp \
- backbone/backbone.cpp
+ backbone/backbone.cpp \
+ gui/MenuWidget.cpp \
+ gui/MenuTabWidget.cpp
HEADERS += gui/MainWindow.h \
gui/SearchBarWidget.h \
backbone/backbone.h \
../includes/translation.h \
../includes/settings.h \
- ../includes/CommonDictInterface.h
+ ../includes/CommonDictInterface.h \
+ gui/MenuWidget.h \
+ gui/MenuTabWidget.h
FORMS += gui/MainWindow.ui
+/*******************************************************************************
+
+ This file is part of mDictionary.
+
+ mDictionary is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ mDictionary is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with mDictionary. If not, see <http://www.gnu.org/licenses/>.
+
+ Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+
+//Created by Mateusz Półrola
+
#include "MainWindow.h"
#include "ui_MainWindow.h"
searchBarWidget = new SearchBarWidget(backbone);
wordListWidget = new WordListWidget(backbone);
translationWidget = new TranslationWidget(backbone, this);
+ menuWidget = new MenuWidget(this);
+
+
+ menuWidget->addSubMenu(tr("Dictionaries"), new QPushButton("Dictionaries"));
+ menuWidget->addSubMenu(tr("Settings"), new QPushButton("Settings"));
+ menuWidget->addSubMenu(tr("About"), new QPushButton("About"));
+
+ ui->menuBar->addAction(menuWidget);
+
connect(wordListWidget, SIGNAL(clicked(QModelIndex)),
translationWidget, SLOT(show(QModelIndex)));
+/*******************************************************************************
+
+ This file is part of mDictionary.
+
+ mDictionary is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ mDictionary is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with mDictionary. If not, see <http://www.gnu.org/licenses/>.
+
+ Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+
+//Created by Mateusz Półrola
+
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "TranslationWidget.h"
#include "WordListWidget.h"
#include "SearchBarWidget.h"
+#include "MenuWidget.h"
namespace Ui {
class MainWindow;
~MainWindow();
public Q_SLOTS:
+ //! Confirmation from backbone that we can close program
void closeOk();
Q_SIGNALS:
+ //! Request to backbone to stop all it's activities
void quit();
protected:
+ /*! When user wants to close application, we first sends signal to stop all
+ ongoing searches.
+ */
void closeEvent(QCloseEvent *);
-
private:
Backbone* backbone;
Ui::MainWindow *ui;
SearchBarWidget* searchBarWidget;
TranslationWidget* translationWidget;
WordListWidget* wordListWidget;
+ MenuWidget* menuWidget;
};
#endif // MAINWINDOW_H
--- /dev/null
+/*******************************************************************************
+
+ This file is part of mDictionary.
+
+ mDictionary is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ mDictionary is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with mDictionary. If not, see <http://www.gnu.org/licenses/>.
+
+ Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+
+//Created by Mateusz Półrola
+
+#include "MenuTabWidget.h"
+#include <QDebug>
+
+MenuTabWidget::MenuTabWidget(QWidget *parent) :
+ QTabWidget(parent) {
+}
+
+void MenuTabWidget::hideEvent(QHideEvent *) {
+ //just set parent to null, and allow event to by handled by default handler
+ setParent(NULL);
+ }
--- /dev/null
+/*******************************************************************************
+
+ This file is part of mDictionary.
+
+ mDictionary is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ mDictionary is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with mDictionary. If not, see <http://www.gnu.org/licenses/>.
+
+ Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+
+//Created by Mateusz Półrola
+
+#ifndef MENUTABWIDGET_H
+#define MENUTABWIDGET_H
+#include <QTabWidget>
+
+/*!
+ Menu's main widget, which will hold all submenu's widgets.
+ It is simply QTabWidget, with changed hideEvent function.
+*/
+class MenuTabWidget : public QTabWidget {
+ Q_OBJECT
+public:
+ explicit MenuTabWidget(QWidget *parent = 0);
+
+protected:
+ /*!
+ Reimplemented default hideEvent function.
+ Right before hide widget it sets it's parent to NULL, which prevent
+ widget to be deleted by menu bar.
+ */
+ void hideEvent(QHideEvent *);
+};
+
+#endif // MENUTABWIDGET_H
--- /dev/null
+/*******************************************************************************
+
+ This file is part of mDictionary.
+
+ mDictionary is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ mDictionary is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with mDictionary. If not, see <http://www.gnu.org/licenses/>.
+
+ Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+
+//Created by Mateusz Półrola
+
+#include "MenuWidget.h"
+#include <QDebug>
+
+MenuWidget::MenuWidget(QWidget *parent) :
+ QWidgetAction(parent) {
+
+ //creating custom tab widget, and sets style sheet to have centered tabs
+ tabWidget = new MenuTabWidget();
+ tabWidget->setStyleSheet("QTabWidget::tab-bar {alignment: center;}");
+}
+
+MenuWidget::~MenuWidget() {
+ //because tabWidget have no parent we must destroy it
+ delete tabWidget;
+}
+
+void MenuWidget::addSubMenu(QString title, QWidget *widget) {
+ tabWidget->addTab(widget, title);
+}
+
+
+void MenuWidget::removeSubMenu(QString title) {
+ for(int i = 0; i < tabWidget->count(); i++) {
+ if(tabWidget->tabText(i) == title) {
+ tabWidget->removeTab(i);
+ break;
+ }
+ }
+}
+
+QWidget* MenuWidget::createWidget(QWidget *) {
+ /*When we have request to create new widget we returns tabWidget.
+ When the menu is closing, tabWidget will receive hideEvent which will set
+ it parent to NULL and prevent it from delete, so we can still use this
+ widget*/
+ return tabWidget;
+}
--- /dev/null
+/*******************************************************************************
+
+ This file is part of mDictionary.
+
+ mDictionary is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ mDictionary is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with mDictionary. If not, see <http://www.gnu.org/licenses/>.
+
+ Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+
+//Created by Mateusz Półrola
+
+#ifndef MENUWIDGET_H
+#define MENUWIDGET_H
+
+#include <QWidgetAction>
+#include "MenuTabWidget.h"
+
+/*! Displays custom menu with tab widget containing all submenus.
+ Each submenu is simply QWidget.
+*/
+class MenuWidget : public QWidgetAction {
+ Q_OBJECT
+public:
+ explicit MenuWidget(QWidget *parent = 0);
+ virtual ~MenuWidget();
+
+ /*!
+ Add new submenu to menu. It is possible to have many submenus with the
+ same title.
+ \param title Name of new submenu which will be displayed in submenu tab.
+ \param widget Widget of the submenu.
+ */
+ void addSubMenu(QString title, QWidget* widget);
+
+ /*!
+ Remove submenu from menu. It will remove first menu with passed title.
+ /param title Name of submeny which will be removed.
+ */
+ void removeSubMenu(QString title);
+
+protected:
+ MenuTabWidget* tabWidget;
+ QWidget* createWidget(QWidget *parent);
+};
+
+#endif // MENUWIDGET_H
this, SLOT(clearSearchWordToolButtonClicked()));
+ //connects request to backbone
connect(this, SIGNAL(searchForTranslations(QString)),
backbone, SLOT(search(QString)));
searchingProgressBar = new QProgressBar();
+ //progress bar have minimum and maximum values set to 0, which will effect
+ //with "I'm alive" bar
searchingProgressBar->setMinimum(0);
searchingProgressBar->setMaximum(0);
searchingProgressBar->hide();
//! Displays search bar
/*!
- Contains line edit field to input word which user would to find, and buttons
- to browse search history.
+ Contains line edit field to input word which user would like to find
+ and buttons to browse search history.
*/
class SearchBarWidget : public QWidget {
Q_OBJECT
initializeUI();
}
-void TranslationWidget::show(QModelIndex index) {
+void TranslationWidget::show(QModelIndex ) {
QWidget::show();
- qDebug()<<index.model()->data(index);
}
void TranslationWidget::initializeUI() {
#include <QtGui>
#include "../backbone/backbone.h"
+//! Displays translation of word found in dictionaries
+/*!
+ Display many translation of word, formatted as html.
+*/
class TranslationWidget : public QWidget {
Q_OBJECT
public:
Q_SIGNALS:
public Q_SLOTS:
+ //! Request to show translation of word passed as QModelIndex from word list
void show(QModelIndex);
private:
QTextEdit* translationTextEdit;
QVBoxLayout* verticalLayout;
-
void initializeUI();
};
wordListModel = new QStringListModel();
setModel(wordListModel);
-
- setAttribute(Qt::WA_Maemo5StackedWindow);
}
void WordListWidget::addWord(QString word) {
#include "../backbone/backbone.h"
+//! Displays list of words found in dictionaries
+/*!
+ It allow user to select word to see it's translation or to mark it as "star"
+ */
class WordListWidget : public QListView {
Q_OBJECT
public:
public Q_SLOTS:
+ /*! Request to show search results, requested by backbone when it finished
+ search*/
void showSearchResults();
private:
Backbone *backbone;
+ //words are keeping as QStringListModel which allow to sort them
QStringListModel *wordListModel;
void addWord(QString word);
+ //clears all list of words
void clear();
};
+/*******************************************************************************
+
+ This file is part of mDictionary.
+
+ mDictionary is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ mDictionary is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with mDictionary. If not, see <http://www.gnu.org/licenses/>.
+
+ Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+
+//Created by Mateusz Półrola
+
#include <QtGui/QApplication>
#include "MainWindow.h"
#include "../backbone/backbone.h"