From 6f222333dd2c85a8023ed0e4b05c6ff7f74f3731 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 8 Mar 2012 14:26:42 +0100 Subject: src/apt-watcher.c: check the pk_results_get_require_restart_worst() in get_updates() too --- src/apt-watcher.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/apt-watcher.c') diff --git a/src/apt-watcher.c b/src/apt-watcher.c index c638a93..73ebdb9 100644 --- a/src/apt-watcher.c +++ b/src/apt-watcher.c @@ -52,6 +52,7 @@ get_updates_complete (GObject *source_object, AptWatcher* self = APT_WATCHER (user_data); PkResults *results; + PkRestartEnum restart_required; GError *error = NULL; results = pk_client_generic_finish (PK_CLIENT(source_object), res, &error); @@ -83,6 +84,20 @@ get_updates_complete (GObject *source_object, DBUSMENU_MENUITEM_PROP_LABEL, _("Software Up to Date")); } + + /* check if there was a restart required info in the signal */ + restart_required = pk_results_get_require_restart_worst (results); + if (restart_required == PK_RESTART_ENUM_SYSTEM || + restart_required == PK_RESTART_ENUM_SECURITY_SYSTEM) { + dbusmenu_menuitem_property_set (self->apt_item, + DBUSMENU_MENUITEM_PROP_LABEL, + _("Restart to Complete Updates…")); + dbusmenu_menuitem_property_set (self->apt_item, + DBUSMENU_MENUITEM_PROP_DISPOSITION, + DBUSMENU_MENUITEM_DISPOSITION_ALERT); + session_dbus_restart_required (self->session_dbus_interface); + } + g_ptr_array_unref (packages); g_object_unref (results); g_object_unref (source_object); -- cgit v1.2.3 From 9e862f15a1f4a86a0a5215c27d6d71905efebfd5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 8 Mar 2012 14:28:01 +0100 Subject: src/apt-watcher.c: remove no longer needed code, this RestartRequired is a bit misleading as it about that the PK daemon got restarted not about system or session --- src/apt-watcher.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'src/apt-watcher.c') diff --git a/src/apt-watcher.c b/src/apt-watcher.c index 73ebdb9..092942f 100644 --- a/src/apt-watcher.c +++ b/src/apt-watcher.c @@ -130,16 +130,6 @@ static void apt_watcher_signal_cb ( GDBusProxy* proxy, g_debug ("updates changed signal received"); apt_watcher_check_for_updates (self); } - else if (g_strcmp0(signal_name, "RestartSchedule") == 0) { - g_debug ("RestartScheduled signal received"); - dbusmenu_menuitem_property_set (self->apt_item, - DBUSMENU_MENUITEM_PROP_LABEL, - _("Restart to Complete Updates…")); - dbusmenu_menuitem_property_set (self->apt_item, - DBUSMENU_MENUITEM_PROP_DISPOSITION, - DBUSMENU_MENUITEM_DISPOSITION_ALERT); - session_dbus_restart_required (self->session_dbus_interface); - } } static void -- cgit v1.2.3