Merge branch 'master' into google
authorJakub Jaszczynski <j.j.jaszczynski@gmail.com>
Wed, 15 Sep 2010 08:44:12 +0000 (10:44 +0200)
committerJakub Jaszczynski <j.j.jaszczynski@gmail.com>
Wed, 15 Sep 2010 08:44:12 +0000 (10:44 +0200)
29 files changed:
data/css_meego/style.css
data/translations/pl_PL.qm
src/desktopWidget/en_US.ts [new file with mode: 0644]
src/desktopWidget/pl_PL.ts [new file with mode: 0644]
src/include/translation.h
src/mdictionary/backbone/BookmarkTranslations.h
src/mdictionary/backbone/Bookmarks.cpp
src/mdictionary/backbone/Bookmarks.h
src/mdictionary/backbone/backbone.cpp
src/mdictionary/en_US.ts [new file with mode: 0644]
src/mdictionary/gui/AboutWidget.cpp
src/mdictionary/gui/BookmarksWidget.cpp
src/mdictionary/gui/DictManagerWidget.cpp
src/mdictionary/gui/MainWindow.cpp
src/mdictionary/gui/SettingsWidget.cpp
src/mdictionary/gui/WordListWidget.cpp
src/mdictionary/gui/WordListWidget.h
src/mdictionary/gui/main.cpp
src/mdictionary/pl_PL.ts [new file with mode: 0644]
src/plugins/google/GoogleDialog.cpp
src/plugins/google/TranslationGoogle.h
src/plugins/google/en_US.ts [new file with mode: 0644]
src/plugins/google/pl_PL.ts [new file with mode: 0644]
src/plugins/xdxf/TranslationXdxf.h
src/plugins/xdxf/XdxfCachingDialog.cpp
src/plugins/xdxf/XdxfCachingDialog.h
src/plugins/xdxf/XdxfDialog.cpp
src/plugins/xdxf/en_US.ts [new file with mode: 0644]
src/plugins/xdxf/pl_PL.ts [new file with mode: 0644]

index d29502a..e103be1 100755 (executable)
@@ -23,12 +23,13 @@ div.tab {
        background-image        : url("images/people.png"); 
        background-repeat       : no-repeat;
        background-size : contain;
-       background-position     : center bottom;        
+       background-position     : right bottom; 
        display         : block;
        margin                  : 4px;
        margin-top              : 8px;
        padding         : 2px;
        padding-bottom  : 0px;
+        padding-right   : 0px;
        
         -webkit-box-reflect    : below 5px -webkit-gradient(linear, 0% 0%, 0% 120%, from(transparent), color-stop(0.3, transparent), to(white));
 }
