aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-03-08 14:26:42 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2012-03-08 14:26:42 +0100
commit6f222333dd2c85a8023ed0e4b05c6ff7f74f3731 (patch)
treeebef1eee7287772eec6f15f404f9da0dba494ec5 /src
parent3c5b15aba9bb40ab8ef9c55df35941b67e52d31b (diff)
downloadayatana-indicator-session-6f222333dd2c85a8023ed0e4b05c6ff7f74f3731.tar.gz
ayatana-indicator-session-6f222333dd2c85a8023ed0e4b05c6ff7f74f3731.tar.bz2
ayatana-indicator-session-6f222333dd2c85a8023ed0e4b05c6ff7f74f3731.zip
src/apt-watcher.c: check the pk_results_get_require_restart_worst() in get_updates() too
Diffstat (limited to 'src')
-rw-r--r--src/apt-watcher.c15
1 files changed, 15 insertions, 0 deletions
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);