From 3a474ba21f9ee414f14ba783e038c01ff9cd0c6c Mon Sep 17 00:00:00 2001 From: Jakub Jaszczynski Date: Fri, 3 Sep 2010 13:48:52 +0200 Subject: [PATCH] plugins icon in translation --- data/xsl/style.css | 2 +- data/xsl/xsl.xsl | 3 ++- src/mdictionary/backbone/Bookmarks.cpp | 23 +++++++++++++++-------- src/mdictionary/gui/MainWindow.cpp | 2 +- src/mdictionary/gui/TranslationWidget.cpp | 3 ++- src/plugins/google/GooglePlugin.cpp | 2 +- src/plugins/google/TranslationGoogle.cpp | 4 ++-- src/plugins/google/google.pro | 8 ++++++++ src/plugins/xdxf/xdxf.pro | 5 ++++- src/plugins/xdxf/xdxfplugin.cpp | 10 +++------- 10 files changed, 39 insertions(+), 23 deletions(-) diff --git a/data/xsl/style.css b/data/xsl/style.css index c8490f2..400f414 100644 --- a/data/xsl/style.css +++ b/data/xsl/style.css @@ -1,5 +1,5 @@ th.info { - background-color : #99FF99; + background-color : #99FF99; } th.key { diff --git a/data/xsl/xsl.xsl b/data/xsl/xsl.xsl index 96770eb..bdd79ce 100644 --- a/data/xsl/xsl.xsl +++ b/data/xsl/xsl.xsl @@ -10,12 +10,13 @@ + - + diff --git a/src/mdictionary/backbone/Bookmarks.cpp b/src/mdictionary/backbone/Bookmarks.cpp index c39f868..2df2de7 100644 --- a/src/mdictionary/backbone/Bookmarks.cpp +++ b/src/mdictionary/backbone/Bookmarks.cpp @@ -43,9 +43,10 @@ bool Bookmarks::checkAndCreateDb() { void Bookmarks::clear() { checkAndCreateDb(); + qDebug()<<"dename1"<setBookmark(true); @@ -75,10 +77,11 @@ void Bookmarks::add(Translation* translation) { void Bookmarks::remove(Translation* translation) { + qDebug()<<"dename3"< Bookmarks::list() { + qDebug()<<"dename4"< res; QSqlDatabase db = getDbCnx(dbName); if(!db.isOpen() && !db.open()) { - qDebug() << "Database error: " << db.lastError().text() << endl; + qDebug() << "Database error4: " << db.lastError().text() << endl; return res; } QSqlQuery cur(db); @@ -110,6 +114,7 @@ QList Bookmarks::list() { QList Bookmarks::searchWordList(QString word) { + qDebug()<<"dename5"< Bookmarks::searchWordList(QString word) { QList tr; QSqlDatabase db = getDbCnx(dbName); if(!db.isOpen() && !db.open()) { - qDebug() << "Database error: " << db.lastError().text() << endl; + qDebug() << "Database error5: " << db.lastError().text() << endl; return tr; } QSqlQuery cur(db); @@ -139,11 +144,12 @@ QList Bookmarks::searchWordList(QString word) { QStringList Bookmarks::search(QString word, QString dbName) { - //checkAndCreateDb(); + checkAndCreateDb(); + qDebug()<<"dename6"<removeAllBookmarks(); if(searchString.size()) backbone->search(searchString); diff --git a/src/mdictionary/gui/TranslationWidget.cpp b/src/mdictionary/gui/TranslationWidget.cpp index ab9f787..15b830c 100644 --- a/src/mdictionary/gui/TranslationWidget.cpp +++ b/src/mdictionary/gui/TranslationWidget.cpp @@ -90,8 +90,9 @@ void TranslationWidget::show(QStringList translations) { trans = head + trans; trans+= ""; - trans.replace("$STAR$", "/usr/lib/mdictionary/staron.png"); + trans.replace("$STAR$", "/usr/share/mdictionary/staron.png"); +// qDebug()<setHtml(trans, QUrl().fromLocalFile("/")); diff --git a/src/plugins/google/GooglePlugin.cpp b/src/plugins/google/GooglePlugin.cpp index 61f5c34..ea51c5c 100644 --- a/src/plugins/google/GooglePlugin.cpp +++ b/src/plugins/google/GooglePlugin.cpp @@ -417,7 +417,7 @@ QMap GooglePlugin::initLanguages() { void GooglePlugin::getDictionaryInfo() { QString fullLangFrom=languages.key(_settings->value("lang_from")); QString fullLangTo=languages.key(_settings->value("lang_to")); - _infoNote=" [" + fullLangFrom + "-" + fullLangTo + "] (Google)"; + _infoNote=" [" + fullLangFrom + "-" + fullLangTo + "] "; } diff --git a/src/plugins/google/TranslationGoogle.cpp b/src/plugins/google/TranslationGoogle.cpp index a0f465f..5d1d5c8 100644 --- a/src/plugins/google/TranslationGoogle.cpp +++ b/src/plugins/google/TranslationGoogle.cpp @@ -55,8 +55,8 @@ QString TranslationGoogle::dictionaryInfo() const { QString TranslationGoogle::toHtml() const { QString result(""); if(!googlePlugin) - return result; - result=" "; else diff --git a/src/plugins/google/google.pro b/src/plugins/google/google.pro index 3b39bc5..937bfe4 100644 --- a/src/plugins/google/google.pro +++ b/src/plugins/google/google.pro @@ -21,3 +21,11 @@ HEADERS += \ RESOURCES += \ icons.qrc + + +unix { + INSTALLS += plugin-icon + + plugin-icon.path = $$DATA_DIR + plugin-icon.files += drawing.png +} diff --git a/src/plugins/xdxf/xdxf.pro b/src/plugins/xdxf/xdxf.pro index 91955f4..a0ac19b 100644 --- a/src/plugins/xdxf/xdxf.pro +++ b/src/plugins/xdxf/xdxf.pro @@ -28,10 +28,13 @@ RESOURCES += \ xdxf.qrc unix { - INSTALLS += dicts + INSTALLS += dicts plugin-icon dicts.path = $$PLUGINS_DIR dicts.files += ../../../data/dicts/eng-us.xdxf dicts.files += ../../../data/dicts/eng-thai.xdxf + + plugin-icon.path = $$DATA_DIR + plugin-icon.files += xdxf.png } diff --git a/src/plugins/xdxf/xdxfplugin.cpp b/src/plugins/xdxf/xdxfplugin.cpp index 533ed10..c7e6c30 100644 --- a/src/plugins/xdxf/xdxfplugin.cpp +++ b/src/plugins/xdxf/xdxfplugin.cpp @@ -440,11 +440,10 @@ bool XdxfPlugin::getDictionaryInfo() { if(reader.name()=="description") _infoNote=reader.readElementText(); - QString format = "png"; - QString initialPath = QDir::currentPath() + "/xdxf." + format; + QString initialPath = "/usr/share/mdictionary/xdxf.png"; - _infoNote="path=\""+initialPath+"\"> \n" + _name + " [" + _langFrom + "-" - + _langTo + "] ( xdxf )"; + _infoNote=" path=\""+initialPath+"\"> \n" + _name + " [" + _langFrom + "-" + + _langTo + "]"; dictionaryFile.close(); if(okFormat) return true; @@ -506,9 +505,6 @@ bool XdxfPlugin::makeCache(QString) { db_name = _settings->value("type") + cachePathN; db = QSqlDatabase::addDatabase("QSQLITE",db_name); -// qDebug()<value("path")) -- 1.7.9.5