[gnome-control-center] user-accounts: Add "Disable icon" menu item



commit 747f48beb41a0e7e28f8788425f5490a7a97b4d1
Author: Bastien Nocera <hadess hadess net>
Date:   Sun Nov 21 03:14:37 2010 +0000

    user-accounts: Add "Disable icon" menu item
    
    When the faces/ directory cannot be loaded.

 panels/user-accounts/um-photo-dialog.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/panels/user-accounts/um-photo-dialog.c b/panels/user-accounts/um-photo-dialog.c
index acc42b0..d632948 100644
--- a/panels/user-accounts/um-photo-dialog.c
+++ b/panels/user-accounts/um-photo-dialog.c
@@ -375,11 +375,13 @@ setup_photo_popup (UmPhotoDialog *um)
         GDir *dir;
         const char *face;
         GError *error;
+        gboolean none_item_shown;
 
         menu = gtk_menu_new ();
 
         x = 0;
         y = 0;
+        none_item_shown = FALSE;
 
         error = NULL;
         dir = g_dir_open (DATADIR "/pixmaps/faces", 0, &error);
@@ -419,8 +421,20 @@ setup_photo_popup (UmPhotoDialog *um)
         g_signal_connect (G_OBJECT (menuitem), "activate",
                           G_CALLBACK (none_icon_selected), um);
         gtk_widget_show (menuitem);
+        none_item_shown = TRUE;
         y++;
 
+skip_faces:
+	if (!none_item_shown) {
+		menuitem = gtk_menu_item_new_with_label (_("Disable image"));
+		gtk_menu_attach (GTK_MENU (menu), GTK_WIDGET (menuitem),
+				 0, ROW_SPAN - 1, y, y + 1);
+		g_signal_connect (G_OBJECT (menuitem), "activate",
+				  G_CALLBACK (none_icon_selected), um);
+		gtk_widget_show (menuitem);
+		y++;
+	}
+
         /* Separator */
         menuitem = gtk_separator_menu_item_new ();
         gtk_menu_attach (GTK_MENU (menu), GTK_WIDGET (menuitem),
@@ -429,8 +443,6 @@ setup_photo_popup (UmPhotoDialog *um)
 
         y++;
 
-skip_faces:
-
 #ifdef HAVE_CHEESE
         um->take_photo_menuitem = gtk_menu_item_new_with_label (_("Take a photo..."));
         gtk_menu_attach (GTK_MENU (menu), GTK_WIDGET (um->take_photo_menuitem),



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