[gnome-flashback] Hiding the users name in the user menu



Hi,

I have been wanting to change this for some time now, but never found the time to go through the code and find the right place. The "User menu" creats a widget in the panel that shows an icon (either a computer or a speech bubble) plus the name of the currently logged in user. Since the user name can get very long and on my notebook I do not have that much screen real estate I would like to make this optional. After searching a bit through the code I came up with the following change:

Obviously I would need to save the show_user_name state somewhere and make it available through preferences. My question is, where would be a suitable place to save this?

--- a/gnome-panel/panel-menu-items.c
+++ b/gnome-panel/panel-menu-items.c
@@ -1725,7 +1725,11 @@ panel_desktop_menu_item_new (gboolean use_image,
     /* if we're in a menubar, we don't want to use setup_* as it changes
      * the size requests and can make the panels bigger than we'd like */
     if (in_menubar) {
-        gtk_menu_item_set_label (GTK_MENU_ITEM (menuitem), name);
+        gboolean show_user_name = FALSE;
+        if(show_user_name) {
+            gtk_menu_item_set_label (GTK_MENU_ITEM (menuitem), name);
+        } else {
+            gtk_menu_item_set_label (GTK_MENU_ITEM (menuitem), "");
+        }

Btw. the code concerning the applets is quite messy and not documented at all. If anyone wants to go and clean it up I would be happy to help.

Regards
Sebastian


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]