Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/rpms/sugar/0049-Yum-updater-notifications-integration.patch
diff options
context:
space:
mode:
Diffstat (limited to 'rpms/sugar/0049-Yum-updater-notifications-integration.patch')
-rw-r--r--rpms/sugar/0049-Yum-updater-notifications-integration.patch86
1 files changed, 86 insertions, 0 deletions
diff --git a/rpms/sugar/0049-Yum-updater-notifications-integration.patch b/rpms/sugar/0049-Yum-updater-notifications-integration.patch
new file mode 100644
index 0000000..4dade2a
--- /dev/null
+++ b/rpms/sugar/0049-Yum-updater-notifications-integration.patch
@@ -0,0 +1,86 @@
+From c1df98e7db463c4be76278d7716d069428bdd93d Mon Sep 17 00:00:00 2001
+From: Aleksey Lim <alsroot@member.fsf.org>
+Date: Thu, 17 Feb 2011 02:16:59 +0000
+Subject: [PATCH sugar 49/74] Yum-updater notifications integration
+
+Original-code: http://wiki.sugarlabs.org/go/Dextrose/Updater
+dextrose-port-by: Martin Abente <martin.abente.lahaye@gmail.com>
+
+VERSION 2 Including silbe's robustness suggestions.
+
+PLEASE REPLACE OLD PATCH WITH THIS ONE
+---
+ src/jarabe/desktop/homewindow.py | 36 ++++++++++++++++++++++++++++++++++++
+ 1 files changed, 36 insertions(+), 0 deletions(-)
+
+diff --git a/src/jarabe/desktop/homewindow.py b/src/jarabe/desktop/homewindow.py
+index 07deff7..f101757 100644
+--- a/src/jarabe/desktop/homewindow.py
++++ b/src/jarabe/desktop/homewindow.py
+@@ -18,6 +18,8 @@
+
+ import gobject
+ import gtk
++import dbus
++from gettext import gettext as _
+
+ from sugar.graphics import style
+ from sugar.graphics import palettegroup
+@@ -28,6 +30,7 @@
+ from jarabe.desktop.transitionbox import TransitionBox
+ from jarabe.model.shell import ShellModel
+ from jarabe.model import shell
++from jarabe.model import notifications
+
+
+ _HOME_PAGE = 0
+@@ -35,6 +38,12 @@
+ _MESH_PAGE = 2
+ _TRANSITION_PAGE = 3
+
++_DBUS_SYSTEM_IFACE = 'org.sugarlabs.system'
++_DBUS_SYSTEM_PATH = '/org/sugarlabs/system'
++_SYSTEM_REBOOT_ID = -1
++_SYSTEM_RELOGIN_ID = -2
++_SYSTEM_TIMEOUT = 5
++
+ _instance = None
+
+
+@@ -79,6 +88,33 @@ def __init__(self):
+ shell.get_model().zoom_level_changed.connect(
+ self.__zoom_level_changed_cb)
+
++ try:
++ systembus = dbus.SystemBus()
++ except dbus.DBusException:
++ logging.error('DBus SystemBus is not available')
++ else:
++ systembus.add_signal_receiver(self.__reboot_cb, 'Reboot',
++ _DBUS_SYSTEM_IFACE)
++ systembus.add_signal_receiver(self.__relogin_cb, 'Relogin',
++ _DBUS_SYSTEM_IFACE)
++
++ def _system_alert(self, replaces_id, app_icon, message):
++ service = notifications.get_service()
++ service.notification_received.send(self,app_name='system',
++ replaces_id=replaces_id, app_icon=app_icon,
++ summary=_('System alert'), body=message,
++ actions=[], hints={})
++
++ def __reboot_cb(self):
++ self._system_alert(_SYSTEM_REBOOT_ID, 'system-restart',
++ _('Please, reboot your computer to take into account ' \
++ 'new updates'))
++
++ def __relogin_cb(self):
++ self._system_alert(_SYSTEM_RELOGIN_ID, 'system-logout',
++ _('Please, restart Sugar to take into account ' \
++ 'new updates'))
++
+ def _deactivate_view(self, level):
+ group = palettegroup.get_group('default')
+ group.popdown()
+--
+1.7.6
+