From 3fa2bfef4093a9698edb49439fdfbb8d6f7cb451 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sat, 31 Oct 2009 10:18:54 +0000 Subject: fixed kde notifications git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1342 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/General/kdenotify/kdenotify.cpp | 36 +++++++++++++++++----- src/plugins/General/kdenotify/kdenotify.h | 20 ++++++++++++ src/plugins/General/kdenotify/kdenotify.pro | 10 ------ src/plugins/General/kdenotify/kdenotifyfactory.cpp | 20 ++++++++++++ src/plugins/General/kdenotify/kdenotifyfactory.h | 20 ++++++++++++ src/plugins/General/kdenotify/settingsdialog.cpp | 20 ++++++++++++ src/plugins/General/kdenotify/settingsdialog.h | 20 ++++++++++++ 7 files changed, 128 insertions(+), 18 deletions(-) (limited to 'src/plugins/General/kdenotify') diff --git a/src/plugins/General/kdenotify/kdenotify.cpp b/src/plugins/General/kdenotify/kdenotify.cpp index 0b77c11f1..2dafa5df1 100644 --- a/src/plugins/General/kdenotify/kdenotify.cpp +++ b/src/plugins/General/kdenotify/kdenotify.cpp @@ -1,6 +1,23 @@ -#include "kdenotify.h" -#include -#include +/*************************************************************************** + * Copyright (C) 2009 by Artur Guzik * + * a.guzik88@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #include #include #include @@ -10,21 +27,24 @@ #include #include #include +#include +#include +#include "kdenotify.h" KdeNotify::KdeNotify(QObject *parent) : General(parent) { - if (!QDBusConnection::sessionBus ().interface ()->isServiceRegistered ("org.kde.VisualNotifications")) + notifier = new QDBusInterface("org.kde.VisualNotifications", + "/VisualNotifications", "org.kde.VisualNotifications"); + if(notifier->isValid()) { - qWarning("KdeNotify: org.kde.VisualNotifications is not registered"); + qWarning("KdeNotify: unable to create dbus interface"); return; } - notifier = new QDBusInterface("org.kde.VisualNotifications", - "/VisualNotifications", "org.kde.VisualNotifications"); QSettings settings(Qmmp::configFile(),QSettings::IniFormat); settings.beginGroup("Kde_Notifier"); m_NotifyDelay = settings.value("notify_delay",10000).toInt(); settings.endGroup(); - connect(SoundCore::instance(),SIGNAL(metaDataChanged()),this,SLOT(showMetaData())); + connect(SoundCore::instance(),SIGNAL(metaDataChanged()), SLOT(showMetaData())); } KdeNotify::~KdeNotify() diff --git a/src/plugins/General/kdenotify/kdenotify.h b/src/plugins/General/kdenotify/kdenotify.h index 61309614c..1d2466d9f 100644 --- a/src/plugins/General/kdenotify/kdenotify.h +++ b/src/plugins/General/kdenotify/kdenotify.h @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2009 by Artur Guzik * + * a.guzik88@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #ifndef KDENOTIFY_H #define KDENOTIFY_H diff --git a/src/plugins/General/kdenotify/kdenotify.pro b/src/plugins/General/kdenotify/kdenotify.pro index f5f393090..d9f8838fc 100644 --- a/src/plugins/General/kdenotify/kdenotify.pro +++ b/src/plugins/General/kdenotify/kdenotify.pro @@ -26,15 +26,5 @@ SOURCES += kdenotifyfactory.cpp \ HEADERS += kdenotifyfactory.h \ kdenotify.h \ settingsdialog.h -TRANSLATIONS = translations/kdenotify_plugin_cs.ts \ - translations/kdenotify_plugin_de.ts \ - translations/kdenotify_plugin_zh_CN.ts \ - translations/kdenotify_plugin_zh_TW.ts \ - translations/kdenotify_plugin_ru.ts \ - translations/kdenotify_plugin_pl.ts \ - translations/kdenotify_plugin_uk_UA.ts \ - translations/kdenotify_plugin_it.ts \ - translations/kdenotify_plugin_tr.ts \ - translations/kdenotify_plugin_lt.ts RESOURCES += translations/translations.qrc FORMS += settingsdialog.ui diff --git a/src/plugins/General/kdenotify/kdenotifyfactory.cpp b/src/plugins/General/kdenotify/kdenotifyfactory.cpp index 2fdd9f75b..967b92305 100644 --- a/src/plugins/General/kdenotify/kdenotifyfactory.cpp +++ b/src/plugins/General/kdenotify/kdenotifyfactory.cpp @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2009 by Artur Guzik * + * a.guzik88@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #include "kdenotifyfactory.h" #include "kdenotify.h" #include "settingsdialog.h" diff --git a/src/plugins/General/kdenotify/kdenotifyfactory.h b/src/plugins/General/kdenotify/kdenotifyfactory.h index 075f9b5f4..b9d5634eb 100644 --- a/src/plugins/General/kdenotify/kdenotifyfactory.h +++ b/src/plugins/General/kdenotify/kdenotifyfactory.h @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2009 by Artur Guzik * + * a.guzik88@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #ifndef KDENOTIFYFACTORY_H #define KDENOTIFYFACTORY_H diff --git a/src/plugins/General/kdenotify/settingsdialog.cpp b/src/plugins/General/kdenotify/settingsdialog.cpp index b4aeae018..00f029871 100644 --- a/src/plugins/General/kdenotify/settingsdialog.cpp +++ b/src/plugins/General/kdenotify/settingsdialog.cpp @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2009 by Artur Guzik * + * a.guzik88@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #include "settingsdialog.h" #include "ui_settingsdialog.h" #include diff --git a/src/plugins/General/kdenotify/settingsdialog.h b/src/plugins/General/kdenotify/settingsdialog.h index 500167612..07e7669cd 100644 --- a/src/plugins/General/kdenotify/settingsdialog.h +++ b/src/plugins/General/kdenotify/settingsdialog.h @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2009 by Artur Guzik * + * a.guzik88@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #ifndef SETTINGSDIALOG_H #define SETTINGSDIALOG_H -- cgit v1.2.3-13-gbd6f