[RigoDaemon] extend updates_available() signal with "One Click Update" information

This commit is contained in:
Fabio Erculiani
2013-11-02 14:17:33 +01:00
parent e02c8da563
commit 5b9a5ee273
3 changed files with 10 additions and 8 deletions
+2 -1
View File
@@ -313,7 +313,8 @@ class MagnetoCore(MagnetoCoreUI):
return dbus_string.decode(etpConst['conf_encoding'])
def _updates_available_signal(self, update, update_atoms,
remove, remove_atoms):
remove, remove_atoms,
one_click_update=False):
updates = [self._dbus_to_unicode(x) for x in update_atoms]
self.new_updates_signal(updates)
+4 -4
View File
@@ -473,7 +473,7 @@ class RigoDaemonService(dbus.service.Object):
Gio.FileMonitorEvent.ATTRIBUTE_CHANGED,
Gio.FileMonitorEvent.CHANGED)
API_VERSION = 7
API_VERSION = 8
"""
RigoDaemon is the dbus service Object in charge of executing
@@ -1198,7 +1198,7 @@ class RigoDaemonService(dbus.service.Object):
GLib.idle_add(self.updates_available,
update, update_atoms,
remove, remove_atoms)
remove, remove_atoms, True)
def _update_repositories(self, repositories, force, activity, pid,
authorized=False):
@@ -3718,9 +3718,9 @@ class RigoDaemonService(dbus.service.Object):
debug=True)
@dbus.service.signal(dbus_interface=BUS_NAME,
signature='a(is)asaias')
signature='a(is)asaiasb')
def updates_available(self, update, update_atoms, remove,
remove_atoms):
remove_atoms, one_click_updatable):
"""
Signal all the connected Clients that there are updates
available.
+4 -3
View File
@@ -188,7 +188,7 @@ class RigoServiceController(GObject.Object):
_NOTICEBOARDS_AVAILABLE_SIGNAL = "noticeboards_available"
_REPOS_SETTINGS_CHANGED_SIGNAL = "repositories_settings_changed"
_MIRRORS_OPTIMIZED_SIGNAL = "mirrors_optimized"
_SUPPORTED_APIS = [6, 7]
_SUPPORTED_APIS = [6, 7, 8]
def __init__(self, rigo_app, activity_rwsem,
entropy_client, entropy_ws):
@@ -914,11 +914,12 @@ class RigoServiceController(GObject.Object):
self._nc.append(box, timeout=20)
def _updates_available_signal(self, update, update_atoms, remove,
remove_atoms):
remove_atoms, one_click_update=False):
const_debug_write(
__name__,
"_updates_available_signal: "
"update: %s, remove: %s" % (update, remove,))
"update: %s, remove: %s, one_click_update: %s" % (
update, remove, one_click_update))
if not update:
return
update = [(int(x), self._dbus_to_unicode(y)) for x, y \