{
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 };
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)
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,
"<menuitem action='WindowClose'/>"
"<separator/>"
"<menuitem action='Print'/>"
+ "<menuitem action='BookmarksImport'/>"
+ "<menuitem action='BookmarksExport'/>"
"<separator/>"
"<menuitem action='Quit'/>"
"</menu>"
"<menuitem action='Trash'/>"
"<menuitem action='RecentlyVisited'/>"
"</menu>"
- "<menuitem action='Bookmarks'/>"
"<menuitem action='Tools'/>"
"<menuitem action='Window'/>"
"<menu action='Help'>"
"<menuitem action='FindPrevious'/>"
"<menuitem action='BookmarkAdd'/>"
"<menuitem action='BookmarkFolderAdd'/>"
- "<menuitem action='BookmarksImport'/>"
- "<menuitem action='BookmarksExport'/>"
"<menuitem action='ManageSearchEngines'/>"
"<menuitem action='ClearPrivateData'/>"
"<menuitem action='TabPrevious'/>"
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"),
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))
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);