aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2010-03-10 17:55:02 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2010-03-10 17:55:02 +0000
commit060dc05579e4addaadc43c8a273ca56e13b24a70 (patch)
tree56a4ae0e4194e180a403e12a82cd98ae41aa3db5 /src/plugins/General
parent88b5787715a116f9deb2dcc4e64a12ca8794b5a9 (diff)
downloadqmmp-060dc05579e4addaadc43c8a273ca56e13b24a70.tar.gz
qmmp-060dc05579e4addaadc43c8a273ca56e13b24a70.tar.bz2
qmmp-060dc05579e4addaadc43c8a273ca56e13b24a70.zip
kde notification: added kde 4.4 support (patch by Artur Guzik)
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1613 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General')
-rw-r--r--src/plugins/General/kdenotify/kdenotify.cpp22
-rw-r--r--src/plugins/General/kdenotify/kdenotify.h2
-rw-r--r--src/plugins/General/kdenotify/translations/kdenotify_plugin_cs.ts6
-rw-r--r--src/plugins/General/kdenotify/translations/kdenotify_plugin_de.ts6
-rw-r--r--src/plugins/General/kdenotify/translations/kdenotify_plugin_it.ts6
-rw-r--r--src/plugins/General/kdenotify/translations/kdenotify_plugin_lt.ts6
-rw-r--r--src/plugins/General/kdenotify/translations/kdenotify_plugin_pl.ts6
-rw-r--r--src/plugins/General/kdenotify/translations/kdenotify_plugin_ru.ts6
-rw-r--r--src/plugins/General/kdenotify/translations/kdenotify_plugin_tr.ts6
-rw-r--r--src/plugins/General/kdenotify/translations/kdenotify_plugin_uk_UA.ts6
-rw-r--r--src/plugins/General/kdenotify/translations/kdenotify_plugin_zh_CN.ts6
-rw-r--r--src/plugins/General/kdenotify/translations/kdenotify_plugin_zh_TW.ts6
12 files changed, 47 insertions, 37 deletions
diff --git a/src/plugins/General/kdenotify/kdenotify.cpp b/src/plugins/General/kdenotify/kdenotify.cpp
index 908e21432..419189f3a 100644
--- a/src/plugins/General/kdenotify/kdenotify.cpp
+++ b/src/plugins/General/kdenotify/kdenotify.cpp
@@ -32,17 +32,26 @@
#include <qmmp/metadatamanager.h>
#include "kdenotify.h"
-KdeNotify::KdeNotify(QObject *parent) : General(parent)
+KdeNotify::KdeNotify(QObject *parent) : General(parent),m_UseFreedesktopSpec(false)
{
notifier = new QDBusInterface("org.kde.VisualNotifications",
"/VisualNotifications", "org.kde.VisualNotifications");
if(notifier->lastError().type() != QDBusError::NoError)
{
- qWarning() << "KdeNotify: unable to create dbus interface(" +
- notifier->lastError().message() + ")";
- return;
+ delete(notifier);
+ qWarning() << "KdeNotify: unable to create dbus interface."
+ << "Have you got KDE SC 4.4 or newer? Lets try...";
+
+ notifier = new QDBusInterface("org.freedesktop.Notifications",
+ "/org/freedesktop/Notifications","org.freedesktop.Notifications");
+ if(notifier->lastError().type() != QDBusError::NoError)
+ {
+ qWarning() << "KdeNotify: Can't create interface. Sorry.";
+ return;
+ }
+ m_UseFreedesktopSpec = true;
}
-
+ qWarning() << "KdeNotify: DBus interfece created successfully.";
m_ConfigDir = QFileInfo(Qmmp::configFile()).absoluteDir().path();
QSettings settings(Qmmp::configFile(),QSettings::IniFormat);
@@ -92,7 +101,8 @@ QList<QVariant> KdeNotify::prepareNotification()
args.append("Qmmp"); //app-name
args.append(0U); //replaces-id
- args.append(""); //event-id
+ if(!m_UseFreedesktopSpec)
+ args.append(""); //event-id
args.append(m_ConfigDir + "/app_icon.png"); //app-icon(path to icon on disk)
args.append(tr("Qmmp now playing:")); //summary (notification title)
diff --git a/src/plugins/General/kdenotify/kdenotify.h b/src/plugins/General/kdenotify/kdenotify.h
index 652e111eb..58317d61d 100644
--- a/src/plugins/General/kdenotify/kdenotify.h
+++ b/src/plugins/General/kdenotify/kdenotify.h
@@ -42,7 +42,7 @@ private:
QString m_ConfigDir;
int m_NotifyDelay;
bool m_ShowCovers;
-
+ bool m_UseFreedesktopSpec;
private slots:
void showMetaData();
QString totalTimeString();
diff --git a/src/plugins/General/kdenotify/translations/kdenotify_plugin_cs.ts b/src/plugins/General/kdenotify/translations/kdenotify_plugin_cs.ts
index 6981288e8..c3205d308 100644
--- a/src/plugins/General/kdenotify/translations/kdenotify_plugin_cs.ts
+++ b/src/plugins/General/kdenotify/translations/kdenotify_plugin_cs.ts
@@ -4,17 +4,17 @@
<context>
<name>KdeNotify</name>
<message>
- <location filename="../kdenotify.cpp" line="97"/>
+ <location filename="../kdenotify.cpp" line="107"/>
<source>Qmmp now playing:</source>
<translation>Qmmp nyní přehrává:</translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="107"/>
+ <location filename="../kdenotify.cpp" line="117"/>
<source>by </source>
<translation>- </translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="112"/>
+ <location filename="../kdenotify.cpp" line="122"/>
<source>on </source>
<translation>- </translation>
</message>
diff --git a/src/plugins/General/kdenotify/translations/kdenotify_plugin_de.ts b/src/plugins/General/kdenotify/translations/kdenotify_plugin_de.ts
index 86da28416..a35e8c10a 100644
--- a/src/plugins/General/kdenotify/translations/kdenotify_plugin_de.ts
+++ b/src/plugins/General/kdenotify/translations/kdenotify_plugin_de.ts
@@ -4,17 +4,17 @@
<context>
<name>KdeNotify</name>
<message>
- <location filename="../kdenotify.cpp" line="97"/>
+ <location filename="../kdenotify.cpp" line="107"/>
<source>Qmmp now playing:</source>
<translation>Qmmp spielt zurzeit:</translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="107"/>
+ <location filename="../kdenotify.cpp" line="117"/>
<source>by </source>
<translation>von</translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="112"/>
+ <location filename="../kdenotify.cpp" line="122"/>
<source>on </source>
<translation>auf</translation>
</message>
diff --git a/src/plugins/General/kdenotify/translations/kdenotify_plugin_it.ts b/src/plugins/General/kdenotify/translations/kdenotify_plugin_it.ts
index c84ad5af7..cb4ca17ba 100644
--- a/src/plugins/General/kdenotify/translations/kdenotify_plugin_it.ts
+++ b/src/plugins/General/kdenotify/translations/kdenotify_plugin_it.ts
@@ -4,17 +4,17 @@
<context>
<name>KdeNotify</name>
<message>
- <location filename="../kdenotify.cpp" line="97"/>
+ <location filename="../kdenotify.cpp" line="107"/>
<source>Qmmp now playing:</source>
<translation>Qmmp ora in esecuzione:</translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="107"/>
+ <location filename="../kdenotify.cpp" line="117"/>
<source>by </source>
<translation>di </translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="112"/>
+ <location filename="../kdenotify.cpp" line="122"/>
<source>on </source>
<translation>su </translation>
</message>
diff --git a/src/plugins/General/kdenotify/translations/kdenotify_plugin_lt.ts b/src/plugins/General/kdenotify/translations/kdenotify_plugin_lt.ts
index 3bacbeba8..d6ea24065 100644
--- a/src/plugins/General/kdenotify/translations/kdenotify_plugin_lt.ts
+++ b/src/plugins/General/kdenotify/translations/kdenotify_plugin_lt.ts
@@ -4,17 +4,17 @@
<context>
<name>KdeNotify</name>
<message>
- <location filename="../kdenotify.cpp" line="97"/>
+ <location filename="../kdenotify.cpp" line="107"/>
<source>Qmmp now playing:</source>
<translation>Qmmp dabar groja:</translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="107"/>
+ <location filename="../kdenotify.cpp" line="117"/>
<source>by </source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="112"/>
+ <location filename="../kdenotify.cpp" line="122"/>
<source>on </source>
<translation type="unfinished"></translation>
</message>
diff --git a/src/plugins/General/kdenotify/translations/kdenotify_plugin_pl.ts b/src/plugins/General/kdenotify/translations/kdenotify_plugin_pl.ts
index 08ff804ee..d464615aa 100644
--- a/src/plugins/General/kdenotify/translations/kdenotify_plugin_pl.ts
+++ b/src/plugins/General/kdenotify/translations/kdenotify_plugin_pl.ts
@@ -4,17 +4,17 @@
<context>
<name>KdeNotify</name>
<message>
- <location filename="../kdenotify.cpp" line="97"/>
+ <location filename="../kdenotify.cpp" line="107"/>
<source>Qmmp now playing:</source>
<translation>Qmmp teraz odtwarza:</translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="107"/>
+ <location filename="../kdenotify.cpp" line="117"/>
<source>by </source>
<translation>przez </translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="112"/>
+ <location filename="../kdenotify.cpp" line="122"/>
<source>on </source>
<translation>na </translation>
</message>
diff --git a/src/plugins/General/kdenotify/translations/kdenotify_plugin_ru.ts b/src/plugins/General/kdenotify/translations/kdenotify_plugin_ru.ts
index b1fc4be10..6aa6fe232 100644
--- a/src/plugins/General/kdenotify/translations/kdenotify_plugin_ru.ts
+++ b/src/plugins/General/kdenotify/translations/kdenotify_plugin_ru.ts
@@ -4,17 +4,17 @@
<context>
<name>KdeNotify</name>
<message>
- <location filename="../kdenotify.cpp" line="97"/>
+ <location filename="../kdenotify.cpp" line="107"/>
<source>Qmmp now playing:</source>
<translation>Играет:</translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="107"/>
+ <location filename="../kdenotify.cpp" line="117"/>
<source>by </source>
<translation>исполнитель</translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="112"/>
+ <location filename="../kdenotify.cpp" line="122"/>
<source>on </source>
<translation>на</translation>
</message>
diff --git a/src/plugins/General/kdenotify/translations/kdenotify_plugin_tr.ts b/src/plugins/General/kdenotify/translations/kdenotify_plugin_tr.ts
index f06ed9846..6d4e10a3f 100644
--- a/src/plugins/General/kdenotify/translations/kdenotify_plugin_tr.ts
+++ b/src/plugins/General/kdenotify/translations/kdenotify_plugin_tr.ts
@@ -4,17 +4,17 @@
<context>
<name>KdeNotify</name>
<message>
- <location filename="../kdenotify.cpp" line="97"/>
+ <location filename="../kdenotify.cpp" line="107"/>
<source>Qmmp now playing:</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="107"/>
+ <location filename="../kdenotify.cpp" line="117"/>
<source>by </source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="112"/>
+ <location filename="../kdenotify.cpp" line="122"/>
<source>on </source>
<translation type="unfinished"></translation>
</message>
diff --git a/src/plugins/General/kdenotify/translations/kdenotify_plugin_uk_UA.ts b/src/plugins/General/kdenotify/translations/kdenotify_plugin_uk_UA.ts
index 47999a098..ea4ded89d 100644
--- a/src/plugins/General/kdenotify/translations/kdenotify_plugin_uk_UA.ts
+++ b/src/plugins/General/kdenotify/translations/kdenotify_plugin_uk_UA.ts
@@ -4,17 +4,17 @@
<context>
<name>KdeNotify</name>
<message>
- <location filename="../kdenotify.cpp" line="97"/>
+ <location filename="../kdenotify.cpp" line="107"/>
<source>Qmmp now playing:</source>
<translation>Відтворюється:</translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="107"/>
+ <location filename="../kdenotify.cpp" line="117"/>
<source>by </source>
<translation>виконавець</translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="112"/>
+ <location filename="../kdenotify.cpp" line="122"/>
<source>on </source>
<translation>на</translation>
</message>
diff --git a/src/plugins/General/kdenotify/translations/kdenotify_plugin_zh_CN.ts b/src/plugins/General/kdenotify/translations/kdenotify_plugin_zh_CN.ts
index f06ed9846..6d4e10a3f 100644
--- a/src/plugins/General/kdenotify/translations/kdenotify_plugin_zh_CN.ts
+++ b/src/plugins/General/kdenotify/translations/kdenotify_plugin_zh_CN.ts
@@ -4,17 +4,17 @@
<context>
<name>KdeNotify</name>
<message>
- <location filename="../kdenotify.cpp" line="97"/>
+ <location filename="../kdenotify.cpp" line="107"/>
<source>Qmmp now playing:</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="107"/>
+ <location filename="../kdenotify.cpp" line="117"/>
<source>by </source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="112"/>
+ <location filename="../kdenotify.cpp" line="122"/>
<source>on </source>
<translation type="unfinished"></translation>
</message>
diff --git a/src/plugins/General/kdenotify/translations/kdenotify_plugin_zh_TW.ts b/src/plugins/General/kdenotify/translations/kdenotify_plugin_zh_TW.ts
index f06ed9846..6d4e10a3f 100644
--- a/src/plugins/General/kdenotify/translations/kdenotify_plugin_zh_TW.ts
+++ b/src/plugins/General/kdenotify/translations/kdenotify_plugin_zh_TW.ts
@@ -4,17 +4,17 @@
<context>
<name>KdeNotify</name>
<message>
- <location filename="../kdenotify.cpp" line="97"/>
+ <location filename="../kdenotify.cpp" line="107"/>
<source>Qmmp now playing:</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="107"/>
+ <location filename="../kdenotify.cpp" line="117"/>
<source>by </source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="112"/>
+ <location filename="../kdenotify.cpp" line="122"/>
<source>on </source>
<translation type="unfinished"></translation>
</message>