[SCM] Kingston update notifier (update-notifier-kde) branch, master, updated. 08797272b7fa67dc29f1e2f05ca925feed8070d3

Kai Wasserbäch curan-guest at alioth.debian.org
Wed Dec 1 15:45:40 UTC 2010


The following commit has been merged in the master branch:
commit 4b0cb2c15c12ee196778f8c444d96950fc045216
Author: Kai Wasserbäch <debian at carbon-project.org>
Date:   Wed Dec 1 16:35:41 2010 +0100

    Added reboot option, thanks to George Stephanos. (Closes: #604684)
---
 debian/changelog |    7 +++++++
 debian/control   |    2 +-
 src/notifier.cpp |   11 ++++++++++-
 src/notifier.h   |    1 +
 4 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 8f9e132..f471330 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+kingston-update-notifier (1.2+nmu1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Added reboot option, thanks to George Stephanos. (Closes: #604684)
+
+ -- Kai Wasserbäch <debian at carbon-project.org>  Wed, 01 Dec 2010 16:32:20 +0100
+
 kingston-update-notifier (1.2) unstable; urgency=low
 
   * Fix segfault. Closes: #589491
diff --git a/debian/control b/debian/control
index 6a1e0aa..b168267 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: kingston-update-notifier
 Section: kde
 Priority: optional
 Maintainer: Sune Vuorela <sune at debian.org>
-Build-Depends: debhelper (>= 7), cmake, kdelibs5-dev
+Build-Depends: debhelper (>= 7), cmake, kdelibs5-dev, kdebase-workspace-dev
 Standards-Version: 3.8.4
 
 Package: update-notifier-kde
diff --git a/src/notifier.cpp b/src/notifier.cpp
index a14e380..7bef906 100644
--- a/src/notifier.cpp
+++ b/src/notifier.cpp
@@ -28,6 +28,8 @@
 #include <KIcon>
 #include <KLocale>
 #include <QApplication>
+#include <QtDBus>
+#include <kworkspace/kworkspace.h>
 
 #include <QTimer>
 #include <KNotification>
@@ -73,7 +75,8 @@ void notifier_t::show_update_notification(const QString& title, const QString& m
   note->setText(message);
   note->setPixmap(KIcon(iconname).pixmap(QSize(32,32)));
   note->setComponentData(m_component_data);
-  note->setActions(QStringList() << i18nc("Do the proposed action (upgrade, reboot, etc) later", "Later"));
+  note->setActions(QStringList() << i18nc("Do the proposed action (upgrade, reboot, etc) later", "Later")
+    << i18nc("Reboot the system", "Reboot"));
   note->sendEvent();
   m_upgrade_notification=note;
   return;
@@ -88,7 +91,13 @@ void notifier_t::notify_reboot() {
   note->setActions(QStringList() << i18nc("Do the proposed action (upgrade, reboot, etc) later", "Later"));
   connect(note,SIGNAL(closed()),m_reboot_nagger,SLOT(start()));
   connect(note,SIGNAL(action1Activated()),m_reboot_nagger,SLOT(start()));
+  connect(note,SIGNAL(action2Activated()),SLOT(reboot()));
   note->sendEvent();
 }
 
+void notifier_t::reboot() {
+  QDBusInterface interface("org.kde.ksmserver", "/KSMServer", "org.kde.KSMServerInterface");
+  interface.call("logout", KWorkSpace::ShutdownConfirmYes, KWorkSpace::ShutdownTypeReboot, KWorkSpace::ShutdownModeInteractive);
+}
+
 #include <notifier.moc>
diff --git a/src/notifier.h b/src/notifier.h
index f234ad9..7b73c19 100644
--- a/src/notifier.h
+++ b/src/notifier.h
@@ -41,6 +41,7 @@ class notifier_t : public QObject{
   public Q_SLOTS:
     void notify_new_updates(int updates, int security_updates);
     void notify_reboot();
+    void reboot();
   private:
     void show_update_notification(const QString& title, const QString& message, const QString& iconname);
     KComponentData m_component_data;

-- 
Kingston update notifier (update-notifier-kde)



More information about the pkg-kde-commits mailing list