+++ /dev/null
-body, html, body *, html * {
- margin : 0px;
- padding : 0px;
- color : #eee;
- font-size : 10pt;
- font-family : Tahoma, Helvetica, Arial, Arial, sans-serif;
-}
-body {
- background-color : black;
-}
-
-div.tab {
- display : block;
- margin : 4px;
- margin-top : 8px;
- padding : 2px;
- padding-bottom : 0px;
- background-color : #333;
- border-radius : 5px;
- border : 1px solid #555;
- background-image : url("images/tab-background.png");
- background-repeat : repeat-y;
- -webkit-box-reflect : below 5px -webkit-gradient(linear, 0% 0%, 0% 150%, from(transparent), color-stop(0.3, transparent), to(white));
-}
-
-div.dict {
- margin : 0px 0px 5px 5px;
- padding : 0px;
- background-color : transparent;
-
- border : solid transparent;
- border-width : 13px 13px 13px 13px;
- -webkit-border-image : url("images/shadow-grey-bg.png") 13 13 13 13;
-}
-
-div.info {
- font-weight : bold;
- text-align : center;
- padding : 3px;
- background-color : #444;
- color : #dcbba0;
-
- border : solid transparent;
- border-width : 5px 5px 5px 5px;
- -webkit-border-image : url("images/header-border.png") 5 5 5 5;
-
- background-image : url("images/header-background.png");
- background-repeat : repeat-y;
- background-position : -3 0;
-}
-
-
-div.key {
- text-align : center;
- color : #9c9;
-
- background-image : url("images/key-background.png");
- background-repeat : no-repeat;
- background-position : center;
-
- border-radius : 10px 10px 40px 40px;
- border-width : 1px 1px 1px 1px;
- border-style : solid;
- border-color : #1f1f1f;
-
- margin-top : 5px;
-}
-
-div.cell {
- padding : 0px 0px 0px 10px;
-}
-
-span.i {
- font-style : italic;
-}
-span.b {
- font-weight : bold;
-}
-span.u {
- text-decoration : underline;
-}
--- /dev/null
+body, html, body *, html * {
+ margin : 0px;
+ padding : 0px;
+ color : #eee;
+ font-size : 14pt;
+ font-family : Tahoma, Helvetica, Arial, Arial, sans-serif;
+}
+body {
+ background-color : black;
+}
+
+
+
+div.tab {
+ display : block;
+ margin : 4px;
+ margin-top : 8px;
+ padding : 2px;
+ padding-bottom : 0px;
+ background-color : #333;
+ border-radius : 5px;
+ border : 1px solid #555;
+ background-image : url("images/tab-background.png");
+ background-repeat : repeat-y;
+ -webkit-box-reflect : below 5px -webkit-gradient(linear, 0% 0%, 0% 150%, from(transparent), color-stop(0.3, transparent), to(white));
+}
+
+div.dict {
+ margin : 0px 0px 5px 5px;
+ padding : 0px;
+ background-color : transparent;
+
+ border : solid transparent;
+ border-width : 13px 13px 13px 13px;
+ -webkit-border-image : url("images/shadow-grey-bg.png") 13 13 13 13;
+}
+
+div.info {
+ font-weight : bold;
+ text-align : center;
+ padding : 3px;
+ background-color : #444;
+ color : #dcbba0;
+
+ border : solid transparent;
+ border-width : 5px 5px 5px 5px;
+ -webkit-border-image : url("images/header-border.png") 5 5 5 5;
+
+ background-image : url("images/header-background.png");
+ background-repeat : repeat-y;
+ background-position : -3 0;
+ vertical-align : middle;
+}
+
+img.icon {
+ vertical-align : middle;
+ float : left;
+ height : 16px;
+ padding : 5px;
+}
+
+
+div.key {
+ text-align : center;
+ color : #9c9;
+
+ background-image : url("images/key-background.png");
+ background-repeat : no-repeat;
+ background-size : 100% auto;
+ background-position : center;
+
+ border-radius : 10px 10px 40px 40px;
+ border-width : 1px 1px 1px 1px;
+ border-style : solid;
+ border-color : #1f1f1f;
+
+ margin-top : 5px;
+}
+
+div.cell {
+ padding : 0px 0px 0px 10px;
+}
+
+span.i {
+ font-style : italic;
+}
+span.b {
+ font-weight : bold;
+}
+span.u {
+ text-decoration : underline;
+}
--- /dev/null
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ <link rel="stylesheet" type="text/css" href="style.css">
+</head>
+<body ondragstart="return false"><div class="tab">
+ <div class="dict">
+ <div class="info"> [English-Polish] </div>
+ <div class="key">cat</div>
+ <div class="cell">kot<br>
+ (<span>rzeczownik</span>)
+: kot, kotka, kociątko, złośliwa kobieta<br>
+ (<span>czasownik</span>)
+: podnieść</div>
+
+ <div class="key">CAT</div>
+ <div class="cell">
+CAT - firma produkująca ciężki sprzęt budowlany</div>
+ </div>
+ <div class="dict">
+ <div class="info">
+Basic Thai Language [ENG-THA]</div>
+ <div class="key">cat</div>
+ <div class="cell">maeow</div>
+ </div>
+</div>
+</body></html>
--- /dev/null
+body, html, body *, html * {
+ margin : 0px;
+ padding : 0px;
+ color : #777185;
+ font-size : 10pt;
+ font-family : Tahoma, Helvetica, Arial, Arial, sans-serif;
+}
+body {
+ background-color : #eeecec;
+}
+
+img.icon {
+ vertical-align : middle;
+ float : left;
+ height : 16px;
+ padding : 5px;
+}
+
+
+div.tab {
+ background-attachment: scroll;
+ background-color : transparent;
+ background-image : url("images/people.png");
+ background-repeat : no-repeat;
+ background-size : contain;
+ background-position : center bottom;
+ display : block;
+ margin : 4px;
+ margin-top : 8px;
+ padding : 2px;
+ padding-bottom : 0px;
+
+ -webkit-box-reflect : below 5px -webkit-gradient(linear, 0% 0%, 0% 120%, from(transparent), color-stop(0.3, transparent), to(white));
+}
+
+div.dict {
+ margin : 0px 0px 5px 5px;
+ padding : 0px;
+ background-color : transparent;
+
+ border : solid transparent;
+ border-width : 13px 13px 13px 13px;
+ -webkit-border-image : url("images/shadow-transparent-bg.png") 13 13 13 13;
+}
+
+div.info {
+ font-weight : bold;
+ text-align : center;
+ padding : 3px;
+ background-color : transparent;
+ color : #000000;
+
+ border : solid transparent;
+ border-width : 5px 5px 5px 5px;
+ -webkit-border-image : url("images/header-border.png") 5 5 5 5;
+
+ background-image : url("images/header-background.png");
+ background-repeat : repeat-y;
+ background-position : -3 0;
+}
+
+
+div.key {
+ text-align : center;
+ font-weight : bold;
+ color : #000000;
+
+ background-image : url("images/key-background.png");
+ background-repeat : no-repeat;
+ background-position : center;
+
+ border : solid transparent;
+ border-radius : 15px 15px 15px 15px;
+ border-width : 1px 1px 1px 1px;
+ border-style : solid;
+ border-color : #777185;
+
+ margin-top : 5px;
+}
+
+div.cell {
+ color : #3e3b46;
+ padding : 0px 0px 0px 10px;
+}
+
+span.i {
+ color : #3e3b46;
+ font-style : italic;
+}
+span.b {
+ color : #3e3b46;
+ font-weight : bold;
+}
+span.u {
+ color : #3e3b46;
+ text-decoration : underline;
+}
<xsl:template match="info">
<div class="info">
<xsl:variable name="path" select="@path"/>
-
+ <img class="icon" src="{$path}"/>
<xsl:if test="@bookmark = 'true'">
<img src="$STAR$" width="16" height="16"/>
</xsl:if>
<xsl:value-of select="."/>
- <br/>
- <img src="{$path}" height="16"/>
</div>
</xsl:template>
usr/lib/mdictionary/plugins/eng-us.xdxf
usr/lib/mdictionary/plugins/eng-thai.xdxf
usr/share/mdictionary/xdxf.png
-usr/share/applications/hildon/mdictionary.desktop
usr/share/mdictionary/css/
+usr/share/applications/hildon/mdictionary.desktop
//! Implements widget for maemo that allows user to search quickly right from home screen using mdictionary.
/*!
Shows tool button with logo of mDictionary which can start application.
- In line edit user inputs word, and using button next to it or by pressing enter, widget runs mDictionary which immediately starts searching for a given word.
+ In line edit user inputs word, and after using button next to it or pressing enter, widget runs mDictionary which immediately starts searching for a given word.
If mDictionary is already running in background it will show the program.
*/
class HomeWidget : public QWidget
CommonDictInterface(QObject *parent = 0):QObject(parent) {}
virtual ~CommonDictInterface() {}
- //! returns source language code iso 639-2
+ //! \returns source language code iso 639-2
virtual QString langFrom() const = 0;
- //! returns destination language code iso 639-2
+ //! \returns destination language code iso 639-2
virtual QString langTo() const = 0;
- //! returns dictionary name (like "old English" or so)
+ //! \returns dictionary name (like "old English" or so)
virtual QString name() const = 0;
- //! returns dictionary type (xdxf, google translate, etc)
+ //! \returns dictionary type (xdxf, google translate, etc)
virtual QString type() const = 0;
//! returns information about dictionary (name, authors, etc)
virtual QString infoNote() const = 0;
- /*! returns DictDialog object that creates dialogs
- for adding new dictionary and changing plugin settings*/
+ /*! \returns DictDialog object that creates dialogs
+ for adding a new dictionary and changing plugin settings*/
virtual DictDialog* dictDialog() = 0;
- //! returns new, clean copy of plugin with settings set as in Settings*
+ //! \returns new, clean copy of plugin with settings set as in Settings*
virtual CommonDictInterface* getNew(const Settings*) const = 0;
- //! returns whether plugin can start searching
+ //! \returns whether plugin can start searching
virtual bool isAvailable() const = 0;
- //! returns the actual translation of a word given in key
+ //! \returns the actual translation of a word given in a key
virtual QString search(QString key) = 0;
//! \returns unique value (unique for every dictionary, not plugin)
this->_hash=h;
}
- //! returns current plugin settings
+ //! \returns current plugin settings
virtual Settings* settings() = 0;
- //! returns plugin icon
+ //! \returns plugin icon
virtual QIcon* icon() = 0;
- //! returns empty translation object (to be fetched later) for given key
+ //! \returns empty translation object (to be fetched later) for a given key
virtual Translation* getTranslationFor(QString ) {return 0;}
/*! plugin should delete any files (eg. cache) that have been created and are ready
virtual void retranslate() {}
Q_SIGNALS:
- //! emitted after change in a dictionary settings
+ //! emitted after change in dictionary settings
void settingsChanged();
/*! emitted to backbone when it's needed to inform user about something
\param Backbone::NotifyType GUI may decide to show different types in
different ways
- \param QString text of the notification
+ \param text of the notification
*/
void notify(Notify::NotifyType, QString);
DictDialog(QObject *parent = 0) : QObject(parent) {}
/*!
- Shows "add new dictionary" dialog and returns settings of new dict
- \param parent parent widget on which dialog will be displayed
+ Shows "add a new dictionary" dialog and returns settings of a new dict
+ \param parent parent widget on which the dialog will be displayed
*/
virtual Settings* addNewDictionary(QWidget*parent=0)=0;
/*!
Shows "settings" dialog and saves new settings in plugin
- \param parent parent widget on which dialog will be displayed
+ \param parent parent widget on which the dialog will be displayed
*/
virtual void changeSettings(QWidget *parent = 0) = 0;
GUIInterface(QWidget *parent = 0) :QMainWindow(parent) {}
virtual ~GUIInterface() {}
- //! Returns all loaded dictionaries with information about that they are
+ //! Returns all loaded dictionaries with information if they are
//! active/inactive
/*!
- \return Hash of pointers to dictionary and boolean flag indicating if
- dictionary is active
+ \return Hash of pointers to a dictionary and boolean flag indicating if
+ a dictionary is active
*/
virtual QHash<CommonDictInterface*, bool> getDictionaries() = 0;
//! Indicates if GUI is in exact search mode.
/*! When GUI is in exact search mode it searches for a word, and
if it finds exactly matching translation it directly displays it, without
- displaying matching word list. This mode should be
+ displaying matching words list. This mode should be
used for browsing search history and searching for words from application
arguments.
\returns flag indicating if GUI is in exact search mode
/*!
GUI will be automatically set into exact search mode, and after search or
break it will be unset from exact search mode.
- \param word which will be searched for in dictionaries
+ \param word word which will be searched for in dictionaries
*/
virtual void searchExact(QString word) = 0;
//! Shows translation of previous word in history
/*!
It will work only if there is previous word available in history.
- Translation of word is searched for with searchExact() function
+ Translation of a word is searched for with searchExact() function
\sa searchExact()
*/
virtual void historyPrev() = 0;
/*!
Checks if received list is empty, in that case it displays suitable
information. If GUI is in exact search mode it will search for exact
- word in received list, and if word is found it will emit signal to
+ word in received list, and if the word is found it will emit signal to
display its translation. Otherwise it will display list of matching
words and show suitable information.
\sa exactSearch()
//! Emitted when user wants to break search
void stopSearching();
- //! Emitted after receiving word list in wordListReady() slot, will display
+ //! Emitted after receiving words list in wordListReady() slot, will display
//! list of matched words
- /*! \param hash of word and list of translations of this word found
+ /*! \param hash of a word and list of translations of this word found
in dictionaries
*/
void showWordList(QHash<QString, QList<Translation*> >);
*/
void showTranslation(QStringList);
- //! Emitted when user wants to add new dictionary
+ //! Emitted when user wants to add a new dictionary
/*! \param new dictionary returned by specific plugin dialog
*/
void addNewDictionary(CommonDictInterface*);
- //! Emitted when user wants to remove dictionary
+ //! Emitted when user wants to remove a dictionary
/*! \param dictionary which will be removed
*/
void removeDictionary(CommonDictInterface*);
_settings = QHash<QString, QString>(set->_settings);
}
- /*! \returns value fo given key
- \param key name of given setting
- \return value of given setting
+ /*! \returns value fo a given key
+ \param key name of a given setting
+ \return value of a given setting
*/
QString value(const QString key) const {
if(!_settings.contains(key)) {
return _settings[key];
}
- /*! sets key to value
- \param key name of given setting
- \param value of given setting
+ /*! sets key to a value
+ \param key name of a given setting
+ \param value value of a given setting
*/
void setValue(const QString key, const QString value) {
_settings.insert(key, value);
_bookmark = b;
}
- //! returns coresponding dict object
+ //! \returns corresponding dict object
virtual uint dict() const {return 0;}
protected:
/*! Bookmarks are a way to store words that You think You will need to search
for often.
- When You add bookmark (by clicking on "star" in words list) You add it to
- special list with cached translations from all available dictionaries so
+ When You add a bookmark (by clicking on "star" in words list) You add it to
+ a special list with cached translations from all available dictionaries so
You can search for them quickly even when You delete corresponding dict.
*/
class Bookmarks : public AccentsNormalizer {
*/
void add(Translation* translation);
- /*! Removes word and corresponding translation cache from bookmark list
+ /*! Removes word and corresponding translation cache from bookmarks list
\param translation translation to be removed
*/
void remove(Translation* translation);
QList<Translation*> list();
/*! Searches in bookmarks for a given word (wildcards may apply '*' and '?')
- \param word to search for
+ \param word word to search for
\return list of matching Translation objects
*/
QList<Translation*> searchWordList(QString word);
/*! \return true if a given word is already in bookmarks
- \param word to check
+ \param word word to check
*/
bool inBookmarks(QString word);
#include <QDebug>
/*! ConfigGenerator generates configuration files (with default values),
-if given file doesn't exist.
+if a given file doesn't exist.
*/
class ConfigGenerator {
/*! Generates default configuration files
\param file file to be generated
- \return if file was generated - returns true; if file alredy exists
+ \return if file was generated - returns true; if file already exists
returns true; if file doesn't exist but cannot be generated returns false
*/
bool generateDefaultConfig(QString file);
* search_bookmarks - true/false, whether search in bookmarks
Searching schema:
- At first GUI should ask for list of words matching given pattern,
+ At first GUI should ask for a list of words matching a given pattern,
then each Translation object is capable of finding its own final translation
List of words:
Q_OBJECT
public:
- /*!\param pluginPath path to plugins (leave blank for default)
- \param configPath path to folder with configuration files
- \param dry dry run is mode without paying attention to configuration etc
+ /*! \param pluginPath path to plugins (leave blank for default)
+ \param configPath path to folder with configuration files
+ \param dry dry run is mode without paying attention to configuration etc
mainly for testing
*/
Backbone(QString pluginPath="", QString configPath="",
//! \return history of performed searches
History* history();
- //! \return return search fesult
+ //! \return search fesult
QMultiHash<QString, Translation*> result();
//! \return maximum number of words that plugin could find
void stopSearching();
/*! searches for a word translation
- \param word to be translated
+ \param word word to be translated
*/
void search(QString word);
/*! sets active dictionaries (searches are performed only in active dicts)
\param List of dictionaries to be activated
*/
- void selectedDictionaries(QList<CommonDictInterface* >);
+ void selectedDictionaries(QList<CommonDictInterface*>);
- /*! adds new dictionary and activates it
+ /*! adds a new dictionary and activates it
\param dict dictionary to be added
\param active decides whether searches are perfomed in given dictionaries
*/
void quit();
- /*! Fired by FutureWatcher when list of words is ready (after calling search)
+ /*! Fired by FutureWatcher when a list of words is ready (after calling search),
fetch Future<...> to final result
*/
void translationReady();
*/
void xmlTranslationReady();
- /*! Removes given dictionary
+ /*! Removes a given dictionary
\param dict dictionary to be deleted
*/
void removeDictionary(CommonDictInterface* dict);
/*! adds bookmarks to given translations (translation object is fetched and
added to bookmarks data base (key and translation stored in db))
- \param translation translation object to be stored in db
+ \param translations list of Translation objects to be stored in db
*/
void addBookmark(QList<Translation*> translations) {
foreach(Translation* translation, translations)
/*! Removes bookmarks to given translations
- \param translation remove bookmark to this translation
+ \param translations remove bookmark to these translations
*/
void removeBookmark(QList<Translation*> translations) {
foreach(Translation* translation, translations)
}
- /*! Searching a list of bookmarks may take some time, so I moved it to
+ /*! Searching a list of bookmarks may take some time, so it's moved to a
new thread (to avoid GUI blocking), further it's consistent with ordinary
searching a list of words (\see search)
*/
/*! emitted by direct connection to plugins notifying signals
\param Notify::NotifyType GUI may decide to show different types in
different ways
- \param QString text of the notification
+ \param text of the notification
*/
void notify(Notify::NotifyType, QString);
comarchNote += "<br/><font size=\"small\"><a href=\"https://garage.maemo.org/tracker/?func=add&group_id=58&atid=305\">"
"Report bug</a></font></center>";
licenseNote = QString("<br><p><font size=\"small\">This program is free"
- "software: you can redistribute it and/or modify\n"
+ " software: you can redistribute it and/or modify\n"
"it under the terms of the GNU General Public License as"
- "published by\n"
+ " published by\n"
"the Free Software Foundation, either version 3 of the License,"
- "or\n"
+ " or\n"
"(at your option) any later version.<br>"
"This program is distributed in the hope that it will be"
- "useful,\n"
+ " useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty"
- "of\n"
+ " of\n"
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. "
"See the\n"
"GNU General Public License for more details.<br>"
#include "MainWindow.h"
/*!
- Implements dbus adapter which defines dbus interface for application.
+ Implements dbus adapter which defines dbus interface for an application.
Other application can use this interface to call mdictionary methods.
*/
class DBusAdapter : public QDBusAbstractAdaptor
//! Implements dictionaries management widget
/*!
Shows list of loaded dictionaries and their states (active/inactive).
- It allows to change dicts states, add new dict, remove selected one or
+ It allows to change dicts states, add a new dict, remove selected one or
change settings of selected dict. All changes are saved automatically after
hiding of this widget.
*/
public:
//! Constructor
/*!
- \param parent parent of this widget, which must be subclass of
+ \param parent parent of this widget, which must be a subclass of
GUIInterface, because it will use it to get info about loaded plugins
and dicts.
*/
*/
void selectedDictionaries(QList<CommonDictInterface*>);
- //! Emitted when user wants to add new dictionary
+ //! Emitted when user wants to add a new dictionary
/*!
\param new dictionary returned by specific plugin dialog
*/
void addDictionary(CommonDictInterface*);
- //! Emitted when user wants to remove dictionary
+ //! Emitted when user wants to remove a dictionary
/*!
\param dictionary which will be removed
*/
#endif
private Q_SLOTS:
- /*! Shows "plugin select" dialog and then plugin specific "add new dictionary
- dialog", which will return new CommonDictInterface* object, which is
- later passed as parameter of addDictionary signal*/
+ /*! Shows "plugin select" dialog and then plugin specific "add a new dictionary"
+ dialog, which will return new CommonDictInterface* object, which is
+ later passed as a parameter of addDictionary signal*/
void addNewDictButtonClicked();
- /*! Passes dictionary selected from list as parameter of removeDictionary
+ /*! Passes dictionary selected from a list as a parameter of removeDictionary
signal */
void removeButtonClicked();
- //! user select one of items
+ //! user selects one of items
void itemSelected(QListWidgetItem*);
//! Shows plugin's settings dialog
//! Implements plugin selection dialog
/*!
- Shows list of loaded dictionaries plugins.
+ Shows a list of loaded dictionaries plugins.
Static function addNewdict will return selected plugin.
*/
class DictTypeSelectDialog : public QDialog {
Q_OBJECT
public:
- //! Shows dialog with list of plugins
+ //! Shows dialog with a list of plugins
/*!
\param plugins list of loaded plugins
- \param parent widget
+ \param parent parent widget
\return selected plugin, if user cancels dialog it returns 0 (NULL)
*/
static CommonDictInterface* addNewDict(
QList<CommonDictInterface* > plugins,
QWidget *parent = 0);
- //! Returns plugin selected by user
+ //! \returns plugin selected by user
CommonDictInterface* selectedPlugin();
protected:
//! Implements history list dialog
/*!
- Shows history list and allows user to select one word of it.
- On desktop it is shown as popup.
+ Shows a history list and allows user to select one word of it.
+ On desktop it is shown as a popup.
*/
class HistoryListDialog : public QDialog
{
//! Constructor
/*!
\param words list of history words
- \param parent widget
+ \param parent parent widget
*/
explicit HistoryListDialog(QStringList words, QWidget* parent = 0);
- //! Returns word selected by user
+ //! \returns word selected by user
QString selectedWord();
- //! Returns row number of selected word
+ //! \returns row number of selected word
int selectedRow();
private Q_SLOTS:
with suitable backbone signals and slots.
Only this class has direct access to backbone object.
It manages all requests of subcomponents e. g. searching for a given word,
- displaying history, removing dictionary.
+ displaying history, removing a dictionary.
It also provides data from backbone to subcomponents e. g. result of search.
*/
class MainWindow : public GUIInterface
public:
//! Constructor
/*!
- \param backbone object which will be doing all searches and returning data
+ \param backbone backbone object which will be doing all searches and returning data
\param parent parent widget of this window
*/
MainWindow(Backbone* backbone, QWidget *parent = 0);
~MainWindow();
- //! Returns all loaded dictionaries with infromation about that they are
+ //! Returns all loaded dictionaries with information if they are
//! active/inactive
/*!
- \return Hash of pointers to dictionary and boolean flag indicating if
- dictionary is active
+ \return Hash of pointers to a dictionary and boolean flag indicating if
+ a dictionary is active
*/
QHash<CommonDictInterface*, bool> getDictionaries();
\sa isInExactSearch()
\sa setExactSearchString()
*/
- void setExactSearch(bool);
+ void setExactSearch(bool exactSearch);
//! Gets word list from backbone and prepares received list to display
//! Shows translation of next word in history
/*!
It will work only if there is next word available in history.
- Translation of word is searched for with searchDelay() function.
+ Translation of a word is searched for with searchDelay() function.
On maemo search is in normal mode, on desktop in exact search mode.
\sa searchDelay()
\sa searchExact()
//! Shows translation of previous word in history
/*!
- It will work only if there is available previous word in history.
- Translation of word is searched for with searchDelay() function.
+ It will work only if there is previous word available in history.
+ Translation of a word is searched for with searchDelay() function.
On maemo search is in normal mode, on desktop in exact search mode.
\sa searchDelay()
\sa searchExact()
//! 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.
+ Shows notifications to user, assures that a couple of the same notifications
+ will not be displayed at the same time. It automatically deletes
+ notifications after user accepts or rejects them.
*/
class NotifyManager : public QObject
}
-QIcon SearchBarWidget::generateIcon(QIcon oryginal, qreal rotation) {
- QPixmap p = oryginal.pixmap(64);
+QIcon SearchBarWidget::generateIcon(QIcon original, qreal rotation) {
+ QPixmap p = original.pixmap(64);
if(rotation != 0) {
~SearchBarWidget();
Q_SIGNALS:
- //! Requests to search for a list of words matching word passed as
- //! parameter
+ //! Requests to search for a list of words matching a word passed as
+ //! a parameter
void searchForTranslations(QString);
//! Requests to stop all active searchings
//! Requests to show history list
/*!
\param p this argument is used only on desktop, it defines place on
- which popup with history will be shown
+ which a popup with history will be shown
*/
void historyShow(QPoint p = QPoint(-1,-1));
//! generates icon for maemo (some of icons we use don't have inactive
- //! pixmaps, so we generate them
+ //! pixmaps, so we generate them)
/*!
- \param oryginal oryginal icon
+ \param original original icon
\param rotation rotation of resulting icon
*/
- QIcon generateIcon(QIcon oryginal, qreal rotation=0);
+ QIcon generateIcon(QIcon original, qreal rotation=0);
QVBoxLayout* verticalLayout;
public:
//! Constructor
/*!
- \param parent parent of this widget, which must be subclass of
+ \param parent parent of this widget, which must be a subclass of
GUIInterface, because it will use it to get current settings and
set new ones.
*/
#include <QPropertyAnimation>
#include "../../include/GUIInterface.h"
-//! Displays translation of word found in dictionaries
+//! Displays translation of a word found in dictionaries
/*!
Displays many translations of word, formatted as xml.
*/
//! Show widget.
void show();
- //! Requests to show translation of word list passed as parameter.
+ //! Requests to show a translation of words list passed as parameter.
void show(QStringList);
- //! Updates users zoom preferences and sends its to backbone to be saved
+ //! Updates user's zoom preferences and sends its to backbone to be saved
void updateZoom(qreal);
protected:
QModelIndex item = selectedIndexes().at(0);
if(!item.isValid()) return;
- //to shorten lag between clicking on star and its change
+ //to shorten lag between clicking on a star and its change
repaint();
//depending on new state emit suitable signal
system doesn't select item but emits mouseReleaseEvent*/
if(selectedIndexes().count() == 0) return;
- //if user doesn't click either on word or on star, return
+ //if user doesn't click either on a word or on a star, return
if(selectedIndexes().at(0) != index && selectedIndexes().at(1) != index)
return;
int c = index.column();
if(c==0)
- //if column is 0 user clicked word
+ //if column is 0 user clicked on a word
wordClicked(index);
else
- //else user clicked star
+ //else user clicked on a star
wordChecked(index);
}
protected:
//! Reimplemented standard mouseReleaseEvent to check if user clicked on
- //! word or on its star to emit suitable signal
+ //! a word or on its star to emit suitable signal
void mouseReleaseEvent(QMouseEvent *event);
//! Resizes the size of columns to assure that stars are always on right
private Q_SLOTS:
//! Emits signal to show translation of clicked item. Signal is emitted
- //! only when word was clicked.
+ //! only when a word was clicked.
void wordClicked(QModelIndex index);
//! Emits signal to show add or remove word from bookmarks.
- //! Signal is emitted only when star was clicked.
+ //! Signal is emitted only when a star was clicked.
void wordChecked(QModelIndex index);
QStandardItemModel* model;
- //! Describes width of star checkbox in pixels
+ //! Describes width of a star checkbox in pixels
int checkBoxWidth;
//! Resizes sizes of colums after adding new words or after resize event.
maemo5:QT += maemo5
+message($$CONFIG)
+
SOURCES += gui/main.cpp \
backbone/ConfigGenerator.cpp \
gui/MainWindow.cpp \
shared.files += ../../data/icons/16x16/staron.png
shared.files += ../../data/xsl/mask.png
- css.path = $$DATA_DIR/css
- css.files += ../../data/css/style.css
-
- css_images.path = $$DATA_DIR/css/images
- css_images.files += ../../data/css/images/header-background.png
- css_images.files += ../../data/css/images/header-border.png
- css_images.files += ../../data/css/images/shadow-grey-bg.png
- css_images.files += ../../data/css/images/shadow-white-bg.png
- css_images.files += ../../data/css/images/tab-background.png
- css_images.files += ../../data/css/images/key-background.png
-
- service.path = $$SHARE_DIR/dbus-1/services
- service.files += ../../data/other/com.comarch.mdictionary.service
+ meego {
+ css.path = $$DATA_DIR/css
+ css.files += ../../data/css_meego/style.css
+
+ css_images.path = $$DATA_DIR/css/images
+ css_images.files += ../../data/css_meego/images/header-background.png
+ css_images.files += ../../data/css_meego/images/header-border.png
+ css_images.files += ../../data/css_meego/images/shadow-grey-bg.png
+ css_images.files += ../../data/css_meego/images/shadow-white-bg.png
+ css_images.files += ../../data/css_meego/images/tab-background.png
+ css_images.files += ../../data/css_meego/images/key-background.png
+ css_images.files += ../../data/css_meego/images/shadow-transparent-bg.png
+ css_images.files += ../../data/css_meego/images/splash2.png
+ }
+ !meego {
+ css.path = $$DATA_DIR/css
+ css.files += ../../data/css_maemo/style.css
+
+ css_images.path = $$DATA_DIR/css/images
+ css_images.files += ../../data/css_maemo/images/header-background.png
+ css_images.files += ../../data/css_maemo/images/header-border.png
+ css_images.files += ../../data/css_maemo/images/shadow-grey-bg.png
+ css_images.files += ../../data/css_maemo/images/shadow-white-bg.png
+ css_images.files += ../../data/css_maemo/images/tab-background.png
+ css_images.files += ../../data/css_maemo/images/key-background.png
+ }
+ service.path = $$SHARE_DIR/dbus-1/services
+ service.files += ../../data/other/com.comarch.mdictionary.service
INSTALLS += desktop icon64 shared service css css_images
}
//! Implementation of google plugin's dialogs.
/*!
- This class can create dialogs for adding new dictionary or changins settings
- of existing one, based on dialog type passed to contructor.
- These type are different only in confirm button label.
- Both provides comboboxes with availaible languages to choose.
+ This class can create dialogs for adding a new dictionary or changing settings
+ of an existing one, based on dialog type passed to constructor.
+ These types differ only in confirm button label.
+ Both provide comboboxes with available languages to choose.
*/
class GoogleDialog : public QDialog
{
Q_OBJECT
public:
/*!
- Describes type of dialog. New means that dialog confirm button has label
- Add", Change means dialog confirm button has label "Save settings"
+ Describes type of dialog. New means that dialog confirm button has
+ "Add" label, Change means that dialog confirm button has "Save settings" label.
*/
enum GoogleDialogType {New, Change};
//! Constructor
/*!
Creates new google dialog
- \param plugin if creating dialog of type Change it must be set to
- pointer of plugin whose settings will be changed
- \param type describes type of creating dialog
- \param parent parent widget of creating dialog
+ \param plugin if created dialog is of type Change it must be set to
+ point to plugin whose settings will be changed
+ \param type describes type of created dialog
+ \param parent parent widget of created dialog
*/
explicit GoogleDialog(GooglePlugin* plugin = 0,
GoogleDialogType type = New,
QWidget* parent = 0);
- //! Returns settings of plugin
+ //! \returns settings of plugin
/*!
- After acceptance of dialog this method return plugin's settings based on
- user choises in dialog.
+ After acceptance of dialog this method returns plugin's settings based on
+ user's choices in dialog.
*/
Settings* getSettings();
Q_SIGNALS:
- //! Request to show notification
+ //! requests to show notification
void notify(Notify::NotifyType, QString);
public Q_SLOTS:
- //! Reimplemented accept method, to save new settings
+ //! reimplemented accept method, to save new settings
void accept();
private Q_SLOTS:
*******************************************************************************/
/*! \file GoogleDictDialog.h
- \brief Class launches dialog which generates new dictionary, or changes
+ \brief Class launches dialog which generates a new dictionary, or changes
settings
\author Jakub Jaszczynski <j.j.jaszczynski@gmail.com>
*/
public:
explicit GoogleDictDialog(GooglePlugin* plugin, QObject *parent = 0);
/*!
- Shows "add new google dictionary" dialog and returns settings of new dict
+ Shows "add new google dictionary" dialog and returns settings of a new dict
\param parent parent widget on which dialog will be displayed
*/
Settings* addNewDictionary(QWidget *parent);
GooglePlugin(QObject *parent=0);
~GooglePlugin();
- //! returns source language code iso 639-2
+ //! \returns source language code iso 639-2
QString langFrom() const;
- //! returns destination language code iso 639-2
+ //! \returns destination language code iso 639-2
QString langTo() const;
- //! returns dictionary name (like "old English" or so)
+ //! \returns dictionary name (like "old English" or so)
QString name() const;
- //! returns dictionary type (xdxf, google translate, etc)
+ //! \returns dictionary type (xdxf, google translate, etc)
QString type() const;
//! returns information about dictionary (name, authors, etc)
//! sets the language from which the translation is done
void setLangFrom(QString langFrom);
- /*! returns DictDialog object that creates dialogs
+ /*! \returns DictDialog object that creates dialogs
for adding new dictionaries and changing plugin things
*/
DictDialog* dictDialog();
- //! returns new, clean copy of plugin with settings set as in Settings*
+ //! \returns new, clean copy of plugin with settings set as in Settings*
CommonDictInterface* getNew(const Settings*) const;
- //! returns whether plugin can start searching
+ //! \returns whether plugin can start searching
bool isAvailable() const;
//! sets if connection with Internet is possible
void setConnectionAccept(QString connectionAcepted);
- //! returns the value of "connection_accepted" from settings
+ //! \returns the value of "connection_accepted" from settings
bool isConnectionAccept() const;
- //! returns a description of a word given by a QString
+ //! \returns a description of a word given by a QString
QString search(QString key);
- //! returns current plugin settings
+ //! \returns current plugin settings
Settings* settings();
//! Sets new settings
void setSettings(const Settings*);
- //! returns plugin icon
+ //! \returns plugin icon
QIcon* icon();
- //! returns empty translation object (to be fetched later) for given key
+ //! \returns empty translation object (to be fetched later) for a given key
Translation* getTranslationFor(QString key);
//! initializes the list of available languages in Google translator
*/
QList<Translation*> searchWordList(QString word, int limit=0);
- //! stop current operation
+ //! stops current operation
void stop();
//! function called after the request from Google is returned
//! information about dictionary
QString _infoNote;
- //! icon displayed during translations and when the dictionary is chosen
+ //! icon displayed during translations and when a dictionary is chosen
QIcon _icon;
Settings *_settings;
//! indicates if search is stopped
return _bookmark;
}
- //! returns corresponding dict object
+ //! \returns corresponding dict object
uint dict() const {return _dictHash;}
private:
return _bookmark;
}
- //! returns coresponding dict object
+ //! returns corresponding dict object
uint dict() const {return _dictHash;}
private:
//! Implementation of xdxf plugin's dialogs.
/*!
- This class can create dialogs for adding new dictionary or changins settings
- of existing one, based on dialog type passed to contructor.
- When adding new dictionary dialog contains button to browse file system and
- select dictionary file. When changing settings dialog displays basic
+ This class can create dialogs for adding a new dictionary or changing settings
+ of an existing one, based on dialog type passed to contructor.
+ When adding a new dictionary dialog contains a button to browse file system and
+ select a dictionary file. When changing settings dialog displays basic
information about dictionary i. e. name, languages and license info.
- In both types of dialogs there are comboboxes with cache and remove accents
- options. On maemo right next to comboboxes are tool button which allow to
- see more information about this options, on desktop the same information is
- displayed as tool tip.
- All content of dialog is in scroll area.
+ In both types of dialogs there are comboboxes with "cache" and "remove accents"
+ options. On maemo right next to comboboxes are tool buttons which allow to
+ see more information about these options, on desktop the same information is
+ displayed as a tool tip.
+ All contents of a dialog are in a scroll area.
*/
class XdxfDialog : public QDialog
{
file system and select dictionary file. Change means that dialog displays
information about dictionary.
In both types dialog provides widgets to create or delete cache and remove
- or left accents.
+ or keep accents.
*/
enum XdxfDialogType {New, Change};
//! Constructor
/*!
Creates new xdxf dialog
- \param plugin if creating dialog of type Change it must be set to
- pointer of plugin whose settings will be changed
- \param type describes type of creating dialog
- \param parent parent widget of creating dialog
+ \param plugin if created dialog is of type Change it must be set to
+ point to plugin whose settings will be changed
+ \param type describes type of created dialog
+ \param parent parent widget of created dialog
*/
explicit XdxfDialog(XdxfPlugin* plugin = 0,
XdxfDialogType type = New,
QWidget* parent = 0);
- //! Returns settings of plugin
+ //! \returns settings of plugin
/*!
- After acceptance of dialog this method return plugin's settings based on
- user choises in dialog.
+ After acceptance of dialog this method returns plugin's settings based on
+ user's choices in dialog.
*/
Settings* getSettings();
Q_SIGNALS:
- //! Request to show notification
+ //! Requests to show notification
void notify(Notify::NotifyType, QString);
public Q_SLOTS:
- //! Reimplemented accept method, to check if all necessery fields in
+ //! Reimplemented accept method, to check if all necessary fields in
//! dialog are correct e. g. dictionary file path
//! and saves new settings
void accept();
return _lastDialogParent;
}
+void XdxfDictDialog::setLastDialogParent(QWidget *w) {
+ _lastDialogParent = w;
+}
+
Settings* XdxfDictDialog::addNewDictionary(QWidget *parent) {
XdxfDialog d(0, XdxfDialog::New, parent);
- _lastDialogParent = parent;
+ setLastDialogParent(parent);
connect(&d, SIGNAL(notify(Notify::NotifyType,QString)),
this, SIGNAL(notify(Notify::NotifyType,QString)));
void XdxfDictDialog::changeSettings(QWidget * parent) {
XdxfDialog d(plugin, XdxfDialog::Change, parent);
- _lastDialogParent = parent;
+ setLastDialogParent(parent);
connect(&d, SIGNAL(notify(Notify::NotifyType,QString)),
this, SIGNAL(notify(Notify::NotifyType,QString)));
public:
explicit XdxfDictDialog(XdxfPlugin* plugin, QObject *parent = 0);
/*!
- Shows "add new xdxf dictionary" dialog and returns settings of new dict
+ Shows "add new xdxf dictionary" dialog and returns settings of a new dict
\param parent parent widget on which dialog will be displayed
*/
Settings* addNewDictionary(QWidget *parent);
QWidget* lastDialogParent();
+ void setLastDialogParent(QWidget*);
+
private:
XdxfPlugin* plugin;
QWidget* _lastDialogParent;
CommonDictInterface* XdxfPlugin::getNew(const Settings *settings) const {
XdxfPlugin *plugin = new XdxfPlugin();
+ connect(plugin, SIGNAL(notify(Notify::NotifyType,QString)),
+ this, SIGNAL(notify(Notify::NotifyType,QString)));
+
+ ((XdxfDictDialog*)plugin->dictDialog())->setLastDialogParent(_dictDialog->lastDialogParent());
+
+
+
if(settings && plugin->setSettings(settings)) {
+
+ disconnect(plugin, SIGNAL(notify(Notify::NotifyType,QString)),
+ this, SIGNAL(notify(Notify::NotifyType,QString)));
return plugin;
}
else {
+ disconnect(plugin, SIGNAL(notify(Notify::NotifyType,QString)),
+ this, SIGNAL(notify(Notify::NotifyType,QString)));
delete plugin;
return 0;
}
XdxfCachingDialog d(_dictDialog->lastDialogParent());
+ qDebug()<<_dictDialog->lastDialogParent();
+
connect(&d, SIGNAL(cancelCaching()),
this, SLOT(stop()));
~XdxfPlugin();
- //! returns source language code iso 639-2
+ //! \returns source language code iso 639-2
QString langFrom() const;
- //! returns destination language code iso 639-2
+ //! \returns destination language code iso 639-2
QString langTo() const;
- //! returns dictionary name (like "old English" or so)
+ //! \returns dictionary name (like "old English" or so)
QString name() const;
- //! returns dictionary type (xdxf, google translate, etc)
+ //! \returns dictionary type (xdxf, google translate, etc)
QString type() const;
+<<<<<<< HEAD
//! returns information about dictionary in xml (name, authors, etc)
+=======
+ //! \returns information about dictionary in html (name, authors, etc)
+>>>>>>> master
QString infoNote() const;
- /*! returns DictDialog object that creates dialogs
- for adding new dictionary and changing plugin settings
+ /*! \returns DictDialog object that creates dialogs
+ for adding a new dictionary and changing plugin settings
*/
DictDialog* dictDialog();
- //! returns new, clean copy of plugin with settings set as in Settings*
+ //! \returns new, clean copy of plugin with settings set as in Settings*
CommonDictInterface* getNew(const Settings*) const;
- //! returns whether plugin can start searching
+ //! \returns whether plugin can start searching
bool isAvailable() const;
- //! returns a description of a word given by a QString
+ //! \returns a description of a word given by a QString
QString search(QString key);
- //! returns current plugin settings
+ //! \returns current plugin settings
Settings* settings();
- //! returns words count in a dictionary
+ //! \returns words count in a dictionary
long wordsCount();
//! Sets new settings
bool setSettings(const Settings*);
- //! returns plugin icon
+ //! \returns plugin icon
QIcon* icon();
/*! plugin should delete any files (eg. cache) that have been created and are ready
*/
QList<Translation*> searchWordList(QString word, int limit=0);
- //! stop current operation
+ //! stops current operation
void stop();
//! loads translations for each plugin only once
private:
- /*! returns true or false depending on whether the dictionary is cached
- or not, not implemented yet
+ /*! \returns true or false depending on whether the dictionary is cached
+ or not
*/
bool isCached();
/*! searches for a list of words similar to a word in a database file
QList<Translation*> searchWordListFile(QString word, int limit=0);
/*! searches for a translation of a word which is exactly like a key
- in xdxf file */
+ in a xdxf file */
QString searchFile(QString key);
/*! searches for a translation of a word which is exactly like a key
- in database file */
+ in a database file */
QString searchCache(QString key);
//! scans dictionary file to get information about it
bool getDictionaryInfo();
- //! counts the keys in xdxf file
+ //! counts the keys in a xdxf file
int countWords();
/*! transforms xdxf files to database files (caching operation)
QString _dictionaryInfo;
- //! icon displayed during translations and when the dictionary is chosen
+ //! icon displayed during translations and when a dictionary is chosen
QIcon _icon;
QSqlDatabase db;
QString db_name;