index a65241a..82a44d9 100644 (file)
Binary files a/data/translations/pl_PL.qm and b/data/translations/pl_PL.qm differ
diff --git a/src/desktopWidget/en_US.ts b/src/desktopWidget/en_US.ts
new file mode 100644 (file)
index 0000000..6b7b3de
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+    <name>HomeWidget</name>
+    <message>
+        <location filename="MainWidget.cpp" line="60"/>
+        <source>Search</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+</TS>
diff --git a/src/desktopWidget/pl_PL.ts b/src/desktopWidget/pl_PL.ts
new file mode 100644 (file)
index 0000000..17a3bca
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="pl_PL">
+<context>
+    <name>HomeWidget</name>
+    <message>
+        <location filename="MainWidget.cpp" line="60"/>
+        <source>Search</source>
+        <translation type="unfinished">Szukaj</translation>
+    </message>
+</context>
+</TS>
index bfcf326..2d7407e 100644 (file)
@@ -55,7 +55,7 @@ class Translation {
     virtual QString toXml() const = 0;
 
     //! \return whether given translation is taken from bookmarks
-    virtual bool isBookmark() const {
+    virtual int isBookmark() const {
         return _bookmark;
    }
 
@@ -69,7 +69,7 @@ class Translation {
 
  protected:
  //! indicates whether this translation is in bookmark
-    bool _bookmark;
+    int _bookmark;
 
 };
 
index b5344c4..286a7af 100644 (file)
@@ -42,7 +42,7 @@ public:
         _key = key;
         _dictionaryInfo = dbName;
         _bookmarks = bookmarks;
-        _bookmark = 1;
+        _bookmark = 2;
     }
 
     //! \return word to be translated
index e046157..a2f55c8 100644 (file)
@@ -5,12 +5,11 @@
 Bookmarks::Bookmarks() {
     this->dbName = QDir::homePath() + "/.mdictionary/"
                  + "bookmarks.db";
-    checkAndCreateDb();
+    mdb = QSqlDatabase::addDatabase("QSQLITE");
+    mdb.setDatabaseName(dbName);
+    checkAndCreateDb(dbName);
     initAccents();
 
-    mdb = QSqlDatabase::addDatabase("QSQLITE",
-            QString("%2").arg((int)QThread::currentThreadId()));
-    mdb.setDatabaseName(dbName);
 }
 
 
@@ -19,23 +18,21 @@ Bookmarks::~Bookmarks() {
 }
 
 
-QSqlDatabase Bookmarks::getDbCnx(QString dbName) {
-    QSqlDatabase::removeDatabase(
-            QString("%2").arg((int)QThread::currentThreadId()));
-    QSqlDatabase db =QSqlDatabase::addDatabase("QSQLITE",
-            QString("%2").arg((int)QThread::currentThreadId()));
-    db.setDatabaseName(dbName);
-    return db;
+QSqlDatabase Bookmarks::getDbCnx(){
+    return mdb;
 }
 
 
 
-bool Bookmarks::checkAndCreateDb() {
-    QSqlDatabase db = getDbCnx(dbName);
+bool Bookmarks::checkAndCreateDb(QString dbName) {
+    QSqlDatabase db = QSqlDatabase::database();
+    if(dbName.size())
+        db.setDatabaseName(dbName);
+    else
+        db.setDatabaseName(this->dbName);
     db.open();
     QSqlQuery cur(db);
     cur.exec("create table bookmarks(key text, normalized text, translation text)");
-    db.close();
     return true;
 }
 
@@ -43,7 +40,7 @@ bool Bookmarks::checkAndCreateDb() {
 
 void Bookmarks::clear() {
     checkAndCreateDb();
-    QSqlDatabase db = getDbCnx(dbName);
+    QSqlDatabase db = getDbCnx();
     if(!db.isOpen() && !db.open()) {
         qDebug() << "Database error: " << db.lastError().text() << endl;
         return ;
@@ -51,14 +48,15 @@ void Bookmarks::clear() {
     QSqlQuery cur(db);
     cur.exec("drop table bookmarks");
     cur.exec("create table bookmarks(key text, normalized text,translation text)");
-    db.close();
 }
 
 
 
 void Bookmarks::add(Translation* translation) {
+    if (!translation)
+        return ;
     checkAndCreateDb();
-    QSqlDatabase db = getDbCnx(dbName);
+    QSqlDatabase db = getDbCnx();
     if(!db.isOpen() && !db.open()) {
         qDebug() << "Database error: " << db.lastError().text() << endl;
         return ;
@@ -70,13 +68,14 @@ void Bookmarks::add(Translation* translation) {
     cur.addBindValue(removeAccents(translation->key()));
     cur.addBindValue(translation->toXml());
     cur.exec();
-    db.close();
 }
 
 
 void Bookmarks::remove(Translation* translation) {
+    if (!translation)
+        return ;
     checkAndCreateDb();
-    QSqlDatabase db = getDbCnx(dbName);
+    QSqlDatabase db = getDbCnx();
     if(!db.isOpen() && !db.open()) {
         qDebug() << "Database error: " << db.lastError().text() << endl;
         return ;
@@ -85,7 +84,6 @@ void Bookmarks::remove(Translation* translation) {
     cur.prepare("delete from bookmarks where key=?");
     cur.addBindValue(translation->key());
     cur.exec();
-    db.close();
 }
 
 
@@ -93,7 +91,7 @@ void Bookmarks::remove(Translation* translation) {
 QList<Translation*> Bookmarks::list() {
     checkAndCreateDb();
     QList<Translation*> res;
-    QSqlDatabase db = getDbCnx(dbName);
+    QSqlDatabase db = getDbCnx();
     if(!db.isOpen() && !db.open()) {
         qDebug() << "Database error: " << db.lastError().text() << endl;
         return res;
@@ -103,7 +101,6 @@ QList<Translation*> Bookmarks::list() {
     while(cur.next())
         res.append(new BookmarkTranslation(cur.value(0).toString(),
                 this, dbName));
-    db.close();
     return res;
 }
 
@@ -117,7 +114,7 @@ QList<Translation*> Bookmarks::searchWordList(QString word) {
     word = word.replace("?", "_");
 
     QList<Translation*> tr;
-    QSqlDatabase db = getDbCnx(dbName);
+    QSqlDatabase db = getDbCnx();
     if(!db.isOpen() && !db.open()) {
         qDebug() << "Database error: " << db.lastError().text() << endl;
         return tr;
@@ -132,7 +129,6 @@ QList<Translation*> Bookmarks::searchWordList(QString word) {
         res.insert(cur.value(0).toString());
     foreach(QString str, res.toList())
         tr.append(new BookmarkTranslation(str, this, dbName));
-    db.close();
     return tr;
 }
 
@@ -140,7 +136,8 @@ QList<Translation*> Bookmarks::searchWordList(QString word) {
 
 QStringList Bookmarks::search(QString word, QString dbName) {
     QStringList result;
-    QSqlDatabase db = getDbCnx(dbName);
+    QSqlDatabase db = QSqlDatabase::database();
+    db.setDatabaseName(dbName);
     if(!db.isOpen() && !db.open()) {
         qDebug() << "Database error: " << db.lastError().text() << endl;
         return result;
@@ -152,7 +149,6 @@ QStringList Bookmarks::search(QString word, QString dbName) {
     while(cur.next())
         result << cur.value(0).toString();
 
-    db.close();
     return result;
 }
 
index 3172377..74e4721 100644 (file)
@@ -97,11 +97,11 @@ public:
     bool inBookmarks(QString word);
 
 private:
-    bool checkAndCreateDb();
+    bool checkAndCreateDb(QString dbName = "");
 
     
     QString dbName;
-    QSqlDatabase getDbCnx(QString dbName);
+    QSqlDatabase getDbCnx();
     QMap<QChar, QRegExp> letters;
     QRegExp noLetter;
     QSqlDatabase mdb;
index 689b9ba..c754c52 100644 (file)
@@ -138,6 +138,7 @@ Backbone::~Backbone()
     while(it2.hasNext())
         delete it2.next().value();
 
+    delete _history;
 }
 
 
diff --git a/src/mdictionary/en_US.ts b/src/mdictionary/en_US.ts
new file mode 100644 (file)
index 0000000..0a40fb3
--- /dev/null
@@ -0,0 +1,334 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+<context>
+    <name>AboutWidget</name>
+    <message>
+        <location filename="gui/AboutWidget.cpp" line="59"/>
+        <source>About</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>Backbone</name>
+    <message>
+        <location filename="backbone/backbone.cpp" line="217"/>
+        <source>You have to specify where You want to look for translations</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="backbone/backbone.cpp" line="328"/>
+        <source>%1 folder doesn&apos;t exist.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="backbone/backbone.cpp" line="351"/>
+        <source>%1 plugin cannot be loaded: %2.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="backbone/backbone.cpp" line="393"/>
+        <location filename="backbone/backbone.cpp" line="431"/>
+        <source>%1 configuration file doesn&apos;t exist.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="backbone/backbone.cpp" line="448"/>
+        <source>Configuration file error. %2 plugin doesn&apos;t exist.</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>BookmarksWidget</name>
+    <message>
+        <location filename="gui/BookmarksWidget.cpp" line="30"/>
+        <source>Bookmarks</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/BookmarksWidget.cpp" line="37"/>
+        <source>Show all bookmarks</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/BookmarksWidget.cpp" line="39"/>
+        <source>Remove all bookmarks</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>DictManagerWidget</name>
+    <message>
+        <location filename="gui/DictManagerWidget.cpp" line="34"/>
+        <source>Dictionaries</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/DictManagerWidget.cpp" line="52"/>
+        <source>Add</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/DictManagerWidget.cpp" line="53"/>
+        <source>Remove</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/DictManagerWidget.cpp" line="54"/>
+        <source>Settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/DictManagerWidget.cpp" line="93"/>
+        <location filename="gui/DictManagerWidget.cpp" line="153"/>
+        <location filename="gui/DictManagerWidget.cpp" line="179"/>
+        <location filename="gui/DictManagerWidget.cpp" line="225"/>
+        <source>Save</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/DictManagerWidget.cpp" line="154"/>
+        <location filename="gui/DictManagerWidget.cpp" line="179"/>
+        <location filename="gui/DictManagerWidget.cpp" line="225"/>
+        <source>Do you want to save changes?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/DictManagerWidget.cpp" line="210"/>
+        <source>Remove dictionary</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/DictManagerWidget.cpp" line="211"/>
+        <source>Do you want to remove selected dictionary?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>DictTypeSelectDialog</name>
+    <message>
+        <location filename="gui/DictTypeSelectDialog.cpp" line="30"/>
+        <source>Select dictionary type</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HistoryListDialog</name>
+    <message>
+        <location filename="gui/HistoryListDialog.cpp" line="35"/>
+        <location filename="gui/HistoryListDialog.cpp" line="52"/>
+        <source>History</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>MainWindow</name>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="126"/>
+        <source>Settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="127"/>
+        <source>Dictionaries</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="128"/>
+        <source>Bookmarks</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="129"/>
+        <source>About</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="136"/>
+        <source>&amp;Dictionaries</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="140"/>
+        <source>&amp;Settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="144"/>
+        <source>&amp;Bookmarks</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="145"/>
+        <source>Show all</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="147"/>
+        <source>Remove all</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="152"/>
+        <source>&amp;About</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="205"/>
+        <source>Can&apos;t find any matching words</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="228"/>
+        <source>Can&apos;t find exactly matching word</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="581"/>
+        <source>Delete all bookmarks</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="582"/>
+        <source>Do you want to delete all bookmarks? (This action cannot be revoked, and will clear current word list)</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>NotifyManager</name>
+    <message>
+        <location filename="gui/NotifyManager.cpp" line="102"/>
+        <source>Information</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/NotifyManager.cpp" line="113"/>
+        <source>Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/NotifyManager.cpp" line="123"/>
+        <source>Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>SearchBarWidget</name>
+    <message>
+        <location filename="gui/SearchBarWidget.cpp" line="131"/>
+        <location filename="gui/SearchBarWidget.cpp" line="304"/>
+        <source>Search</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/SearchBarWidget.cpp" line="296"/>
+        <source>Stop</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>SettingsWidget</name>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="33"/>
+        <source>Settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="50"/>
+        <source>Limits maximum number of words saved in history</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="70"/>
+        <source>Unlimited</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="72"/>
+        <source>Limits maximum number of found words, affects only when searching in file.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="90"/>
+        <source>Search result size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="92"/>
+        <source>History size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="101"/>
+        <source>Search in:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="103"/>
+        <source>Bookmarks</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="104"/>
+        <source>Dictionaries</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="140"/>
+        <location filename="gui/SettingsWidget.cpp" line="187"/>
+        <source>Save</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="188"/>
+        <source>Do you want to save changes?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>TranslationTextEdit</name>
+    <message>
+        <location filename="gui/TranslationTextEdit.cpp" line="33"/>
+        <source>Search</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/TranslationTextEdit.cpp" line="34"/>
+        <source>Copy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/TranslationTextEdit.cpp" line="35"/>
+        <source>Select All</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>TranslationWidget</name>
+    <message>
+        <location filename="gui/TranslationWidget.cpp" line="83"/>
+        <source>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/TranslationWidget.cpp" line="83"/>
+        <source>
+ &lt;ar&gt;</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/TranslationWidget.cpp" line="84"/>
+        <source>
+ &lt;/ar&gt;</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>WelcomeScreenWidget</name>
+    <message>
+        <location filename="gui/WelcomeScreenWidget.cpp" line="31"/>
+        <source>&lt;center&gt;&lt;h1&gt;Welcome in mDictionary!&lt;/h1&gt;&lt;/center&gt;</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+</TS>
index fe421eb..f287932 100644 (file)
@@ -26,6 +26,7 @@
 
 AboutWidget::AboutWidget(GUIInterface *parent): QDialog(parent)
 {
+    setModal(true);
     QString infoNote, licenseNote, comarchNote;
     infoNote = "<center><h2><u>mDictionary</u></h2></center>";
     comarchNote = "<center>Maemo/Meego Multilingual Dictionary</center>";
index 24ad0f0..58ede20 100644 (file)
@@ -29,6 +29,8 @@ BookmarksWidget::BookmarksWidget(GUIInterface *parent) :
 {
     setWindowTitle(tr("Bookmarks"));
 
+    setModal(true);
+
     verticalLayout = new QVBoxLayout(this);
     setLayout(verticalLayout);
 
index 6727484..4ea996c 100644 (file)
@@ -35,6 +35,8 @@ DictManagerWidget::DictManagerWidget(GUIInterface *parent) :
     this->guiInterface = parent;
 
     initalizeUI();
+
+    setModal(true);
 }
 
 void DictManagerWidget::initalizeUI() {
@@ -90,6 +92,11 @@ void DictManagerWidget::initalizeUI() {
         setMinimumSize(500,300);
         closeButton = new QPushButton(tr("Save"));
         buttonGroup->addWidget(closeButton);
+
+        setMinimumWidth(sizeHint().width()*1.2);
+        setMaximumWidth(sizeHint().width()*2);
+        setMinimumHeight(sizeHint().height());
+        setMaximumHeight(sizeHint().height()*2);
         connect(closeButton, SIGNAL(clicked()), this, SLOT(save()));
     #endif
 }
index f828473..4cade09 100644 (file)
@@ -47,13 +47,14 @@ MainWindow::MainWindow(Backbone *backbone, QWidget *parent):
 
     setExactSearch(false);
 
+    setMinimumSize(750, 400);
+
     showMaximized();
 
     searchBarWidget->setFocus();
 }
 
 MainWindow::~MainWindow() {
-
 }
 
 
@@ -111,8 +112,8 @@ void MainWindow::initializeSearchWidgets() {
         splitter->addWidget(welcomeScreenWidget);
         splitter->setStretchFactor(1, 150);
 
-        mainLayout->addWidget(splitter);
-        mainLayout->addWidget(searchBarWidget);
+        mainLayout->addWidget(splitter, 1);
+        mainLayout->addWidget(searchBarWidget, 0, Qt::AlignBottom);
     #endif
 }
 
@@ -132,15 +133,15 @@ void MainWindow::initializeMenu() {
     connect(menuWidget, SIGNAL(setApplicationMenu(QWidget*)),
             notifyManager, SLOT(setMenu(QWidget*)));
 #else
-    dictionariesAction = menuBar->addAction(tr("Dictionaries"));
+    dictionariesAction = menuBar->addAction(tr("&Dictionaries"));
     connect(dictionariesAction, SIGNAL(triggered()),
             dictManagerWidget, SLOT(show()));
 
-    settingsAction = menuBar->addAction(tr("Settings"));
+    settingsAction = menuBar->addAction(tr("&Settings"));
     connect(settingsAction, SIGNAL(triggered()),
             settingsWidget, SLOT(show()));
 
-    QMenu* m = menuBar->addMenu(tr("Bookmarks"));
+    QMenu* m = menuBar->addMenu(tr("&Bookmarks"));
     bookmarksShowAllAction = new QAction(tr("Show all"), m);
 
     bookmarksRemoveAllAction = new QAction(tr("Remove all"), m);
@@ -148,7 +149,7 @@ void MainWindow::initializeMenu() {
     m->addAction(bookmarksShowAllAction);
     m->addAction(bookmarksRemoveAllAction);
 
-    aboutAction = menuBar->addAction(tr("About"));
+    aboutAction = menuBar->addAction(tr("&About"));
     connect(aboutAction, SIGNAL(triggered()),
             aboutWidget, SLOT(show()));
 
@@ -451,6 +452,9 @@ void MainWindow::connectBackbone() {
 
     connect(backbone, SIGNAL(notify(Notify::NotifyType,QString)),
             this, SLOT(showNotification(Notify::NotifyType,QString)));
+
+    connect(backbone, SIGNAL(closeOk()),
+            this, SLOT(close()));
 }
 
 void MainWindow::connectSearchBar() {
index 6a66817..7b7173e 100644 (file)
 #include <QDebug>
 
 SettingsWidget::SettingsWidget(GUIInterface *parent) :
-    QDialog(parent)
+        QDialog(parent)
 {
     guiInterface = parent;
 
     setWindowTitle(tr("Settings"));
 
     initalizeUI();
+
+    setModal(true);
 }
 
 void SettingsWidget::initalizeUI() {
@@ -139,6 +141,9 @@ void SettingsWidget::initalizeUI() {
         footerLayout->addStretch(0);
         footerLayout->addWidget(closeButton);
         verticalLayout->addLayout(footerLayout);
+
+        setMinimumHeight(sizeHint().height());
+        setMaximumHeight(sizeHint().height());
         connect(closeButton, SIGNAL(clicked()), this, SLOT(save()));
     #endif
 }
index e44a839..2ac5d1e 100644 (file)
@@ -26,6 +26,7 @@
 #include "WordListWidget.h"
 #include "WordListProxyStyle.h"
 #include "../../include/translation.h"
+#include <QKeyEvent>
 
 
 WordListWidget::WordListWidget(QWidget *parent):
@@ -107,6 +108,8 @@ void WordListWidget::showSearchResults(
 
     model->sort(0);
     resizeColumns();    
+
+    setFocus();
 }
 
 void WordListWidget::wordClicked(QModelIndex index) {
@@ -136,6 +139,24 @@ void WordListWidget::wordChecked(QModelIndex index) {
     }
     else {
         Q_EMIT removeBookmark(searchResult[item.data().toString()]);
+
+        Translation* t;
+        bool onlyBookmarks = true;
+        foreach(t, searchResult[item.data().toString()]) {
+            if(t->isBookmark() == 1 || t->isBookmark()==0) {
+
+                onlyBookmarks = false;
+                t->setBookmark(0);
+            }
+            else {
+                searchResult[item.data().toString()].removeAt(searchResult[item.data().toString()].indexOf(t));
+            }
+        }
+
+        if(onlyBookmarks) {
+            searchResult.remove(item.data().toString());
+            model->removeRow(item.row());
+        }
     }
 }
 
@@ -177,6 +198,16 @@ void WordListWidget::resizeColumns() {
     setColumnWidth(1, checkBoxWidth);
 }
 
+void WordListWidget::keyPressEvent(QKeyEvent *event) {
+    QTreeView::keyPressEvent(event);
+
+    if(event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) {
+        if(selectedIndexes().count() == 0) return;
+
+        wordClicked(selectedIndexes().at(0));
+    }
+}
+
 void WordListWidget::lockList() {
     setEnabled(false);
 }
index 7b26e51..8a0b17c 100644 (file)
@@ -82,7 +82,8 @@ protected:
     //! side next to scroll bar
     void resizeEvent(QResizeEvent *event);
 
-
+    //! Checks if user press return and if so displays translation of selected word
+    void keyPressEvent( QKeyEvent * event);
 
 private Q_SLOTS:
     //! Emits signal to show translation of clicked item. Signal is emitted
index 69be667..ab77e42 100644 (file)
@@ -87,23 +87,30 @@ int main(int argc, char *argv[]) {
 
     retranslate();
 
-    Backbone backbone;
-    MainWindow w(&backbone);
+    Backbone* backbone = new Backbone();
+    MainWindow* mainWindow = new MainWindow(backbone);
 
-    DBusAdapter* adapter = new DBusAdapter(&w);
+    DBusAdapter* adapter = new DBusAdapter(mainWindow);
 
     QDBusConnection::sessionBus().registerObject("/mainWindow",
-                                                 &w);
+                                                 mainWindow);
     QDBusConnection::sessionBus().registerService("com.comarch.mdictionary");
 
-
-    w.show();
-
+    mainWindow->show();
 
     if(search.count() > 0) {
-        w.setExactSearch(true);
-        w.searchExact(search[0]);
+        mainWindow->setExactSearch(true);
+        mainWindow->searchExact(search[0]);
     }
 
-    return a.exec();
+    int res = a.exec();
+
+    QDBusConnection::sessionBus().unregisterObject("/mainWindow");
+    QDBusConnection::sessionBus().unregisterService("com.comarch.mdictionary");
+
+    delete adapter;
+    delete mainWindow;
+    delete backbone;
+
+    return res;
 }
diff --git a/src/mdictionary/pl_PL.ts b/src/mdictionary/pl_PL.ts
new file mode 100644 (file)
index 0000000..8cf399d
--- /dev/null
@@ -0,0 +1,335 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="pl_PL">
+<context>
+    <name>AboutWidget</name>
+    <message>
+        <location filename="gui/AboutWidget.cpp" line="59"/>
+        <source>About</source>
+        <translation>O programie</translation>
+    </message>
+</context>
+<context>
+    <name>Backbone</name>
+    <message>
+        <location filename="backbone/backbone.cpp" line="217"/>
+        <source>You have to specify where You want to look for translations</source>
+        <translation>Musisz określić gdzie chcesz szukać tłumaczeń</translation>
+    </message>
+    <message>
+        <location filename="backbone/backbone.cpp" line="328"/>
+        <source>%1 folder doesn&apos;t exist.</source>
+        <translation>Folder %1 nie istnieje.</translation>
+    </message>
+    <message>
+        <location filename="backbone/backbone.cpp" line="351"/>
+        <source>%1 plugin cannot be loaded: %2.</source>
+        <translation>Nie można załadować pluginu %1: %2.</translation>
+    </message>
+    <message>
+        <location filename="backbone/backbone.cpp" line="393"/>
+        <location filename="backbone/backbone.cpp" line="431"/>
+        <source>%1 configuration file doesn&apos;t exist.</source>
+        <translation>Plik konfiguracyjny %1 nie istnieje.</translation>
+    </message>
+    <message>
+        <location filename="backbone/backbone.cpp" line="448"/>
+        <source>Configuration file error. %2 plugin doesn&apos;t exist.</source>
+        <translation>Błąd pliku konfiguracyjnego. Plugin %2 nie istnieje.</translation>
+    </message>
+</context>
+<context>
+    <name>BookmarksWidget</name>
+    <message>
+        <location filename="gui/BookmarksWidget.cpp" line="30"/>
+        <source>Bookmarks</source>
+        <translation>Zakładki</translation>
+    </message>
+    <message>
+        <location filename="gui/BookmarksWidget.cpp" line="37"/>
+        <source>Show all bookmarks</source>
+        <translation>Pokaż wszystkie zakładki</translation>
+    </message>
+    <message>
+        <location filename="gui/BookmarksWidget.cpp" line="39"/>
+        <source>Remove all bookmarks</source>
+        <translation>Usuń wszystkie zakładki</translation>
+    </message>
+</context>
+<context>
+    <name>DictManagerWidget</name>
+    <message>
+        <location filename="gui/DictManagerWidget.cpp" line="34"/>
+        <source>Dictionaries</source>
+        <translation>Słowniki</translation>
+    </message>
+    <message>
+        <location filename="gui/DictManagerWidget.cpp" line="52"/>
+        <source>Add</source>
+        <translation>Dodaj</translation>
+    </message>
+    <message>
+        <location filename="gui/DictManagerWidget.cpp" line="53"/>
+        <source>Remove</source>
+        <translation>Usuń</translation>
+    </message>
+    <message>
+        <location filename="gui/DictManagerWidget.cpp" line="54"/>
+        <source>Settings</source>
+        <translation>Ustawienia</translation>
+    </message>
+    <message>
+        <location filename="gui/DictManagerWidget.cpp" line="93"/>
+        <location filename="gui/DictManagerWidget.cpp" line="153"/>
+        <location filename="gui/DictManagerWidget.cpp" line="179"/>
+        <location filename="gui/DictManagerWidget.cpp" line="225"/>
+        <source>Save</source>
+        <translation>Zapisz</translation>
+    </message>
+    <message>
+        <location filename="gui/DictManagerWidget.cpp" line="154"/>
+        <location filename="gui/DictManagerWidget.cpp" line="179"/>
+        <location filename="gui/DictManagerWidget.cpp" line="225"/>
+        <source>Do you want to save changes?</source>
+        <translation>Czy chcesz zapisać zmiany?</translation>
+    </message>
+    <message>
+        <location filename="gui/DictManagerWidget.cpp" line="210"/>
+        <source>Remove dictionary</source>
+        <translation>Usuń słownik</translation>
+    </message>
+    <message>
+        <location filename="gui/DictManagerWidget.cpp" line="211"/>
+        <source>Do you want to remove selected dictionary?</source>
+        <translation>Czy chcesz usunąć wybrany słownik?</translation>
+    </message>
+</context>
+<context>
+    <name>DictTypeSelectDialog</name>
+    <message>
+        <location filename="gui/DictTypeSelectDialog.cpp" line="30"/>
+        <source>Select dictionary type</source>
+        <translation>Wybierz typ słownika</translation>
+    </message>
+</context>
+<context>
+    <name>HistoryListDialog</name>
+    <message>
+        <location filename="gui/HistoryListDialog.cpp" line="35"/>
+        <location filename="gui/HistoryListDialog.cpp" line="52"/>
+        <source>History</source>
+        <translation>Historia</translation>
+    </message>
+</context>
+<context>
+    <name>MainWindow</name>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="126"/>
+        <source>Settings</source>
+        <translation>Ustawienia</translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="127"/>
+        <source>Dictionaries</source>
+        <translation>Słowniki</translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="128"/>
+        <source>Bookmarks</source>
+        <translation>Zakładki</translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="129"/>
+        <source>About</source>
+        <translation>O programie</translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="136"/>
+        <source>&amp;Dictionaries</source>
+        <translation>&amp;Słowniki</translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="140"/>
+        <source>&amp;Settings</source>
+        <translation>&amp;Ustawienia</translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="144"/>
+        <source>&amp;Bookmarks</source>
+        <translation>&amp;Zakładki</translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="145"/>
+        <source>Show all</source>
+        <translation>Pokaż wszystkie</translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="147"/>
+        <source>Remove all</source>
+        <translation>Usuń wszystkie</translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="152"/>
+        <source>&amp;About</source>
+        <translation>&amp;O Programie</translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="205"/>
+        <source>Can&apos;t find any matching words</source>
+        <translation>Nie znaleziono pasujących słów</translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="228"/>
+        <source>Can&apos;t find exactly matching word</source>
+        <translation>Nie znaleziono dokładnego dopasowania</translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="581"/>
+        <source>Delete all bookmarks</source>
+        <translation>Usuń wszystkie zakładki</translation>
+    </message>
+    <message>
+        <location filename="gui/MainWindow.cpp" line="582"/>
+        <source>Do you want to delete all bookmarks? (This action cannot be revoked, and will clear current word list)</source>
+        <translation>Czy chcesz usunąć wszystkie zakładki? (Ta akcja nie będzie mogła być cofnięta i wyczyści bieżącą listę słów)</translation>
+    </message>
+</context>
+<context>
+    <name>NotifyManager</name>
+    <message>
+        <location filename="gui/NotifyManager.cpp" line="102"/>
+        <source>Information</source>
+        <translation>Informacja</translation>
+    </message>
+    <message>
+        <location filename="gui/NotifyManager.cpp" line="113"/>
+        <source>Warning</source>
+        <translation>Ostrzeżenie</translation>
+    </message>
+    <message>
+        <location filename="gui/NotifyManager.cpp" line="123"/>
+        <source>Error</source>
+        <translation>Błąd</translation>
+    </message>
+</context>
+<context>
+    <name>SearchBarWidget</name>
+    <message>
+        <location filename="gui/SearchBarWidget.cpp" line="131"/>
+        <location filename="gui/SearchBarWidget.cpp" line="304"/>
+        <source>Search</source>
+        <translation>Szukaj</translation>
+    </message>
+    <message>
+        <location filename="gui/SearchBarWidget.cpp" line="296"/>
+        <source>Stop</source>
+        <translation>Zatrzymaj</translation>
+    </message>
+</context>
+<context>
+    <name>SettingsWidget</name>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="33"/>
+        <source>Settings</source>
+        <translation>Ustawienia</translation>
+    </message>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="50"/>
+        <source>Limits maximum number of words saved in history</source>
+        <translation>Ogranicza maksymalną liczbę słów zapisanych w historii</translation>
+    </message>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="70"/>
+        <source>Unlimited</source>
+        <translation>Nieograniczony</translation>
+    </message>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="72"/>
+        <source>Limits maximum number of found words, affects only when searching in file.</source>
+        <translation>Ogranicza maksymalną liczbę znalezionych słów, działa tylko przy wyszukiwaniu w pliku.</translation>
+    </message>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="90"/>
+        <source>Search result size</source>
+        <translation>Liczba wyników
+wyszukiwania</translation>
+    </message>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="92"/>
+        <source>History size</source>
+        <translation>Rozmiar historii</translation>
+    </message>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="101"/>
+        <source>Search in:</source>
+        <translation>Szukaj w:</translation>
+    </message>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="103"/>
+        <source>Bookmarks</source>
+        <translation>Zakładkach</translation>
+    </message>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="104"/>
+        <source>Dictionaries</source>
+        <translation>Słownikach</translation>
+    </message>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="140"/>
+        <location filename="gui/SettingsWidget.cpp" line="187"/>
+        <source>Save</source>
+        <translation>Zapisz</translation>
+    </message>
+    <message>
+        <location filename="gui/SettingsWidget.cpp" line="188"/>
+        <source>Do you want to save changes?</source>
+        <translation>Czy chcesz zapisać zmiany?</translation>
+    </message>
+</context>
+<context>
+    <name>TranslationTextEdit</name>
+    <message>
+        <location filename="gui/TranslationTextEdit.cpp" line="33"/>
+        <source>Search</source>
+        <translation>Szukaj</translation>
+    </message>
+    <message>
+        <location filename="gui/TranslationTextEdit.cpp" line="34"/>
+        <source>Copy</source>
+        <translation>Kopiuj</translation>
+    </message>
+    <message>
+        <location filename="gui/TranslationTextEdit.cpp" line="35"/>
+        <source>Select All</source>
+        <translation>Wybierz wszystkie</translation>
+    </message>
+</context>
+<context>
+    <name>TranslationWidget</name>
+    <message>
+        <location filename="gui/TranslationWidget.cpp" line="83"/>
+        <source>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/TranslationWidget.cpp" line="83"/>
+        <source>
+ &lt;ar&gt;</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="gui/TranslationWidget.cpp" line="84"/>
+        <source>
+ &lt;/ar&gt;</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>WelcomeScreenWidget</name>
+    <message>
+        <location filename="gui/WelcomeScreenWidget.cpp" line="31"/>
+        <source>&lt;center&gt;&lt;h1&gt;Welcome in mDictionary!&lt;/h1&gt;&lt;/center&gt;</source>
+        <translation>&lt;center&gt;&lt;h1&gt;Witamy w mDictionary!&lt;/h1&gt;&lt;/center&gt;</translation>
+    </message>
+</context>
+</TS>
index 75e4368..16d931f 100644 (file)
@@ -148,6 +148,9 @@ void GoogleDialog::initializeUI() {
     verticalLayout->addWidget(confirmButton);
 
     setModal(true);
+
+    setMinimumSize(sizeHint());
+    setMaximumSize(sizeHint());
 }
 
 void GoogleDialog::langFromChanged(int index) {
index 3004cbf..5ce1f76 100644 (file)
@@ -53,7 +53,7 @@ public:
     void setDictionaryInfo(QString);
 
     //! \return whether given translation is taken from bookmarks
-    bool isBookmark() const {
+    int isBookmark() const {
         return _bookmark;
    }
 
diff --git a/src/plugins/google/en_US.ts b/src/plugins/google/en_US.ts
new file mode 100644 (file)
index 0000000..834a994
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+<context>
+    <name>GoogleDialog</name>
+    <message>
+        <location filename="GoogleDialog.cpp" line="67"/>
+        <source>Google Plugin Settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="GoogleDialog.cpp" line="69"/>
+        <source>From:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="GoogleDialog.cpp" line="70"/>
+        <location filename="GoogleDialog.cpp" line="93"/>
+        <source>To: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="GoogleDialog.cpp" line="91"/>
+        <source>Plugin: GoogleTranslator 
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="GoogleDialog.cpp" line="92"/>
+        <source>From: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="GoogleDialog.cpp" line="98"/>
+        <source>Google plugin makes use of Internet connection, so it may cost You.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="GoogleDialog.cpp" line="138"/>
+        <source>Add</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="GoogleDialog.cpp" line="141"/>
+        <source>Save settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>GooglePlugin</name>
+    <message>
+        <location filename="GooglePlugin.cpp" line="197"/>
+        <source>GooglePlugin: %1</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="GooglePlugin.cpp" line="270"/>
+        <source>GooglePlugin: can&apos;t parse Json</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+</TS>
diff --git a/src/plugins/google/pl_PL.ts b/src/plugins/google/pl_PL.ts
new file mode 100644 (file)
index 0000000..9f804c2
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="pl_PL">
+<context>
+    <name>GoogleDialog</name>
+    <message>
+        <location filename="GoogleDialog.cpp" line="67"/>
+        <source>Google Plugin Settings</source>
+        <translation>Ustawienia Google</translation>
+    </message>
+    <message>
+        <location filename="GoogleDialog.cpp" line="69"/>
+        <source>From:</source>
+        <translation>Z:</translation>
+    </message>
+    <message>
+        <location filename="GoogleDialog.cpp" line="70"/>
+        <location filename="GoogleDialog.cpp" line="93"/>
+        <source>To: </source>
+        <translation>Na: </translation>
+    </message>
+    <message>
+        <location filename="GoogleDialog.cpp" line="91"/>
+        <source>Plugin: GoogleTranslator 
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="GoogleDialog.cpp" line="92"/>
+        <source>From: </source>
+        <translation>Z: </translation>
+    </message>
+    <message>
+        <location filename="GoogleDialog.cpp" line="98"/>
+        <source>Google plugin makes use of Internet connection, so it may cost You.</source>
+        <translation>Plugin Google korzysta z połączenia z Internetem, może ono być płatne.</translation>
+    </message>
+    <message>
+        <location filename="GoogleDialog.cpp" line="138"/>
+        <source>Add</source>
+        <translation>Dodaj</translation>
+    </message>
+    <message>
+        <location filename="GoogleDialog.cpp" line="141"/>
+        <source>Save settings</source>
+        <translation>Zapisz ustawienia</translation>
+    </message>
+</context>
+<context>
+    <name>GooglePlugin</name>
+    <message>
+        <location filename="GooglePlugin.cpp" line="197"/>
+        <source>GooglePlugin: %1</source>
+        <translation>Plugin Google: %1</translation>
+    </message>
+    <message>
+        <location filename="GooglePlugin.cpp" line="270"/>
+        <source>GooglePlugin: can&apos;t parse Json</source>
+        <translation>Plugin Google: błąd parsowania Json</translation>
+    </message>
+</context>
+</TS>
index 518faa5..e438bbc 100644 (file)
@@ -49,7 +49,7 @@ public:
     void setDictionaryInfo(QString);
 
     //! \return whether given translation is taken from bookmarks
-    bool isBookmark() const {
+    int isBookmark() const {
         return _bookmark;
    }
 
index 29a8d18..d26e1b5 100644 (file)
@@ -41,11 +41,17 @@ XdxfCachingDialog::XdxfCachingDialog(QWidget *parent): QDialog(parent) {
     cancelButton = new QPushButton(tr("Cancel"),this);
 
 
-    cachingLabel = new QLabel(this);
-    cachingLabel->hide();
+    cachingTimeLabel = new QLabel(this);
+    cachingTimeLabel->hide();
 
+    #ifndef Q_WS_MAEMO_5
+            cachingLabel = new QLabel(this);
+            cachingLabel->setText(tr("Caching dictionary, please wait"));
+            verticalLayout->addWidget(cachingLabel, 0, Qt::AlignCenter);
+    #endif
 
-    verticalLayout->addWidget(cachingLabel);
+
+    verticalLayout->addWidget(cachingTimeLabel);
     verticalLayout->addWidget(cachingProgressBar);
     verticalLayout->addWidget(cancelButton);
 
@@ -65,12 +71,12 @@ void XdxfCachingDialog::reject() {
 void XdxfCachingDialog::updateCachingProgress(int progress, int time) {
     cachingProgressBar->setValue(progress);
 
-    if(!cachingLabel->isVisible())
-        cachingLabel->show();
+    if(!cachingTimeLabel->isVisible())
+        cachingTimeLabel->show();
 
     int seconds = float((100 - progress)*time) / (5*1000);
 
-    cachingLabel->setText(tr("Estimated time left: ") +
+    cachingTimeLabel->setText(tr("Estimated time left: ") +
                           tr("%n second(s)", "", seconds));
     if(progress >= 100)
         this->accept();
index 5632bd9..1e42a0b 100644 (file)
@@ -55,6 +55,7 @@ private Q_SLOTS:
 
 private:
     QLabel* cachingLabel;
+    QLabel* cachingTimeLabel;
     QProgressBar* cachingProgressBar;
     QPushButton* cancelButton;
     QVBoxLayout* verticalLayout;
index 90fc21e..cbacdd5 100644 (file)
@@ -175,7 +175,10 @@ void XdxfDialog::initializeUI() {
 
     scrollArea->setLineWidth(0);
     scrollArea->setMidLineWidth(0);
-    scrollArea->setFrameStyle(QFrame::NoFrame);;
+    scrollArea->setFrameStyle(QFrame::NoFrame);
+
+    setMinimumSize(sizeHint().width()*1.2, sizeHint().height());
+    setMaximumSize(sizeHint().width()*2, sizeHint().height()*2);
 }
 
 
diff --git a/src/plugins/xdxf/en_US.ts b/src/plugins/xdxf/en_US.ts
new file mode 100644 (file)
index 0000000..2eb225e
--- /dev/null
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+<context>
+    <name>XdxfCachingDialog</name>
+    <message>
+        <location filename="XdxfCachingDialog.cpp" line="35"/>
+        <source>Caching dictionary, please wait</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="XdxfCachingDialog.cpp" line="41"/>
+        <source>Cancel</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="XdxfCachingDialog.cpp" line="73"/>
+        <source>Estimated time left: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <location filename="XdxfCachingDialog.cpp" line="74"/>
+        <source>%n second(s)</source>
+        <translation>
+            <numerusform>%n second</numerusform>
+            <numerusform>%n seconds</numerusform>
+        </translation>
+    </message>
+</context>
+<context>
+    <name>XdxfDialog</name>
+    <message>
+        <location filename="XdxfDialog.cpp" line="35"/>
+        <source>Optimize for quicker searches (may take some time)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="36"/>
+        <source>Strip accents (searching takes more time, but spelling doesn&apos;t have to be exact)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="74"/>
+        <source>Add new XDXF dictionary</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="77"/>
+        <source>Browse</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="78"/>
+        <source>Dictionary file: not selected</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="86"/>
+        <source>XDXF Settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="88"/>
+        <source>Plugin: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="89"/>
+        <source>From: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="90"/>
+        <source>To: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="91"/>
+        <source>Description: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="97"/>
+        <source>Strip accents</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="107"/>
+        <source>Optimize</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="153"/>
+        <source>Add</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="156"/>
+        <source>Save settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="201"/>
+        <source>Select dictionary file</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="203"/>
+        <source>XDXF Files (*.xdxf)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="208"/>
+        <source>Dictionary file: %1</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="236"/>
+        <source>File path is not set</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>XdxfPlugin</name>
+    <message>
+        <location filename="xdxfplugin.cpp" line="109"/>
+        <location filename="xdxfplugin.cpp" line="226"/>
+        <location filename="xdxfplugin.cpp" line="525"/>
+        <source>Cache database cannot be opened for %1 dictionary. Searching in XDXF file. You may want to recache.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="xdxfplugin.cpp" line="169"/>
+        <location filename="xdxfplugin.cpp" line="257"/>
+        <source>XDXF file cannot be read for %1</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="xdxfplugin.cpp" line="372"/>
+        <source>XDXF file is in wrong format</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="xdxfplugin.cpp" line="414"/>
+        <source>XDXF dictionary cannot be read from file</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="xdxfplugin.cpp" line="458"/>
+        <location filename="xdxfplugin.cpp" line="516"/>
+        <source>XDXF file cannot be read for %1 dictionary</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="xdxfplugin.cpp" line="607"/>
+        <source>Database caching error, please try again.</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+</TS>
diff --git a/src/plugins/xdxf/pl_PL.ts b/src/plugins/xdxf/pl_PL.ts
new file mode 100644 (file)
index 0000000..4650232
--- /dev/null
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="pl_PL">
+<context>
+    <name>XdxfCachingDialog</name>
+    <message>
+        <location filename="XdxfCachingDialog.cpp" line="35"/>
+        <source>Caching dictionary, please wait</source>
+        <translation>Optymalizacja słownika, proszę czekać</translation>
+    </message>
+    <message>
+        <location filename="XdxfCachingDialog.cpp" line="41"/>
+        <source>Cancel</source>
+        <translation>Anuluj</translation>
+    </message>
+    <message>
+        <location filename="XdxfCachingDialog.cpp" line="73"/>
+        <source>Estimated time left: </source>
+        <translation>Pozostały czas: </translation>
+    </message>
+    <message numerus="yes">
+        <location filename="XdxfCachingDialog.cpp" line="74"/>
+        <source>%n second(s)</source>
+        <translation>
+            <numerusform>%n sekunda</numerusform>
+            <numerusform>%n sekundy</numerusform>
+            <numerusform>%n sekund</numerusform>
+        </translation>
+    </message>
+</context>
+<context>
+    <name>XdxfDialog</name>
+    <message>
+        <location filename="XdxfDialog.cpp" line="35"/>
+        <source>Optimize for quicker searches (may take some time)</source>
+        <translation>Optymalizuj dla szybszego wyszukiwania (może zająć trochę czasu)</translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="36"/>
+        <source>Strip accents (searching takes more time, but spelling doesn&apos;t have to be exact)</source>
+        <translation>Usuń akcenty (wyszukiwanie trwa dłużej, ale szukane słowo nie musi być wpisane dokładnie)</translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="74"/>
+        <source>Add new XDXF dictionary</source>
+        <translation>Dodaj nowy słownik XDXF</translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="77"/>
+        <source>Browse</source>
+        <translation>Przeglądaj</translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="78"/>
+        <source>Dictionary file: not selected</source>
+        <translation>Plik ze słownikiem nie został wybrany</translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="86"/>
+        <source>XDXF Settings</source>
+        <translation>Ustawienia XDXF</translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="88"/>
+        <source>Plugin: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="89"/>
+        <source>From: </source>
+        <translation>Z: </translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="90"/>
+        <source>To: </source>
+        <translation>Na: </translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="91"/>
+        <source>Description: </source>
+        <translation>Opis: </translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="97"/>
+        <source>Strip accents</source>
+        <translation>Usuń akcenty</translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="107"/>
+        <source>Optimize</source>
+        <translation>Optymalizuj</translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="153"/>
+        <source>Add</source>
+        <translation>Dodaj</translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="156"/>
+        <source>Save settings</source>
+        <translation>Zapisz ustawienia</translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="201"/>
+        <source>Select dictionary file</source>
+        <translation>Wybierz plik ze słownikiem</translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="203"/>
+        <source>XDXF Files (*.xdxf)</source>
+        <translation>Pliki XDXF (*.xdxf)</translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="208"/>
+        <source>Dictionary file: %1</source>
+        <translation>Plik ze słownikiem: %1</translation>
+    </message>
+    <message>
+        <location filename="XdxfDialog.cpp" line="236"/>
+        <source>File path is not set</source>
+        <translation>Ścieżka do pliku nie jest ustawiona</translation>
+    </message>
+</context>
+<context>
+    <name>XdxfPlugin</name>
+    <message>
+        <location filename="xdxfplugin.cpp" line="109"/>
+        <location filename="xdxfplugin.cpp" line="226"/>
+        <location filename="xdxfplugin.cpp" line="525"/>
+        <source>Cache database cannot be opened for %1 dictionary. Searching in XDXF file. You may want to recache.</source>
+        <translation>Nie można otworzyć bazy danych dla słownika %1. Szukanie w pliku XDXF. Możesz spróbować ponownie włączyć optymalizację.</translation>
+    </message>
+    <message>
+        <location filename="xdxfplugin.cpp" line="169"/>
+        <location filename="xdxfplugin.cpp" line="257"/>
+        <source>XDXF file cannot be read for %1</source>
+        <translation>Nie można odczytać pliku XDXF dla %1</translation>
+    </message>
+    <message>
+        <location filename="xdxfplugin.cpp" line="372"/>
+        <source>XDXF file is in wrong format</source>
+        <translation>Niewłaściwy format pliku XDXF</translation>
+    </message>
+    <message>
+        <location filename="xdxfplugin.cpp" line="414"/>
+        <source>XDXF dictionary cannot be read from file</source>
+        <translation>Nie można odczytać słownika XDXF z pliku</translation>
+    </message>
+    <message>
+        <location filename="xdxfplugin.cpp" line="458"/>
+        <location filename="xdxfplugin.cpp" line="516"/>
+        <source>XDXF file cannot be read for %1 dictionary</source>
+        <translation>Nie mozna odczytać pliku XDXF dla słownika %1</translation>
+    </message>
+    <message>
+        <location filename="xdxfplugin.cpp" line="607"/>
+        <source>Database caching error, please try again.</source>
+        <translation>Błąd optymalizacji, proszę spróbować ponownie.</translation>
+    </message>
+</context>
+</TS>