menuitem = gtk_separator_menu_item_new ();
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);
- menuitem = sokoke_action_create_popup_menu_item (
+ menuitem = gtk_action_create_menu_item (
_action_by_name (browser, "TrashEmpty"));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);
GtkWidget* menuitem = gtk_separator_menu_item_new ();
gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);
- menuitem = sokoke_action_create_popup_menu_item (
+ menuitem = gtk_action_create_menu_item (
_action_by_name (browser, "BookmarkAdd"));
gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);
GtkWidget* menuitem = gtk_separator_menu_item_new ();
gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);
- menuitem = sokoke_action_create_popup_menu_item (
+ menuitem = gtk_action_create_menu_item (
_action_by_name (browser, "TabPrevious"));
gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);
- menuitem = sokoke_action_create_popup_menu_item (
+ menuitem = gtk_action_create_menu_item (
_action_by_name (browser, "TabNext"));
gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);
{ "About", GTK_STOCK_ABOUT,
NULL, "",
N_("Show information about the program"), G_CALLBACK (_action_about_activate) },
+ { "Dummy", NULL, "Dummy" },
};
static const guint entries_n = G_N_ELEMENTS (entries);
"<separator/>"
"<menuitem action='Find'/>"
"<menuitem action='FindNext'/>"
- "<menuitem action='FindPrevious'/>"
"<separator/>"
"<menuitem action='Preferences'/>"
"</menu>"
"<separator/>"
"<menuitem action='About'/>"
"</menu>"
+ /* For accelerators to work all actions need to be used
+ *somewhere* in the UI definition */
+ "<menu action='Dummy'>"
+ "<menuitem action='FindPrevious'/>"
+ "<menuitem action='TabPrevious'/>"
+ "<menuitem action='TabNext'/>"
+ "<menuitem action='TrashEmpty'/>"
+ "</menu>"
"</menubar>"
"<toolbar name='toolbar_navigation'>"
"</toolbar>"
{
GtkToolItem* toolitem;
GtkRcStyle* rcstyle;
+ GtkAction* action;
browser->settings = midori_web_settings_new ();
browser->proxy_array = katze_array_new (KATZE_TYPE_ARRAY);
g_error_free (error);
}
- GtkAction* action;
- /* Make all actions except toplevel menus which lack a callback insensitive
- This will vanish once all actions are implemented */
- guint i;
- for (i = 0; i < entries_n; i++)
- {
- action = gtk_action_group_get_action (browser->action_group,
- entries[i].name);
- gtk_action_set_sensitive (action,
- entries[i].callback || !entries[i].tooltip);
- }
- for (i = 0; i < toggle_entries_n; i++)
- {
- action = gtk_action_group_get_action (browser->action_group,
- toggle_entries[i].name);
- gtk_action_set_sensitive (action, toggle_entries[i].callback != NULL);
- }
-
/* _action_set_active(browser, "Transferbar", config->toolbarTransfers); */
+ /* Hide the 'Dummy' which only holds otherwise unused actions */
+ g_object_set (_action_by_name (browser, "Dummy"), "visible", FALSE, NULL);
+
action = g_object_new (MIDORI_TYPE_LOCATION_ACTION,
"name", "Location",
"label", _("_Location..."),
gtk_widget_show (menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (browser->menu_tools), menuitem);
gtk_widget_show (browser->menubar);
+ _action_set_sensitive (browser, "SaveAs", FALSE);
_action_set_sensitive (browser, "PrivateBrowsing", FALSE);
+ _action_set_sensitive (browser, "FindQuick", FALSE);
+ _action_set_sensitive (browser, "Transferbar", FALSE);
+ _action_set_sensitive (browser, "SelectionSourceView", FALSE);
/* Create the navigationbar */
browser->navigationbar = gtk_ui_manager_get_widget (