From e1a933792dbf2114d66a3132d2ce29107ed25130 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 31 Aug 2011 13:09:57 +0100 Subject: apt race condition handled --- src/indicator-session.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/indicator-session.c') diff --git a/src/indicator-session.c b/src/indicator-session.c index fab47b3..0f44a36 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -499,6 +499,7 @@ receive_signal (GDBusProxy * proxy, } else if (g_strcmp0(signal_name, "RebootRequired") == 0) { // TODO waiting on design to give me a name. + g_debug ("Reboot required, icon changed to %s", ICON_RESTART); self->devices.image = indicator_image_helper (ICON_RESTART); } } -- cgit v1.2.3 From 254ca429137d15b4814b171c96a7d92f1a46b2da Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 31 Aug 2011 13:19:38 +0100 Subject: restart signal actually being sent now properly --- src/indicator-session.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/indicator-session.c') diff --git a/src/indicator-session.c b/src/indicator-session.c index 0f44a36..3b5a7c3 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -497,8 +497,7 @@ receive_signal (GDBusProxy * proxy, &self->users); } } - else if (g_strcmp0(signal_name, "RebootRequired") == 0) { - // TODO waiting on design to give me a name. + else if (g_strcmp0(signal_name, "RestartRequired") == 0) { g_debug ("Reboot required, icon changed to %s", ICON_RESTART); self->devices.image = indicator_image_helper (ICON_RESTART); } -- cgit v1.2.3 From 55a161683098d17364d9f521d2f4b97f89298297 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 31 Aug 2011 14:32:07 +0100 Subject: tidy up --- src/indicator-session.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/indicator-session.c') diff --git a/src/indicator-session.c b/src/indicator-session.c index 3b5a7c3..aacef49 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -498,7 +498,6 @@ receive_signal (GDBusProxy * proxy, } } else if (g_strcmp0(signal_name, "RestartRequired") == 0) { - g_debug ("Reboot required, icon changed to %s", ICON_RESTART); self->devices.image = indicator_image_helper (ICON_RESTART); } } -- cgit v1.2.3 From 383e28467156675a5c1231c37eafb2a7bbc6e4f2 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 1 Sep 2011 18:23:35 +0100 Subject: much easier of handling the greeter icon --- src/indicator-session.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/indicator-session.c') diff --git a/src/indicator-session.c b/src/indicator-session.c index aacef49..2b36fdd 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -164,10 +164,19 @@ indicator_session_init (IndicatorSession *self) self->users.label = GTK_LABEL (gtk_label_new (NULL)); + const gchar *greeter_var; + greeter_var = g_getenv("INDICATOR_GREETER_MODE"); + // devices self->devices.menu = GTK_MENU (dbusmenu_gtkmenu_new(INDICATOR_SESSION_DBUS_NAME, INDICATOR_SESSION_DBUS_OBJECT)); - self->devices.image = indicator_image_helper (ICON_DEFAULT); + if (g_strcmp0(greeter_var, "1") == 0){ + self->devices.image = indicator_image_helper (GREETER_ICON_DEFAULT); + } + else{ + self->devices.image = indicator_image_helper (ICON_DEFAULT); + } + gtk_widget_show (GTK_WIDGET(self->devices.menu)); gtk_widget_show (GTK_WIDGET(self->devices.image)); -- cgit v1.2.3 From a335b8e973287fa5cf60286bb6fd8f46fb66ad83 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 2 Sep 2011 12:11:13 +0100 Subject: make sure to flag restart state in greeter mode also with the right icon --- src/indicator-session.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/indicator-session.c') diff --git a/src/indicator-session.c b/src/indicator-session.c index 2b36fdd..7a8a238 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -70,6 +70,8 @@ struct _IndicatorSession { GDBusProxy * service_proxy; }; +static gboolean greeter_mode; + GType indicator_session_get_type (void); /* Indicator stuff */ @@ -166,11 +168,11 @@ indicator_session_init (IndicatorSession *self) const gchar *greeter_var; greeter_var = g_getenv("INDICATOR_GREETER_MODE"); - + greeter_mode = g_strcmp0(greeter_var, "1") == 0; // devices self->devices.menu = GTK_MENU (dbusmenu_gtkmenu_new(INDICATOR_SESSION_DBUS_NAME, INDICATOR_SESSION_DBUS_OBJECT)); - if (g_strcmp0(greeter_var, "1") == 0){ + if (greeter_mode){ self->devices.image = indicator_image_helper (GREETER_ICON_DEFAULT); } else{ @@ -507,7 +509,12 @@ receive_signal (GDBusProxy * proxy, } } else if (g_strcmp0(signal_name, "RestartRequired") == 0) { - self->devices.image = indicator_image_helper (ICON_RESTART); + if (greeter_mode == TRUE){ + self->devices.image = indicator_image_helper (GREETER_ICON_RESTART); + } + else{ + self->devices.image = indicator_image_helper (ICON_RESTART); + } } } -- cgit v1.2.3 From 3f39e981fdbe934faf762de161645edd5eba753f Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 2 Sep 2011 16:16:09 +0100 Subject: remove the greeter icon stuff --- src/indicator-session.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/indicator-session.c') diff --git a/src/indicator-session.c b/src/indicator-session.c index 2b36fdd..aacef49 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -164,19 +164,10 @@ indicator_session_init (IndicatorSession *self) self->users.label = GTK_LABEL (gtk_label_new (NULL)); - const gchar *greeter_var; - greeter_var = g_getenv("INDICATOR_GREETER_MODE"); - // devices self->devices.menu = GTK_MENU (dbusmenu_gtkmenu_new(INDICATOR_SESSION_DBUS_NAME, INDICATOR_SESSION_DBUS_OBJECT)); - if (g_strcmp0(greeter_var, "1") == 0){ - self->devices.image = indicator_image_helper (GREETER_ICON_DEFAULT); - } - else{ - self->devices.image = indicator_image_helper (ICON_DEFAULT); - } - + self->devices.image = indicator_image_helper (ICON_DEFAULT); gtk_widget_show (GTK_WIDGET(self->devices.menu)); gtk_widget_show (GTK_WIDGET(self->devices.image)); -- cgit v1.2.3 From 46db1068e1684293f02125872361f75204399e8f Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 6 Sep 2011 17:59:18 +0100 Subject: refactor the apt state callback because the use case of real and simulation were proving far too disparate --- src/indicator-session.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/indicator-session.c') diff --git a/src/indicator-session.c b/src/indicator-session.c index 2f1764f..f41c841 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -507,11 +507,12 @@ receive_signal (GDBusProxy * proxy, &self->users); } } - else if (g_strcmp0(signal_name, "RestartRequired") == 0) { + else if (g_strcmp0(signal_name, "RestartRequired") == 0) { if (greeter_mode == TRUE){ self->devices.image = indicator_image_helper (GREETER_ICON_RESTART); } else{ + g_debug ("reboot required"); self->devices.image = indicator_image_helper (ICON_RESTART); } } -- cgit v1.2.3 From 6174b1bac576198e5d3df35f93971598937e71c6 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 8 Sep 2011 14:01:36 +0100 Subject: user correct string on switch item unless user actually wants to show username --- src/indicator-session.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/indicator-session.c') diff --git a/src/indicator-session.c b/src/indicator-session.c index f41c841..20fc643 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -539,10 +539,16 @@ switch_property_change (DbusmenuMenuitem * item, if (g_strcmp0(translate, "1") != 0) { no_name_in_lang = TRUE; } + + GSettings* settings = g_settings_new ("com.canonical.indicator.session"); + gboolean use_username = g_settings_get_boolean (settings, + "use-username-in-switch-item"); + g_object_unref (settings); if (variant == NULL || g_variant_get_string(variant, NULL) == NULL || - g_variant_get_string(variant, NULL)[0] == '\0' || no_name_in_lang) { - finalstring = _("Switch User…"); + g_variant_get_string(variant, NULL)[0] == '\0' || no_name_in_lang + || use_username == FALSE) { + finalstring = _("Switch User Account…"); set_ellipsize = FALSE; } @@ -587,7 +593,6 @@ switch_property_change (DbusmenuMenuitem * item, gtk_label_set_ellipsize(label, PANGO_ELLIPSIZE_NONE); } } - return; } -- cgit v1.2.3 From d446a9d9bf96e5d3dd9b6065adceb1aeb25fcd98 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 8 Sep 2011 18:30:52 +0100 Subject: add the new gsettings entry for toggling the visibility of the real name on the panel --- src/indicator-session.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/indicator-session.c') diff --git a/src/indicator-session.c b/src/indicator-session.c index f41c841..1f58aba 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -705,6 +705,7 @@ indicator_session_update_users_label (IndicatorSession* self, gtk_widget_hide(GTK_WIDGET(self->users.label)); return; } + gtk_label_set_text (self->users.label, g_strdup(name)); gtk_widget_show(GTK_WIDGET(self->users.label)); } -- cgit v1.2.3