[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/kdelirc
From: Michael Zanetti <michael_zanetti () gmx ! net>
Date: 2010-02-28 22:56:17
Message-ID: 1267397777.433377.12418.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1097335 by mzanetti:
showing/hiding the tray app works correctly now
M +1 -0 kcmremotecontrol/kcmremotecontrol.cpp
M +12 -6 kded/kremotecontroldaemon.cpp
M +2 -0 kded/kremotecontroldaemon.h
M +1 -0 kded/org.kde.krcd.xml
M +13 -0 krcdnotifieritem/main.cpp
--- branches/work/kdelirc/kcmremotecontrol/kcmremotecontrol.cpp #1097334:1097335
@@ -384,6 +384,7 @@
KConfig config("kremotecontrolrc");
KConfigGroup globalGroup = KConfigGroup(&config, "Global");
globalGroup.writeEntry("ShowTrayIcon", ui.cbTrayIcon->isChecked());
+ globalGroup.sync();
DBusInterface::getInstance()->reloadRemoteControlDaemon();
--- branches/work/kdelirc/kded/kremotecontroldaemon.cpp #1097334:1097335
@@ -50,6 +50,7 @@
class KRemoteControlDaemonPrivate
{
private:
+ KRemoteControlDaemon *m_parent;
RemoteList m_remoteList;
QStringList m_ignoreNextButtonList;
@@ -57,21 +58,26 @@
KComponentData applicationData;
- KRemoteControlDaemonPrivate() {
+ KRemoteControlDaemonPrivate(KRemoteControlDaemon *parent) {
+ m_parent = parent;
};
-
+
+ ~KRemoteControlDaemonPrivate() {
+ };
+
RemoteList remoteList(){
return m_remoteList;
};
void reload(){
- kDebug() << \
"******************************************************reloading"; \
m_remoteList.loadFromConfig("kremotecontrolrc"); KConfig config("kremotecontrolrc");
KConfigGroup globalGroup(&config, "Global");
if(globalGroup.readEntry("ShowTrayIcon", true)){
kDebug() << "starting notifier item" <<
KToolInvocation::kdeinitExec("krcdnotifieritem");
+ } else {
+ emit m_parent->unloadTray();
}
};
@@ -99,7 +105,7 @@
-KRemoteControlDaemon::KRemoteControlDaemon(QObject* parent, const QVariantList& ): \
KDEDModule(parent), d_ptr(new KRemoteControlDaemonPrivate) { \
+KRemoteControlDaemon::KRemoteControlDaemon(QObject* parent, const QVariantList& ): \
KDEDModule(parent), d_ptr(new KRemoteControlDaemonPrivate(this)) { \
Q_D(KRemoteControlDaemon); // QErrorMessage::qtHandler () ;
//qInstallMsgHandler();
@@ -127,7 +133,7 @@
}
KRemoteControlDaemon::~KRemoteControlDaemon() {
-
+ emit unloadTray();
}
@@ -180,7 +186,7 @@
void KRemoteControlDaemon::reloadConfiguration() {
- d_ptr->reload();
+ d_ptr->reload();
notifyEvent(i18n("Configuration reloaded."));
}
--- branches/work/kdelirc/kded/kremotecontroldaemon.h #1097334:1097335
@@ -65,6 +65,8 @@
signals:
void modeChanged(const QString &remoteName, const QString &modeName);
void buttonPressed();
+ void unloadTray();
+
private slots:
void lauchKcmShell();
--- branches/work/kdelirc/kded/org.kde.krcd.xml #1097334:1097335
@@ -36,6 +36,7 @@
<arg name="modeName" type="s" direction="out"/>
</signal>
<signal name="buttonPressed"/>
+ <signal name="unloadTray"/>
</interface>
</node>
--- branches/work/kdelirc/krcdnotifieritem/main.cpp #1097334:1097335
@@ -28,12 +28,16 @@
#include <KUniqueApplication>
#include <kdebug.h>
+#include <QDBusConnection>
+#include <kconfiggroup.h>
+
class KrcdNotifierApp : public KUniqueApplication
{
public:
KrcdNotifierApp() : m_item( 0 ) {
// ensure the Quit dialog's Cancel reponse does not close the app
setQuitOnLastWindowClosed( false );
+ QDBusConnection::sessionBus().connect("org.kde.kded", \
"/modules/kremotecontrol", "org.kde.krcd", "unloadTray", this, SLOT(quit())); }
int newInstance() {
@@ -49,6 +53,15 @@
private:
KrcdNotifierItem *m_item;
+
+ private slots:
+ void configChanged() {
+ KConfig config("kremotecontrolrc");
+ KConfigGroup globalGroup(&config, "Global");
+ if(!globalGroup.readEntry("ShowTrayIcon", true)){
+ quit();
+ }
+ }
};
int main( int argc, char **argv ) {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic