Hello Sune,
as the original patch didn't apply cleanly, I redid the patch and have attached
the result.

Kind regards,
Kai Wasserbäch



-- 

Kai Wasserbäch (Kai Wasserbaech)

E-Mail: deb...@carbon-project.org
Jabber (debianforum.de): Drizzt
URL: http://wiki.debian.org/C%C3%B9ran
GnuPG: 0xE1DE59D2      0600 96CE F3C8 E733 E5B6 1587 A309 D76C E1DE 59D2
(http://pgpkeys.pca.dfn.de/pks/lookup?search=0xE1DE59D2&fingerprint=on&hash=on&op=vindex)
Cleaned up version of the patch sent to #604684.
---
 debian/control   |    2 +-
 src/notifier.cpp |   11 ++++++++++-
 src/notifier.h   |    1 +
 3 files changed, 12 insertions(+), 2 deletions(-)

--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: kingston-update-notifier
 Section: kde
 Priority: optional
 Maintainer: Sune Vuorela <s...@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
--- 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_notificatio
   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>
--- 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;

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to