diff options
author | Sebastien Bacher <seb128@ubuntu.com> | 2012-03-09 13:39:35 +0100 |
---|---|---|
committer | Sebastien Bacher <seb128@ubuntu.com> | 2012-03-09 13:39:35 +0100 |
commit | cf87392e1e7facf24bb7e0766c7f4d2e075fda0a (patch) | |
tree | 3ee84320b38fa55ad8a8a1267b038c94387b84a9 | |
parent | 0b3dbda1d637d0809e8350a36b7b7b37fccce5dd (diff) | |
parent | 9e862f15a1f4a86a0a5215c27d6d71905efebfd5 (diff) | |
download | ayatana-indicator-session-cf87392e1e7facf24bb7e0766c7f4d2e075fda0a.tar.gz ayatana-indicator-session-cf87392e1e7facf24bb7e0766c7f4d2e075fda0a.tar.bz2 ayatana-indicator-session-cf87392e1e7facf24bb7e0766c7f4d2e075fda0a.zip |
Backport mvo's restart required fix, with the new aptdaemon that
should fix the issue for good (lp: #942104)
-rw-r--r-- | debian/changelog | 7 | ||||
-rw-r--r-- | src/apt-watcher.c | 25 |
2 files changed, 22 insertions, 10 deletions
diff --git a/debian/changelog b/debian/changelog index 1762aca..dba9618 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +indicator-session (0.3.92-0ubuntu3) UNRELEASED; urgency=low + + * Backport mvo's restart required fix, with the new aptdaemon that + should fix the issue for good (lp: #942104) + + -- Sebastien Bacher <seb128@ubuntu.com> Fri, 09 Mar 2012 13:38:37 +0100 + indicator-session (0.3.92-0ubuntu2) precise; urgency=low * Backport r243 and r244, should fix the restart required status update diff --git a/src/apt-watcher.c b/src/apt-watcher.c index c638a93..092942f 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); @@ -115,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 |