GtkWidget* menuitem;
menu = gtk_menu_new ();
+ menuitem = sokoke_action_create_popup_menu_item (
+ _action_by_name (browser, "Menubar"));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ gtk_widget_show (menuitem);
menuitem = sokoke_action_create_popup_menu_item (
_action_by_name (browser, "Navigationbar"));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
}
}
+static void
+_action_menubar_activate (GtkToggleAction* action,
+ MidoriBrowser* browser)
+{
+ gboolean active = gtk_toggle_action_get_active (action);
+ g_object_set (browser->settings, "show-menubar", active, NULL);
+ sokoke_widget_set_visible (browser->menubar, active);
+}
+
static void
_action_navigationbar_activate (GtkToggleAction* action,
MidoriBrowser* browser)
N_("Don't save any private data while browsing"), NULL/*G_CALLBACK (_action_private_browsing_activate)*/,
FALSE },
+ { "Menubar", NULL,
+ N_("_Menubar"), "",
+ N_("Show menubar"), G_CALLBACK (_action_menubar_activate),
+ FALSE },
{ "Navigationbar", NULL,
N_("_Navigationbar"), "",
N_("Show navigationbar"), G_CALLBACK (_action_navigationbar_activate),
"</menu>"
"<menu action='View'>"
"<menu action='Toolbars'>"
+ "<menuitem action='Menubar'/>"
"<menuitem action='Navigationbar'/>"
"<menuitem action='Bookmarkbar'/>"
"<menuitem action='Transferbar'/>"
menuitem = gtk_separator_menu_item_new ();
gtk_widget_show (menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (browser->menu_tools), menuitem);
- gtk_widget_show (browser->menubar);
+ gtk_widget_hide (browser->menubar);
+
_action_set_sensitive (browser, "SaveAs", FALSE);
_action_set_sensitive (browser, "PrivateBrowsing", FALSE);
_action_set_sensitive (browser, "FindQuick", FALSE);
gboolean remember_last_window_size;
gint last_window_width, last_window_height;
gint last_panel_position, last_panel_page;
- gboolean show_navigationbar, show_bookmarkbar, show_panel, show_statusbar;
+ gboolean show_menubar, show_navigationbar, show_bookmarkbar;
+ gboolean show_panel, show_statusbar;
MidoriToolbarStyle toolbar_style;
gchar* toolbar_items;
gint last_web_search;
"last-window-height", &last_window_height,
"last-panel-position", &last_panel_position,
"last-panel-page", &last_panel_page,
+ "show-menubar", &show_menubar,
"show-navigationbar", &show_navigationbar,
"show-bookmarkbar", &show_bookmarkbar,
"show-panel", &show_panel,
midori_view_set_uri (MIDORI_VIEW (browser->panel_pageholder),
last_pageholder_uri);
+ _action_set_active (browser, "Menubar", show_menubar);
_action_set_active (browser, "Navigationbar", show_navigationbar);
_action_set_active (browser, "Bookmarkbar", show_bookmarkbar);
_action_set_active (browser, "Panel", show_panel);
gint last_web_search;
gchar* last_pageholder_uri;
+ gboolean show_menubar;
gboolean show_navigationbar;
gboolean show_bookmarkbar;
gboolean show_panel;
PROP_LAST_WEB_SEARCH,
PROP_LAST_PAGEHOLDER_URI,
+ PROP_SHOW_MENUBAR,
PROP_SHOW_NAVIGATIONBAR,
PROP_SHOW_BOOKMARKBAR,
PROP_SHOW_PANEL,
flags));
+ g_object_class_install_property (gobject_class,
+ PROP_SHOW_MENUBAR,
+ g_param_spec_boolean (
+ "show-menubar",
+ _("Show Menubar"),
+ _("Whether to show the menubar"),
+ TRUE,
+ flags));
g_object_class_install_property (gobject_class,
PROP_SHOW_NAVIGATIONBAR,
katze_assign (web_settings->last_pageholder_uri, g_value_dup_string (value));
break;
+ case PROP_SHOW_MENUBAR:
+ web_settings->show_menubar = g_value_get_boolean (value);
+ break;
case PROP_SHOW_NAVIGATIONBAR:
web_settings->show_navigationbar = g_value_get_boolean (value);
break;
g_value_set_string (value, web_settings->last_pageholder_uri);
break;
+ case PROP_SHOW_MENUBAR:
+ g_value_set_boolean (value, web_settings->show_menubar);
+ break;
case PROP_SHOW_NAVIGATIONBAR:
g_value_set_boolean (value, web_settings->show_navigationbar);
break;
return web_settings;
}
-
-/**
- * midori_web_settings_copy:
- *
- * Copies an existing #MidoriWebSettings instance.
- *
- * Return value: a new #MidoriWebSettings
- **/
-MidoriWebSettings*
-midori_web_settings_copy (MidoriWebSettings* web_settings)
-{
- g_return_val_if_fail (MIDORI_IS_WEB_SETTINGS (web_settings), NULL);
-
- MidoriWebSettings* copy;
- copy = MIDORI_WEB_SETTINGS (webkit_web_settings_copy (
- WEBKIT_WEB_SETTINGS (web_settings)));
- g_object_set (copy,
- "load-on-startup", web_settings->load_on_startup,
- "homepage", web_settings->homepage,
- "download-folder", web_settings->download_folder,
- "download-manager", web_settings->download_manager,
- "location-entry-search", web_settings->location_entry_search,
- "preferred-encoding", web_settings->preferred_encoding,
-
- "toolbar-style", web_settings->toolbar_style,
- "toolbar-items", web_settings->toolbar_items,
- "show-web-search", web_settings->show_web_search,
- "show-new-tab", web_settings->show_new_tab,
- "show-trash", web_settings->show_trash,
-
- "close-buttons-on-tabs", web_settings->close_buttons_on_tabs,
- "open-new-pages-in", web_settings->open_new_pages_in,
- "middle-click-opens-selection", web_settings->middle_click_opens_selection,
- "open-tabs-in-the-background", web_settings->open_tabs_in_the_background,
- "open-popups-in-tabs", web_settings->open_popups_in_tabs,
-
- "accept-cookies", web_settings->accept_cookies,
- "original-cookies-only", web_settings->original_cookies_only,
- "maximum-cookie-age", web_settings->maximum_cookie_age,
-
- "remember-last-visited-pages", web_settings->remember_last_visited_pages,
- "maximum-history-age", web_settings->maximum_history_age,
- "remember-last-form-inputs", web_settings->remember_last_form_inputs,
- "remember-last-downloaded-files", web_settings->remember_last_downloaded_files,
-
- "cache-size", web_settings->cache_size,
- NULL);
-
- return copy;
-}
MidoriWebSettings*
midori_web_settings_new (void);
-MidoriWebSettings*
-midori_web_settings_copy (MidoriWebSettings* web_settings);
-
G_END_DECLS
#endif /* __MIDORI_WEB_SETTINGS_H__ */
"sensitive", &sensitive,
"visible", &visible,
NULL);
- if (stock_id)
+ if (GTK_IS_TOGGLE_ACTION (action))
+ {
+ menuitem = gtk_check_menu_item_new_with_mnemonic (label);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem),
+ gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
+ }
+ else if (stock_id)
{
if (label)
{