From: Christian Dywan Date: Fri, 10 Apr 2009 20:28:36 +0000 (+0200) Subject: Add an 'Add new folder' menu item to Bookmarks menu X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=deb92e515862489679b18da179e475eda8ad821e;p=midori Add an 'Add new folder' menu item to Bookmarks menu --- diff --git a/midori/midori-browser.c b/midori/midori-browser.c index c60b4cda..3bb38b6b 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -2082,6 +2082,10 @@ _action_bookmarks_populate_popup (GtkAction* action, gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem); gtk_widget_show (menuitem); } + menuitem = gtk_action_create_menu_item ( + _action_by_name (browser, "BookmarkFolderAdd")); + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem); + gtk_widget_show (menuitem); menuitem = gtk_action_create_menu_item ( _action_by_name (browser, "BookmarkAdd")); gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem); @@ -2916,6 +2920,13 @@ _action_bookmark_add_activate (GtkAction* action, midori_browser_edit_bookmark_dialog_new (browser, NULL, TRUE, FALSE); } +static void +_action_bookmark_folder_add_activate (GtkAction* action, + MidoriBrowser* browser) +{ + midori_browser_edit_bookmark_dialog_new (browser, NULL, TRUE, TRUE); +} + static void _action_manage_search_engines_activate (GtkAction* action, MidoriBrowser* browser) @@ -3350,6 +3361,9 @@ static const GtkActionEntry entries[] = { { "BookmarkAdd", STOCK_BOOKMARK_ADD, NULL, "d", N_("Add a new bookmark"), G_CALLBACK (_action_bookmark_add_activate) }, + { "BookmarkFolderAdd", GTK_STOCK_DIRECTORY, + N_("Add a new folder"), "", + N_("Add a new bookmark folder"), G_CALLBACK (_action_bookmark_folder_add_activate) }, { "Tools", NULL, N_("_Tools") }, { "ManageSearchEngines", GTK_STOCK_PROPERTIES, N_("_Manage Search Engines"), "s", @@ -3585,6 +3599,7 @@ static const gchar* ui_markup = "" "" "" + "" "" "" "" @@ -4545,6 +4560,7 @@ midori_browser_set_bookmarks (MidoriBrowser* browser, browser->bookmarks, NULL); _action_set_sensitive (browser, "BookmarkAdd", FALSE); + _action_set_sensitive (browser, "BookmarkFolderAdd", FALSE); if (!browser->bookmarks) return; @@ -4558,6 +4574,7 @@ midori_browser_set_bookmarks (MidoriBrowser* browser, G_CALLBACK (browser_bookmarks_remove_item_cb), browser); _action_set_sensitive (browser, "BookmarkAdd", TRUE); + _action_set_sensitive (browser, "BookmarkFolderAdd", TRUE); } static void