Added icon to xdxf plugin and commonDictInterface
authorMateusz Półrola <mateusz.polrola@comarch.pl>
Wed, 11 Aug 2010 12:19:28 +0000 (14:19 +0200)
committerMateusz Półrola <mateusz.polrola@comarch.pl>
Wed, 11 Aug 2010 12:19:28 +0000 (14:19 +0200)
trunk/src/base/gui/DictManagerWidget.cpp
trunk/src/includes/CommonDictInterface.h
trunk/src/plugins/xdxf/src/src.pro
trunk/src/plugins/xdxf/src/xdxfplugin.cpp
trunk/src/plugins/xdxf/src/xdxfplugin.h
trunk/tests/mDictionaryTests/CommonDictInterfaceMock.h

index d99c4fc..136dc56 100644 (file)
@@ -99,6 +99,7 @@ void DictManagerWidget::refreshDictsList() {
         else {
             item->setCheckState(Qt::Unchecked);
         }
+        item->setIcon(i.key()->icon());
 
         dictListWidget->addItem(item);
         dictsHash.insert(item, i.key());
index e55be96..fa094ce 100644 (file)
@@ -78,6 +78,9 @@ class CommonDictInterface : public QObject {
     //! returns current plugin settings
     virtual Settings* settings() = 0;
 
+    //! returns plugin icon
+    virtual QIcon icon() = 0;
+
  public Q_SLOTS:
     /*! performs search in dictionary
         \param  word word to search in dictionary
index 1fd50e6..bcde306 100644 (file)
@@ -71,4 +71,5 @@ unix {
   dicts.files += ../../../../../data/dicts/en-fin.xdxf
 }
 
-RESOURCES +=
+RESOURCES += \
+    xdxf.qrc
index 7ad6965..058e95b 100644 (file)
@@ -42,9 +42,7 @@ XdxfPlugin::XdxfPlugin(QObject *parent) : CommonDictInterface(parent),
 
     stopped = false;
 
-    QIcon(":/icons/mdictionary.png");
-
-
+    _icon = QIcon(":/icons/xdxf.png");
 }
 
 QString XdxfPlugin::langFrom() const {   
@@ -271,4 +269,8 @@ QString XdxfPlugin::removeAccents(QString string) {
     return normalized;
 }
 
+QIcon XdxfPlugin::icon() {
+    return _icon;
+}
+
 Q_EXPORT_PLUGIN2(xdxf, XdxfPlugin)
index 4c9c286..7d0cd93 100644 (file)
@@ -83,6 +83,9 @@ public:
     //! Sets new settings
     void setSettings(Settings*);
 
+    //! returns plugin icon
+    virtual QIcon icon();
+
 public Q_SLOTS:
     /*! performs search in dictionary
       \param  word word to search in dictionary
@@ -124,6 +127,7 @@ private:
     //! path to dictionary file
     QString path;
     uint _hash;
+    QIcon _icon;
 
     //! number of words in dicrionary
     long _wordsCount;
index ad2fbbc..418ffaa 100644 (file)
@@ -51,6 +51,7 @@ public:
     uint hash() const { return _hash;}
     void setHash(uint h) {_hash = h;}
     void stop() {stopped = 1;}
+    QIcon icon(){return QIcon();}
     QString search(QString key) {return "";}
     QList<Translation*> searchWordList(QString word, int limit) {
         qDebug() << "search " << this->thread()->currentThreadId();