Handle Empty menu item in bookmarks and not in KatzeArrayAction
This commit is contained in:
parent
ca6174ba6c
commit
9c40d3b5ba
2 changed files with 10 additions and 12 deletions
|
@ -301,8 +301,8 @@ katze_array_action_generate_menu (KatzeArrayAction* array_action,
|
||||||
GtkWidget* menu,
|
GtkWidget* menu,
|
||||||
GtkWidget* proxy)
|
GtkWidget* proxy)
|
||||||
{
|
{
|
||||||
guint i;
|
gint i;
|
||||||
guint summand;
|
gint summand;
|
||||||
KatzeItem* item;
|
KatzeItem* item;
|
||||||
GtkWidget* menuitem;
|
GtkWidget* menuitem;
|
||||||
const gchar* icon_name;
|
const gchar* icon_name;
|
||||||
|
@ -368,13 +368,6 @@ katze_array_action_generate_menu (KatzeArrayAction* array_action,
|
||||||
}
|
}
|
||||||
gtk_widget_show (menuitem);
|
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
|
static void
|
||||||
|
|
|
@ -2844,11 +2844,16 @@ _action_bookmarks_populate_popup (GtkAction* action,
|
||||||
}
|
}
|
||||||
g_list_free (children);
|
g_list_free (children);
|
||||||
|
|
||||||
if (katze_array_get_nth_item (browser->bookmarks, 0))
|
|
||||||
{
|
|
||||||
menuitem = gtk_separator_menu_item_new ();
|
menuitem = gtk_separator_menu_item_new ();
|
||||||
gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem);
|
gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem);
|
||||||
gtk_widget_show (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 (
|
menuitem = gtk_action_create_menu_item (
|
||||||
_action_by_name (browser, "BookmarksImport"));
|
_action_by_name (browser, "BookmarksImport"));
|
||||||
|
|
Loading…
Reference in a new issue