diff options
author | Sebastien Bacher <seb128@ubuntu.com> | 2011-09-09 11:15:41 +0200 |
---|---|---|
committer | Sebastien Bacher <seb128@ubuntu.com> | 2011-09-09 11:15:41 +0200 |
commit | fd2ef977b064cb3a91f772609906d6df714a0078 (patch) | |
tree | 163ff45190b22ceb4bcf0fc601867579e746dfe5 /src/indicator-session.c | |
parent | f0fea9a9edb4529aca7a81de11259122e5e6d72e (diff) | |
parent | 938c7103ae2b9ebdd2381d6b25ba430ac900ed55 (diff) | |
download | ayatana-indicator-session-fd2ef977b064cb3a91f772609906d6df714a0078.tar.gz ayatana-indicator-session-fd2ef977b064cb3a91f772609906d6df714a0078.tar.bz2 ayatana-indicator-session-fd2ef977b064cb3a91f772609906d6df714a0078.zip |
* New upstream release:
- fix the updates menu items randomly working (lp: #842946)
- "Guest Session should not show if guest session was disabled in
the display manager" (lp: #835084)
- segfault fix (lp: #840660)
- don't display temporary guest user generated username (lp: #844272)
- respect "show-real-name-on-panel" to hide the username (lp: #812728)
Diffstat (limited to 'src/indicator-session.c')
-rw-r--r-- | src/indicator-session.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/indicator-session.c b/src/indicator-session.c index 2f1764f..833d19b 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); } } @@ -538,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; } @@ -586,7 +593,6 @@ switch_property_change (DbusmenuMenuitem * item, gtk_label_set_ellipsize(label, PANGO_ELLIPSIZE_NONE); } } - return; } @@ -697,13 +703,21 @@ build_menu_switch (DbusmenuMenuitem * newitem, static void indicator_session_update_users_label (IndicatorSession* self, const gchar* name) -{ - g_debug ("update users label"); - +{ if (name == NULL){ gtk_widget_hide(GTK_WIDGET(self->users.label)); return; } + + GSettings* settings = g_settings_new ("com.canonical.indicator.session"); + gboolean use_name = g_settings_get_boolean (settings, + "show-real-name-on-panel"); + g_object_unref (settings); gtk_label_set_text (self->users.label, g_strdup(name)); - gtk_widget_show(GTK_WIDGET(self->users.label)); + if (use_name){ + gtk_widget_show(GTK_WIDGET(self->users.label)); + } + else{ + gtk_widget_hide(GTK_WIDGET(self->users.label)); + } } |