[Rigo] implement restarting_system_upgrade() signal handling

This commit is contained in:
Fabio Erculiani
2012-03-31 18:14:56 +02:00
parent 76a5a326e9
commit 7879be8a05
+25
View File
@@ -185,6 +185,7 @@ class RigoServiceController(GObject.Object):
_APPLICATION_PROCESSED_SIGNAL = "application_processed"
_APPLICATIONS_MANAGED_SIGNAL = "applications_managed"
_UNSUPPORTED_APPLICATIONS_SIGNAL = "unsupported_applications"
_RESTARTING_UPGRADE_SIGNAL = "restarting_system_upgrade"
_SUPPORTED_APIS = [0]
def __init__(self, rigo_app, activity_rwsem,
@@ -460,6 +461,14 @@ class RigoServiceController(GObject.Object):
self._unsupported_applications_signal,
dbus_interface=self.DBUS_INTERFACE)
# RigoDaemon tells us that the currently scheduled
# System Upgrade is being restarted due to further
# updates being available
self.__entropy_bus.connect_to_signal(
self._RESTARTING_UPGRADE_SIGNAL,
self._restarting_system_upgrade_signal,
dbus_interface=self.DBUS_INTERFACE)
return self.__entropy_bus
### GOBJECT EVENTS
@@ -650,6 +659,22 @@ class RigoServiceController(GObject.Object):
__name__,
"_applications_managed_signal: applications-managed")
def _restarting_system_upgrade_signal(self, updates_amount):
"""
System Upgrade Activity is being restarted due to further updates
being available. This happens when RigoDaemon processed critical
updates during the previous activity execution.
"""
if self._nc is not None:
msg = "%s. %s" % (
_("<b>System Upgrade</b> Activity is being restarted"),
ngettext("There is %i more update",
"There are %i more updates",
int(updates_amount)) % (updates_amount,),)
box = self.ServiceNotificationBox(
prepare_markup(msg), Gtk.MessageType.INFO)
self._nc.append(box, timeout=20)
def _unsupported_applications_signal(self, manual_package_ids,
package_ids):
const_debug_write(