aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan LeSage <allanlesage@gmail.com>2012-03-28 17:29:05 -0500
committerAllan LeSage <allanlesage@gmail.com>2012-03-28 17:29:05 -0500
commitaffff0009831fc4765ba023ce044ca4d79ac0842 (patch)
tree42ae46b52973669c40016b1df7aa69c37a4bd4f3
parentd9416f4f284c401b8848e4bd249fd5cbd25142c3 (diff)
parent80f29374f243cd53e53bf662a0017cd4088d238a (diff)
downloadayatana-indicator-session-affff0009831fc4765ba023ce044ca4d79ac0842.tar.gz
ayatana-indicator-session-affff0009831fc4765ba023ce044ca4d79ac0842.tar.bz2
ayatana-indicator-session-affff0009831fc4765ba023ce044ca4d79ac0842.zip
Merged from trunk.
-rw-r--r--configure.ac2
-rw-r--r--src/apt-watcher.c25
-rw-r--r--src/device-menu-mgr.c7
-rw-r--r--src/indicator-session.c16
4 files changed, 25 insertions, 25 deletions
diff --git a/configure.ac b/configure.ac
index a6a7b05..21c2939 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@ AC_INIT(src/indicator-session.c)
AC_PREREQ(2.53)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(indicator-session, 0.3.92)
+AM_INIT_AUTOMAKE(indicator-session, 0.3.95)
AM_MAINTAINER_MODE
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
diff --git a/src/device-menu-mgr.c b/src/device-menu-mgr.c
index cfdb55d..d081937 100644
--- a/src/device-menu-mgr.c
+++ b/src/device-menu-mgr.c
@@ -166,11 +166,12 @@ keybinding_changed (GSettings *settings,
}
if (g_strcmp0 (key, KEY_LOCK_SCREEN) == 0) {
- g_debug("Keybinding changed to: %s", g_settings_get_string(settings, key));
+ gchar * val = g_settings_get_string(settings, key);
+ g_debug("Keybinding changed to: %s", val);
if (lock_menuitem != NULL) {
- dbusmenu_menuitem_property_set_shortcut_string (lock_menuitem,
- g_settings_get_string(settings, key));
+ dbusmenu_menuitem_property_set_shortcut_string (lock_menuitem, val);
}
+ g_free (val);
}
return;
}
diff --git a/src/indicator-session.c b/src/indicator-session.c
index 5d894e8..c6f4d9c 100644
--- a/src/indicator-session.c
+++ b/src/indicator-session.c
@@ -428,7 +428,7 @@ user_real_name_get_cb (GObject * obj, GAsyncResult * res, gpointer user_data)
}
const gchar* username = NULL;
- g_variant_get (result, "(s)", &username);
+ g_variant_get (result, "(&s)", &username);
indicator_session_update_users_label (self, username);
return;
}
@@ -481,7 +481,7 @@ receive_signal (GDBusProxy * proxy,
if (g_strcmp0(signal_name, "UserRealNameUpdated") == 0) {
const gchar* username = NULL;
- g_variant_get (parameters, "(s)", &username);
+ g_variant_get (parameters, "(&s)", &username);
indicator_session_update_users_label (self, username);
}
else if (g_strcmp0(signal_name, "UserMenuIsVisible") == 0) {
@@ -713,14 +713,8 @@ indicator_session_update_users_label (IndicatorSession* self,
}
GSettings* settings = g_settings_new ("com.canonical.indicator.session");
- gboolean use_name = g_settings_get_boolean (settings,
- "show-real-name-on-panel");
+ const gboolean use_name = g_settings_get_boolean (settings, "show-real-name-on-panel");
+ gtk_label_set_text (self->users.label, name);
+ gtk_widget_set_visible (GTK_WIDGET(self->users.label), use_name);
g_object_unref (settings);
- gtk_label_set_text (self->users.label, g_strdup(name));
- if (use_name){
- gtk_widget_show(GTK_WIDGET(self->users.label));
- }
- else{
- gtk_widget_hide(GTK_WIDGET(self->users.label));
- }
}