From bba875c634ffc912f08e29aa94e3bb3762f505d8 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 4 Jul 2010 11:14:30 +0200 Subject: [PATCH] Remove "Bookmarks" action from the menubar --- midori/midori-browser.c | 85 ++--------------------------------------- 1 file changed, 4 insertions(+), 81 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 7397a987..a9d2e709 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -2562,7 +2562,7 @@ midori_browser_get_toolbar_actions (MidoriBrowser* browser) { static const gchar* actions[] = { "WindowNew", "TabNew", "Open", "SaveAs", "Print", "Find", - "Fullscreen", "Preferences", "Window", "Bookmarks", + "Fullscreen", "Preferences", "Window", "RecentlyVisited", "ReloadStop", "ZoomIn", "TabClose", "ZoomOut", "Separator", "Back", "Forward", "Homepage", "Panel", "Trash", "Search", "BookmarkAdd", "Previous", "Next", NULL }; @@ -2791,54 +2791,6 @@ _action_history_activate_item (GtkAction* action, midori_browser_set_current_uri (browser, katze_item_get_uri (item)); } -static void -_action_bookmarks_populate_popup (GtkAction* action, - GtkMenu* menu, - MidoriBrowser* browser) -{ - GList* children = gtk_container_get_children (GTK_CONTAINER (menu)); - guint i = 0; - GtkWidget* menuitem; - - while ((menuitem = g_list_nth_data (children, i++))) - { - g_signal_connect (menuitem, "select", - G_CALLBACK (midori_browser_menu_item_select_cb), browser); - g_signal_connect (menuitem, "deselect", - G_CALLBACK (midori_browser_menu_item_deselect_cb), browser); - } - g_list_free (children); - - 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, "BookmarksExport")); - gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem); - gtk_widget_show (menuitem); - menuitem = gtk_action_create_menu_item ( - _action_by_name (browser, "BookmarksImport")); - 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); - gtk_widget_show (menuitem); -} - /* static */ void midori_browser_open_bookmark (MidoriBrowser* browser, KatzeItem* item) @@ -2865,14 +2817,6 @@ midori_browser_open_bookmark (MidoriBrowser* browser, g_free (uri_fixed); } -static void -_action_bookmarks_activate_item (GtkAction* action, - KatzeItem* item, - MidoriBrowser* browser) -{ - midori_browser_open_bookmark (browser, item); -} - static void _action_tools_populate_popup (GtkAction* action, GtkMenu* menu, @@ -5302,6 +5246,8 @@ static const gchar* ui_markup = "" "" "" + "" + "" "" "" "" @@ -5366,7 +5312,6 @@ static const gchar* ui_markup = "" "" "" - "" "" "" "" @@ -5386,8 +5331,6 @@ static const gchar* ui_markup = "" "" "" - "" - "" "" "" "" @@ -5802,23 +5745,6 @@ midori_browser_init (MidoriBrowser* browser) gtk_action_group_add_action_with_accel (browser->action_group, action, ""); g_object_unref (action); - action = g_object_new (KATZE_TYPE_ARRAY_ACTION, - "name", "Bookmarks", - "label", _("_Bookmarks"), - "stock-id", STOCK_BOOKMARKS, - "tooltip", _("Show the saved bookmarks"), - NULL); - g_object_connect (action, - "signal::populate-popup", - _action_bookmarks_populate_popup, browser, - "signal::activate-item", - _action_bookmarks_activate_item, browser, - "signal::activate-item-alt", - _action_menus_activate_item_alt, browser, - NULL); - gtk_action_group_add_action_with_accel (browser->action_group, action, ""); - g_object_unref (action); - action = g_object_new (KATZE_TYPE_ARRAY_ACTION, "name", "Tools", "label", _("_Tools"), @@ -6473,7 +6399,7 @@ midori_bookmarkbar_insert_item (GtkWidget* toolbar, MidoriBrowser* browser = midori_browser_get_for_widget (toolbar); toolitem = katze_array_action_create_tool_item_for ( - KATZE_ARRAY_ACTION (_action_by_name (browser, "Bookmarks")), item); + KATZE_ARRAY_ACTION (_action_by_name (browser, "Tools")), item); g_object_set_data (G_OBJECT (toolitem), "KatzeItem", item); if (KATZE_IS_ITEM (item)) @@ -6587,9 +6513,6 @@ midori_browser_set_bookmarks (MidoriBrowser* browser, katze_object_assign (browser->bookmarks, bookmarks); } - g_object_set (_action_by_name (browser, "Bookmarks"), "array", - browser->bookmarks, NULL); - settings = midori_browser_get_settings (browser); g_signal_connect (settings, "notify::show-bookmarkbar", G_CALLBACK (midori_browser_show_bookmarkbar_notify_value_cb), browser); -- 2.39.5