projects
/
mdictionary
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed wordListWidget acting when word list is empty
[mdictionary]
/
src
/
mdictionary
/
gui
/
WordListWidget.h
diff --git
a/src/mdictionary/gui/WordListWidget.h
b/src/mdictionary/gui/WordListWidget.h
index
9f7c3a2
..
9177529
100644
(file)
--- a/
src/mdictionary/gui/WordListWidget.h
+++ b/
src/mdictionary/gui/WordListWidget.h
@@
-29,8
+29,12
@@
#include <QtGui>
#include <QStringListModel>
#include <QtGui>
#include <QStringListModel>
+#include <QVBoxLayout>
#include "../backbone/backbone.h"
#include "WordListProxyStyle.h"
#include "../backbone/backbone.h"
#include "WordListProxyStyle.h"
+#include "WordListModel.h"
+#include <QtDeclarative/QDeclarativeView>
+#include <QtDeclarative/QDeclarativeContext>
/*!
It allows user to select word to see its translation or to mark or unmark
/*!
It allows user to select word to see its translation or to mark or unmark
@@
-58,6
+62,9
@@
Q_SIGNALS:
//! Requests to remove selected word from bookmarks
void removeBookmark(QList<Translation*>);
//! Requests to remove selected word from bookmarks
void removeBookmark(QList<Translation*>);
+ void setWordListState(QVariant state);
+ void setWordListEmpty(QVariant state);
+
public Q_SLOTS:
//! Shows search results
public Q_SLOTS:
//! Shows search results
@@
-75,7
+82,10
@@
public Q_SLOTS:
//! clears list
void clear();
//! clears list
void clear();
+ void bookmarkModeActive();
+
protected:
protected:
+#ifdef Q_WS_MAEMO_5
//! Reimplemented standard mouseReleaseEvent to check if user clicked on
//! a word or on its star to emit suitable signal
void mouseReleaseEvent(QMouseEvent *event);
//! Reimplemented standard mouseReleaseEvent to check if user clicked on
//! a word or on its star to emit suitable signal
void mouseReleaseEvent(QMouseEvent *event);
@@
-86,8
+96,9
@@
protected:
//! Checks if user press return and if so displays translation of selected word
void keyPressEvent( QKeyEvent * event);
//! Checks if user press return and if so displays translation of selected word
void keyPressEvent( QKeyEvent * event);
-
+#endif
private Q_SLOTS:
private Q_SLOTS:
+#ifdef Q_WS_MAEMO_5
//! Emits signal to show translation of clicked item. Signal is emitted
//! only when a word was clicked.
void wordClicked(QModelIndex index);
//! Emits signal to show translation of clicked item. Signal is emitted
//! only when a word was clicked.
void wordClicked(QModelIndex index);
@@
-95,7
+106,11
@@
private Q_SLOTS:
//! Emits signal to show add or remove word from bookmarks.
//! Signal is emitted only when a star was clicked.
void wordChecked(QModelIndex index);
//! Emits signal to show add or remove word from bookmarks.
//! Signal is emitted only when a star was clicked.
void wordChecked(QModelIndex index);
-
+#else
+ void wordClicked(QString word);
+ void addToBookmarks(QString word);
+ void removeFromBookmarks(QString word);
+#endif
private:
private:
@@
-113,6
+128,15
@@
private:
//! Association between words and their translations
QHash<QString, QList<Translation*> > searchResult;
WordListProxyStyle* proxyStyle;
//! Association between words and their translations
QHash<QString, QList<Translation*> > searchResult;
WordListProxyStyle* proxyStyle;
+
+ bool _isBookmarkModeActive;
+
+#ifndef Q_WS_MAEMO_5
+ QVBoxLayout* verticalLayout;
+ QDeclarativeView* qmlView;
+ QDeclarativeContext* ctxt;
+ WordListModel* listModel;
+#endif
};
#endif // WORDLISTWIDGET_H
};
#endif // WORDLISTWIDGET_H