diff options
-rw-r--r-- | data/com.canonical.indicator.session.gschema.xml.in | 5 | ||||
-rw-r--r-- | src/indicator-session.c | 16 |
2 files changed, 17 insertions, 4 deletions
diff --git a/data/com.canonical.indicator.session.gschema.xml.in b/data/com.canonical.indicator.session.gschema.xml.in index eaebea1..0ef3d00 100644 --- a/data/com.canonical.indicator.session.gschema.xml.in +++ b/data/com.canonical.indicator.session.gschema.xml.in @@ -20,6 +20,11 @@ <_summary>Remove the shutdown item from the session menu</_summary> <_description>Makes it so that the shutdown button doesn’t show in the session menu.</_description> </key> + <key type="b" name="show-real-name-on-panel"> + <default>true</default> + <summary>Determine the visibility of the User's real name on the panel</summary> + <description>Allow for the Removal of the users name from the panel</description> + </key> <key type="b" name="user-show-menu"> <default>true</default> <summary>Determine the visibility of the User Menu</summary> diff --git a/src/indicator-session.c b/src/indicator-session.c index 20fc643..833d19b 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -703,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)); + } } |