Handle Empty menu item in bookmarks and not in KatzeArrayAction

This commit is contained in:
Christian Dywan 2009-12-05 23:45:53 +01:00
parent ca6174ba6c
commit 9c40d3b5ba
2 changed files with 10 additions and 12 deletions

View file

@ -301,8 +301,8 @@ katze_array_action_generate_menu (KatzeArrayAction* array_action,
GtkWidget* menu,
GtkWidget* proxy)
{
guint i;
guint summand;
gint i;
gint summand;
KatzeItem* item;
GtkWidget* menuitem;
const gchar* icon_name;
@ -368,13 +368,6 @@ katze_array_action_generate_menu (KatzeArrayAction* array_action,
}
gtk_widget_show (menuitem);
}
if (!i)
{
menuitem = gtk_image_menu_item_new_with_label (_("Empty"));
gtk_widget_set_sensitive (menuitem, FALSE);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);
}
}
static void

View file

@ -2844,11 +2844,16 @@ _action_bookmarks_populate_popup (GtkAction* action,
}
g_list_free (children);
if (katze_array_get_nth_item (browser->bookmarks, 0))
{
menuitem = gtk_separator_menu_item_new ();
gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);
if (katze_array_is_empty (browser->bookmarks))
{
menuitem = gtk_image_menu_item_new_with_label (_("Empty"));
gtk_widget_set_sensitive (menuitem, FALSE);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);
}
menuitem = gtk_action_create_menu_item (
_action_by_name (browser, "BookmarksImport"));