Move translations out of settings class

Remove a fair number of unnecessary strings.
Move trivial settings to Midori.Settings.
This commit is contained in:
Christian Dywan 2012-08-31 21:52:02 +02:00
parent fd49037ae6
commit aa5d387cc7
6 changed files with 115 additions and 755 deletions

View file

@ -810,6 +810,7 @@ katze_property_proxy (gpointer object,
G_CALLBACK (proxy_entry_focus_out_event_cb), object); G_CALLBACK (proxy_entry_focus_out_event_cb), object);
g_object_set_data_full (G_OBJECT (entry), "property", g_object_set_data_full (G_OBJECT (entry), "property",
g_strdup (custom), g_free); g_strdup (custom), g_free);
gtk_widget_set_tooltip_text (widget, NULL);
} }
else else
gtk_widget_set_tooltip_text (widget, custom_text); gtk_widget_set_tooltip_text (widget, custom_text);
@ -827,8 +828,6 @@ katze_property_proxy (gpointer object,
widget = gtk_label_new (gettext (nick)); widget = gtk_label_new (gettext (nick));
g_free (string); g_free (string);
if (!gtk_widget_get_tooltip_text (widget))
gtk_widget_set_tooltip_text (widget, g_param_spec_get_blurb (pspec));
gtk_widget_set_sensitive (widget, pspec->flags & G_PARAM_WRITABLE); gtk_widget_set_sensitive (widget, pspec->flags & G_PARAM_WRITABLE);
g_object_set_data_full (G_OBJECT (widget), "property", g_object_set_data_full (G_OBJECT (widget), "property",
@ -869,14 +868,8 @@ katze_property_label (gpointer object,
return gtk_label_new (property); return gtk_label_new (property);
} }
#ifdef HAVE_HILDON_2_2
if (G_PARAM_SPEC_TYPE (pspec) == G_TYPE_PARAM_ENUM)
return gtk_label_new (NULL);
#endif
nick = g_param_spec_get_nick (pspec); nick = g_param_spec_get_nick (pspec);
widget = gtk_label_new (nick); widget = gtk_label_new (nick);
gtk_widget_set_tooltip_text (widget, g_param_spec_get_blurb (pspec));
gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5); gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
return widget; return widget;

View file

@ -694,12 +694,17 @@ midori_browser_privacy_preferences_cb (MidoriBrowser* browser,
katze_preferences_add_category (preferences, _("Privacy"), GTK_STOCK_INDEX); katze_preferences_add_category (preferences, _("Privacy"), GTK_STOCK_INDEX);
katze_preferences_add_group (preferences, NULL); katze_preferences_add_group (preferences, NULL);
button = katze_property_label (settings, "maximum-cookie-age"); button = gtk_label_new (_("Delete old Cookies after:"));
gtk_misc_set_alignment (GTK_MISC (button), 0.0, 0.5);
gtk_widget_set_tooltip_text (button, _("The maximum number of days to save cookies for"));
katze_preferences_add_widget (preferences, button, "indented"); katze_preferences_add_widget (preferences, button, "indented");
button = katze_property_proxy (settings, "maximum-cookie-age", "days"); button = katze_property_proxy (settings, "maximum-cookie-age", "days");
gtk_widget_set_tooltip_text (button, _("The maximum number of days to save cookies for"));
katze_preferences_add_widget (preferences, button, "spanned"); katze_preferences_add_widget (preferences, button, "spanned");
#ifdef HAVE_LIBSOUP_2_29_91 #ifdef HAVE_LIBSOUP_2_29_91
button = katze_property_proxy (settings, "first-party-cookies-only", NULL); button = katze_property_proxy (settings, "first-party-cookies-only", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Only accept Cookies from sites you visit"));
gtk_widget_set_tooltip_text (button, _("Block cookies sent by third-party websites"));
katze_preferences_add_widget (preferences, button, "filled"); katze_preferences_add_widget (preferences, button, "filled");
#endif #endif
@ -711,15 +716,24 @@ midori_browser_privacy_preferences_cb (MidoriBrowser* browser,
g_free (markup); g_free (markup);
katze_preferences_add_widget (preferences, label, "filled"); katze_preferences_add_widget (preferences, label, "filled");
button = katze_property_proxy (settings, "enable-offline-web-application-cache", NULL); button = katze_property_proxy (settings, "enable-offline-web-application-cache", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Enable offline web application cache"));
katze_preferences_add_widget (preferences, button, "indented"); katze_preferences_add_widget (preferences, button, "indented");
button = katze_property_proxy (settings, "enable-html5-local-storage", NULL); button = katze_property_proxy (settings, "enable-html5-local-storage", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Enable HTML5 local storage support"));
katze_preferences_add_widget (preferences, button, "spanned"); katze_preferences_add_widget (preferences, button, "spanned");
button = katze_property_proxy (settings, "strip-referer", NULL); button = katze_property_proxy (settings, "strip-referer", NULL);
/* i18n: Reworded: Shorten details propagated when going to another page */
gtk_button_set_label (GTK_BUTTON (button), _("Strip referrer details sent to websites"));
/* i18n: Referer here is not a typo but a technical term */
gtk_widget_set_tooltip_text (button, _("Whether the \"Referer\" header should be shortened to the hostname"));
katze_preferences_add_widget (preferences, button, "indented"); katze_preferences_add_widget (preferences, button, "indented");
katze_preferences_add_widget (preferences, gtk_label_new (NULL), "indented"); katze_preferences_add_widget (preferences, gtk_label_new (NULL), "indented");
button = katze_property_label (settings, "maximum-history-age"); button = gtk_label_new (_("Delete pages from history after:"));
gtk_misc_set_alignment (GTK_MISC (button), 0.0, 0.5);
gtk_widget_set_tooltip_text (button, _("The maximum number of days to save the history for"));
katze_preferences_add_widget (preferences, button, "indented"); katze_preferences_add_widget (preferences, button, "indented");
button = katze_property_proxy (settings, "maximum-history-age", "days"); button = katze_property_proxy (settings, "maximum-history-age", "days");
gtk_widget_set_tooltip_text (button, _("The maximum number of days to save the history for"));
katze_preferences_add_widget (preferences, button, "spanned"); katze_preferences_add_widget (preferences, button, "spanned");
} }
@ -1110,6 +1124,7 @@ midori_show_diagnostic_dialog (MidoriWebSettings* settings,
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 4); gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 4);
gtk_widget_show_all (align); gtk_widget_show_all (align);
button = katze_property_proxy (settings, "show-crash-dialog", NULL); button = katze_property_proxy (settings, "show-crash-dialog", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Show a dialog after Midori crashed"));
gtk_widget_show (button); gtk_widget_show (button);
gtk_container_add (GTK_CONTAINER (content_area), button); gtk_container_add (GTK_CONTAINER (content_area), button);
gtk_container_set_focus_child (GTK_CONTAINER (dialog), gtk_dialog_get_action_area (GTK_DIALOG (dialog))); gtk_container_set_focus_child (GTK_CONTAINER (dialog), gtk_dialog_get_action_area (GTK_DIALOG (dialog)));

View file

@ -302,7 +302,8 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
INDENTED_ADD (label); INDENTED_ADD (label);
button = katze_property_proxy (settings, "load-on-startup", NULL); button = katze_property_proxy (settings, "load-on-startup", NULL);
SPANNED_ADD (button); SPANNED_ADD (button);
label = katze_property_label (settings, "homepage"); label = gtk_label_new (_("Homepage:"));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
INDENTED_ADD (label); INDENTED_ADD (label);
entry = katze_property_proxy (settings, "homepage", "address"); entry = katze_property_proxy (settings, "homepage", "address");
SPANNED_ADD (entry); SPANNED_ADD (entry);
@ -362,8 +363,10 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
FRAME_NEW (NULL); FRAME_NEW (NULL);
#if !HAVE_HILDON #if !HAVE_HILDON
button = katze_property_proxy (settings, "auto-load-images", NULL); button = katze_property_proxy (settings, "auto-load-images", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Load images automatically"));
INDENTED_ADD (button); INDENTED_ADD (button);
button = katze_property_proxy (settings, "enable-spell-checking", NULL); button = katze_property_proxy (settings, "enable-spell-checking", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Enable Spell Checking"));
SPANNED_ADD (button); SPANNED_ADD (button);
/* Disable spell check option if there are no enchant modules */ /* Disable spell check option if there are no enchant modules */
{ {
@ -377,11 +380,15 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
g_free (enchant_path); g_free (enchant_path);
} }
button = katze_property_proxy (settings, "enable-scripts", NULL); button = katze_property_proxy (settings, "enable-scripts", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Enable scripts"));
INDENTED_ADD (button); INDENTED_ADD (button);
button = katze_property_proxy (settings, "enable-plugins", NULL); button = katze_property_proxy (settings, "enable-plugins", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Enable Netscape plugins"));
gtk_widget_set_sensitive (button, midori_web_settings_has_plugin_support ());
SPANNED_ADD (button); SPANNED_ADD (button);
#endif #endif
button = katze_property_proxy (settings, "zoom-text-and-images", NULL); button = katze_property_proxy (settings, "zoom-text-and-images", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Zoom Text and Images"));
INDENTED_ADD (button); INDENTED_ADD (button);
button = katze_property_proxy (settings, "javascript-can-open-windows-automatically", NULL); button = katze_property_proxy (settings, "javascript-can-open-windows-automatically", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Allow scripts to open popups")); gtk_button_set_label (GTK_BUTTON (button), _("Allow scripts to open popups"));
@ -389,17 +396,27 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
SPANNED_ADD (button); SPANNED_ADD (button);
if (katze_widget_has_touchscreen_mode (parent ? if (katze_widget_has_touchscreen_mode (parent ?
GTK_WIDGET (parent) : GTK_WIDGET (preferences))) GTK_WIDGET (parent) : GTK_WIDGET (preferences)))
{
button = katze_property_proxy (settings, "kinetic-scrolling", NULL); button = katze_property_proxy (settings, "kinetic-scrolling", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Kinetic scrolling"));
gtk_widget_set_tooltip_text (button, _("Whether scrolling should kinetically move according to speed"));
}
else else
{
button = katze_property_proxy (settings, "middle-click-opens-selection", NULL); button = katze_property_proxy (settings, "middle-click-opens-selection", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Middle click opens Selection"));
gtk_widget_set_tooltip_text (button, _("Load an address from the selection via middle click"));
}
INDENTED_ADD (button); INDENTED_ADD (button);
if (katze_object_has_property (settings, "enable-webgl")) if (katze_object_has_property (settings, "enable-webgl"))
{ {
button = katze_property_proxy (settings, "enable-webgl", NULL); button = katze_property_proxy (settings, "enable-webgl", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Enable WebGL support"));
SPANNED_ADD (button); SPANNED_ADD (button);
} }
#ifndef G_OS_WIN32 #ifndef G_OS_WIN32
button = katze_property_proxy (settings, "flash-window-on-new-bg-tabs", NULL); button = katze_property_proxy (settings, "flash-window-on-new-bg-tabs", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Flash window on background tabs"));
INDENTED_ADD (button); INDENTED_ADD (button);
#endif #endif
@ -408,12 +425,11 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
INDENTED_ADD (button); INDENTED_ADD (button);
entry = katze_property_proxy (settings, "preferred-languages", "languages"); entry = katze_property_proxy (settings, "preferred-languages", "languages");
SPANNED_ADD (entry); SPANNED_ADD (entry);
#if !HAVE_HILDON label = gtk_label_new (_("Save downloaded files to:"));
label = katze_property_label (settings, "download-folder"); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
INDENTED_ADD (label); INDENTED_ADD (label);
button = katze_property_proxy (settings, "download-folder", "folder"); button = katze_property_proxy (settings, "download-folder", "folder");
SPANNED_ADD (button); SPANNED_ADD (button);
#endif
/* Page "Interface" */ /* Page "Interface" */
PAGE_NEW (GTK_STOCK_CONVERT, _("Browsing")); PAGE_NEW (GTK_STOCK_CONVERT, _("Browsing"));
@ -431,35 +447,39 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
INDENTED_ADD (label); INDENTED_ADD (label);
button = katze_property_proxy (settings, "open-new-pages-in", NULL); button = katze_property_proxy (settings, "open-new-pages-in", NULL);
SPANNED_ADD (button); SPANNED_ADD (button);
#if !HAVE_HILDON
button = katze_property_proxy (settings, "close-buttons-on-tabs", NULL); button = katze_property_proxy (settings, "close-buttons-on-tabs", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Close Buttons on Tabs"));
INDENTED_ADD (button); INDENTED_ADD (button);
#ifndef HAVE_GRANITE #ifndef HAVE_GRANITE
button = katze_property_proxy (settings, "always-show-tabbar", NULL); button = katze_property_proxy (settings, "always-show-tabbar", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Always Show Tabbar"));
SPANNED_ADD (button); SPANNED_ADD (button);
#endif #endif
#endif
button = katze_property_proxy (settings, "open-tabs-next-to-current", NULL); button = katze_property_proxy (settings, "open-tabs-next-to-current", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Open Tabs next to Current"));
gtk_widget_set_tooltip_text (button, _("Whether to open new tabs next to the current tab or after the last one"));
INDENTED_ADD (button); INDENTED_ADD (button);
button = katze_property_proxy (settings, "open-tabs-in-the-background", NULL); button = katze_property_proxy (settings, "open-tabs-in-the-background", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Open tabs in the background"));
SPANNED_ADD (button); SPANNED_ADD (button);
#if !HAVE_HILDON
INDENTED_ADD (gtk_label_new (NULL)); INDENTED_ADD (gtk_label_new (NULL));
label = katze_property_label (settings, "text-editor"); label = gtk_label_new (_("Text Editor"));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
INDENTED_ADD (label); INDENTED_ADD (label);
entry = katze_property_proxy (settings, "text-editor", "application-text/plain"); entry = katze_property_proxy (settings, "text-editor", "application-text/plain");
SPANNED_ADD (entry); SPANNED_ADD (entry);
label = katze_property_label (settings, "news-aggregator"); label = gtk_label_new (_("News Aggregator"));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
INDENTED_ADD (label); INDENTED_ADD (label);
entry = katze_property_proxy (settings, "news-aggregator", "application-News"); entry = katze_property_proxy (settings, "news-aggregator", "application-News");
SPANNED_ADD (entry); SPANNED_ADD (entry);
#endif
/* Page "Network" */ /* Page "Network" */
PAGE_NEW (GTK_STOCK_NETWORK, _("Network")); PAGE_NEW (GTK_STOCK_NETWORK, _("Network"));
FRAME_NEW (NULL); FRAME_NEW (NULL);
#if !HAVE_HILDON label = gtk_label_new (_("Proxy server"));
label = katze_property_label (settings, "proxy-type"); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
INDENTED_ADD (label); INDENTED_ADD (label);
button = katze_property_proxy (settings, "proxy-type", NULL); button = katze_property_proxy (settings, "proxy-type", NULL);
SPANNED_ADD (button); SPANNED_ADD (button);
@ -471,7 +491,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
g_signal_connect (settings, "notify::proxy-type", g_signal_connect (settings, "notify::proxy-type",
G_CALLBACK (midori_preferences_notify_proxy_type_cb), entry); G_CALLBACK (midori_preferences_notify_proxy_type_cb), entry);
midori_preferences_notify_proxy_type_cb (settings, NULL, entry); midori_preferences_notify_proxy_type_cb (settings, NULL, entry);
label = katze_property_label (settings, "http-proxy-port"); label = gtk_label_new (_("Port"));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
INDENTED_ADD (label); INDENTED_ADD (label);
entry = katze_property_proxy (settings, "http-proxy-port", NULL); entry = katze_property_proxy (settings, "http-proxy-port", NULL);
@ -479,13 +499,14 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
g_signal_connect (settings, "notify::proxy-type", g_signal_connect (settings, "notify::proxy-type",
G_CALLBACK (midori_preferences_notify_proxy_type_cb), entry); G_CALLBACK (midori_preferences_notify_proxy_type_cb), entry);
midori_preferences_notify_proxy_type_cb (settings, NULL, entry); midori_preferences_notify_proxy_type_cb (settings, NULL, entry);
#endif
#if WEBKIT_CHECK_VERSION (1, 3, 11) #if WEBKIT_CHECK_VERSION (1, 3, 11)
if (soup_session_get_feature (webkit_get_default_session (), SOUP_TYPE_CACHE)) if (soup_session_get_feature (webkit_get_default_session (), SOUP_TYPE_CACHE))
{ {
label = katze_property_label (settings, "maximum-cache-size"); label = gtk_label_new (_("Web Cache"));
gtk_widget_set_tooltip_text (label, _("The maximum size of cached pages on disk"));
INDENTED_ADD (label); INDENTED_ADD (label);
button = katze_property_proxy (settings, "maximum-cache-size", NULL); button = katze_property_proxy (settings, "maximum-cache-size", NULL);
gtk_widget_set_tooltip_text (button, _("The maximum size of cached pages on disk"));
SPANNED_ADD (button); SPANNED_ADD (button);
label = gtk_label_new (_("MB")); label = gtk_label_new (_("MB"));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);

View file

@ -44,15 +44,66 @@ namespace Midori {
public bool compact_sidepanel { get; set; default = false; } public bool compact_sidepanel { get; set; default = false; }
/* Since: 0.2.2 */ /* Since: 0.2.2 */
public bool open_panels_in_windows { get; set; default = false; } public bool open_panels_in_windows { get; set; default = false; }
/* Since: 0.1.3 */
public bool right_align_sidepanel { get; set; default = false; }
public bool show_menubar { get; set; default = false; }
public bool show_navigationbar { get; set; default = true; }
public bool show_bookmarkbar { get; set; default = false; }
public bool show_panel { get; set; default = false; }
public bool show_statusbar { get; set; default = true; }
/* Since: 0.1.2 */
public bool show_crash_dialog { get; set; default = true; }
public string toolbar_items { get; set; default = public string toolbar_items { get; set; default =
"TabNew,Back,NextForward,ReloadStop,BookmarkAdd,Location,Search,Trash,CompactMenu"; } "TabNew,Back,NextForward,ReloadStop,BookmarkAdd,Location,Search,Trash,CompactMenu"; }
/* Since: 0.1.4 */ /* Since: 0.1.4 */
// [Deprecated (since = "0.4.7")] // [Deprecated (since = "0.4.7")]
public bool find_while_typing { get; set; default = false; } public bool find_while_typing { get; set; default = false; }
public bool open_popups_in_tabs { get; set; default = true; }
/* Since: 0.1.3 */
public bool zoom_text_and_images { get; set; default = true; }
/* Since: 0.2.0 */
public bool kinetic_scrolling { get; set; default = true; }
public bool middle_click_opens_selection { get; set; default = true; }
public bool flash_window_on_new_bg_tabs { get; set; default = false; }
public bool close_buttons_on_tabs { get; set; default = true; }
public bool open_tabs_in_the_background { get; set; default = false; }
public bool open_tabs_next_to_current { get; set; default = true; }
public bool always_show_tabbar { get; set; default = true; }
public string homepage { get; set; default = "http://www.google.com"; }
static string default_download_folder () {
return Environment.get_user_special_dir (UserDirectory.DOWNLOAD)
?? Environment.get_home_dir ();
}
public string download_folder { get; set; default = default_download_folder (); }
public string? text_editor { get; set; default = null; }
/* Since: 0.1.6 */
public string? news_aggregator { get; set; default = null; }
public string http_proxy { get; set; default = null; }
/* Since: 0.4.2 */
// [IntegerType (min = 1, max = 65535)]
public int http_proxy_port { get; set; default = 8080; }
/* Since: 0.3.4 */
// [IntegerType (min = 0, int.max)]
public int maximum_cache_size { get; set; default = 100; }
/* Since: 0.3.4 */
public bool strip_referer { get; set; default = false; }
/* Since: 0.4.2 */
public bool first_party_cookies_only { get; set; default = true; }
// [IntegerType (min = 0, int.max)]
public int maximum_cookie_age { get; set; default = 30; }
// [IntegerType (min = 0, int.max)]
public int maximum_history_age { get; set; default = 30; }
/* Since: 0.4.7 */ /* Since: 0.4.7 */
public bool delay_saving (string property) { public bool delay_saving (string property) {
return property.has_prefix ("last-") || property.has_suffix ("-width"); return property.has_prefix ("last-")
|| property == "user-stylesheet-uri"
|| property.has_suffix ("-width");
} }
} }
} }

View file

@ -35,47 +35,15 @@ struct _MidoriWebSettings
{ {
MidoriSettings parent_instance; MidoriSettings parent_instance;
gboolean show_menubar : 1;
gboolean show_navigationbar : 1;
gboolean show_bookmarkbar : 1;
gboolean show_panel : 1;
gboolean show_statusbar : 1;
MidoriToolbarStyle toolbar_style : 3; MidoriToolbarStyle toolbar_style : 3;
gboolean compact_sidepanel : 1;
gboolean right_align_sidepanel : 1;
gboolean open_panels_in_windows : 1;
MidoriStartup load_on_startup : 2; MidoriStartup load_on_startup : 2;
gboolean show_crash_dialog : 1;
MidoriPreferredEncoding preferred_encoding : 3; MidoriPreferredEncoding preferred_encoding : 3;
gboolean always_show_tabbar : 1;
gboolean close_buttons_on_tabs : 1;
gint close_buttons_left; gint close_buttons_left;
MidoriNewPage open_new_pages_in : 2; MidoriNewPage open_new_pages_in : 2;
gboolean middle_click_opens_selection : 1;
gboolean open_tabs_in_the_background : 1;
gboolean open_tabs_next_to_current : 1;
gboolean open_popups_in_tabs : 1;
gboolean zoom_text_and_images : 1;
gboolean find_while_typing : 1;
gboolean kinetic_scrolling : 1;
gboolean first_party_cookies_only : 1; gboolean first_party_cookies_only : 1;
gboolean remember_last_visited_pages : 1;
MidoriProxy proxy_type : 2; MidoriProxy proxy_type : 2;
MidoriIdentity identify_as : 3; MidoriIdentity identify_as : 3;
gint maximum_cookie_age;
gint maximum_history_age;
gint search_width;
gchar* homepage;
gchar* download_folder;
gchar* text_editor;
gchar* news_aggregator;
gchar* http_proxy;
gint http_proxy_port;
#if WEBKIT_CHECK_VERSION (1, 3, 11)
gint maximum_cache_size;
#endif
gchar* http_accept_language; gchar* http_accept_language;
gchar* accept; gchar* accept;
gchar* ident_string; gchar* ident_string;
@ -86,9 +54,7 @@ struct _MidoriWebSettings
#if !WEBKIT_CHECK_VERSION (1, 3, 13) #if !WEBKIT_CHECK_VERSION (1, 3, 13)
gboolean enable_dns_prefetching; gboolean enable_dns_prefetching;
#endif #endif
gboolean strip_referer;
gboolean enforce_font_family; gboolean enforce_font_family;
gboolean flash_window_on_bg_tabs;
gchar* user_stylesheet_uri; gchar* user_stylesheet_uri;
gchar* user_stylesheet_uri_cached; gchar* user_stylesheet_uri_cached;
GHashTable* user_stylesheets; GHashTable* user_stylesheets;
@ -105,62 +71,25 @@ enum
{ {
PROP_0, PROP_0,
PROP_SHOW_MENUBAR,
PROP_SHOW_NAVIGATIONBAR,
PROP_SHOW_BOOKMARKBAR,
PROP_SHOW_PANEL,
PROP_SHOW_STATUSBAR,
PROP_TOOLBAR_STYLE, PROP_TOOLBAR_STYLE,
PROP_RIGHT_ALIGN_SIDEPANEL,
PROP_LOAD_ON_STARTUP, PROP_LOAD_ON_STARTUP,
PROP_HOMEPAGE,
PROP_SHOW_CRASH_DIALOG,
PROP_DOWNLOAD_FOLDER,
PROP_TEXT_EDITOR,
PROP_NEWS_AGGREGATOR,
PROP_PREFERRED_ENCODING, PROP_PREFERRED_ENCODING,
PROP_ALWAYS_SHOW_TABBAR,
PROP_CLOSE_BUTTONS_ON_TABS,
PROP_CLOSE_BUTTONS_LEFT, PROP_CLOSE_BUTTONS_LEFT,
PROP_OPEN_NEW_PAGES_IN, PROP_OPEN_NEW_PAGES_IN,
PROP_MIDDLE_CLICK_OPENS_SELECTION,
PROP_OPEN_TABS_IN_THE_BACKGROUND,
PROP_OPEN_TABS_NEXT_TO_CURRENT,
PROP_OPEN_POPUPS_IN_TABS,
PROP_FLASH_WINDOW_ON_BG_TABS,
PROP_ENABLE_WEBGL,
PROP_ENABLE_FULLSCREEN, PROP_ENABLE_FULLSCREEN,
PROP_AUTO_LOAD_IMAGES,
PROP_ENABLE_SCRIPTS,
PROP_ENABLE_PLUGINS, PROP_ENABLE_PLUGINS,
PROP_ENABLE_DEVELOPER_EXTRAS,
PROP_ENABLE_SPELL_CHECKING,
PROP_ENABLE_HTML5_DATABASE,
PROP_ENABLE_HTML5_LOCAL_STORAGE,
PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE,
PROP_ENABLE_PAGE_CACHE, PROP_ENABLE_PAGE_CACHE,
PROP_ZOOM_TEXT_AND_IMAGES,
PROP_KINETIC_SCROLLING,
PROP_MAXIMUM_COOKIE_AGE,
PROP_FIRST_PARTY_COOKIES_ONLY,
PROP_MAXIMUM_HISTORY_AGE,
PROP_PROXY_TYPE, PROP_PROXY_TYPE,
PROP_HTTP_PROXY,
PROP_HTTP_PROXY_PORT,
PROP_MAXIMUM_CACHE_SIZE,
PROP_IDENTIFY_AS, PROP_IDENTIFY_AS,
PROP_USER_AGENT, PROP_USER_AGENT,
PROP_PREFERRED_LANGUAGES, PROP_PREFERRED_LANGUAGES,
PROP_SITE_DATA_RULES, PROP_SITE_DATA_RULES,
PROP_ENABLE_DNS_PREFETCHING, PROP_ENABLE_DNS_PREFETCHING,
PROP_STRIP_REFERER,
PROP_ENFORCE_FONT_FAMILY, PROP_ENFORCE_FONT_FAMILY,
PROP_USER_STYLESHEET_URI, PROP_USER_STYLESHEET_URI,
}; };
@ -296,17 +225,6 @@ midori_web_settings_get_property (GObject* object,
GValue* value, GValue* value,
GParamSpec* pspec); GParamSpec* pspec);
static const gchar*
midori_get_download_dir (void)
{
const gchar* dir = g_get_user_special_dir (G_USER_DIRECTORY_DOWNLOAD);
if (dir)
{
katze_mkdir_with_parents (dir, 0700);
return dir;
}
return g_get_home_dir ();
}
static gboolean static gboolean
midori_web_settings_low_memory_profile () midori_web_settings_low_memory_profile ()
{ {
@ -352,52 +270,6 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
flags = G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS; flags = G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS;
g_object_class_install_property (gobject_class,
PROP_SHOW_MENUBAR,
g_param_spec_boolean (
"show-menubar",
_("Show Menubar"),
_("Whether to show the menubar"),
FALSE,
flags));
g_object_class_install_property (gobject_class,
PROP_SHOW_NAVIGATIONBAR,
g_param_spec_boolean (
"show-navigationbar",
_("Show Navigationbar"),
_("Whether to show the navigationbar"),
TRUE,
flags));
g_object_class_install_property (gobject_class,
PROP_SHOW_BOOKMARKBAR,
g_param_spec_boolean (
"show-bookmarkbar",
_("Show Bookmarkbar"),
_("Whether to show the bookmarkbar"),
FALSE,
flags));
g_object_class_install_property (gobject_class,
PROP_SHOW_PANEL,
g_param_spec_boolean (
"show-panel",
_("Show Panel"),
_("Whether to show the panel"),
FALSE,
flags));
g_object_class_install_property (gobject_class,
PROP_SHOW_STATUSBAR,
g_param_spec_boolean (
"show-statusbar",
_("Show Statusbar"),
_("Whether to show the statusbar"),
TRUE,
flags));
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_TOOLBAR_STYLE, PROP_TOOLBAR_STYLE,
g_param_spec_enum ( g_param_spec_enum (
@ -408,125 +280,26 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
MIDORI_TOOLBAR_DEFAULT, MIDORI_TOOLBAR_DEFAULT,
flags)); flags));
/**
* MidoriWebSettings:right-sidepanel:
*
* Whether to align the sidepanel on the right.
*
* Since: 0.1.3
*/
g_object_class_install_property (gobject_class,
PROP_RIGHT_ALIGN_SIDEPANEL,
g_param_spec_boolean (
"right-align-sidepanel",
_("Align sidepanel on the right"),
_("Whether to align the sidepanel on the right"),
FALSE,
flags));
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_LOAD_ON_STARTUP, PROP_LOAD_ON_STARTUP,
g_param_spec_enum ( g_param_spec_enum (
"load-on-startup", "load-on-startup",
_("When Midori starts:"), _("When Midori starts:"),
_("What to do when Midori starts"), "What to do when Midori starts",
MIDORI_TYPE_STARTUP, MIDORI_TYPE_STARTUP,
MIDORI_STARTUP_LAST_OPEN_PAGES, MIDORI_STARTUP_LAST_OPEN_PAGES,
flags)); flags));
g_object_class_install_property (gobject_class,
PROP_HOMEPAGE,
g_param_spec_string (
"homepage",
_("Homepage:"),
_("The homepage"),
"http://www.google.com",
flags));
/**
* MidoriWebSettings:show-crash-dialog:
*
* Show a dialog after Midori crashed.
*
* Since: 0.1.2
*/
g_object_class_install_property (gobject_class,
PROP_SHOW_CRASH_DIALOG,
g_param_spec_boolean (
"show-crash-dialog",
_("Show crash dialog"),
_("Show a dialog after Midori crashed"),
TRUE,
flags));
g_object_class_install_property (gobject_class,
PROP_DOWNLOAD_FOLDER,
g_param_spec_string (
"download-folder",
_("Save downloaded files to:"),
_("The folder downloaded files are saved to"),
midori_get_download_dir (),
flags));
g_object_class_install_property (gobject_class,
PROP_TEXT_EDITOR,
g_param_spec_string (
"text-editor",
_("Text Editor"),
_("An external text editor"),
NULL,
flags));
/**
* MidoriWebSettings:news-aggregator:
*
* An external news aggregator.
*
* Since: 0.1.6
*/
g_object_class_install_property (gobject_class,
PROP_NEWS_AGGREGATOR,
g_param_spec_string (
"news-aggregator",
_("News Aggregator"),
_("An external news aggregator"),
NULL,
flags));
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_PREFERRED_ENCODING, PROP_PREFERRED_ENCODING,
g_param_spec_enum ( g_param_spec_enum (
"preferred-encoding", "preferred-encoding",
_("Preferred Encoding"), _("Preferred Encoding"),
_("The preferred character encoding"), "The preferred character encoding",
MIDORI_TYPE_PREFERRED_ENCODING, MIDORI_TYPE_PREFERRED_ENCODING,
MIDORI_ENCODING_WESTERN, MIDORI_ENCODING_WESTERN,
flags)); flags));
g_object_class_install_property (gobject_class,
PROP_ALWAYS_SHOW_TABBAR,
g_param_spec_boolean (
"always-show-tabbar",
_("Always Show Tabbar"),
_("Always show the tabbar"),
TRUE,
#ifdef HAVE_GRANITE
G_PARAM_READABLE
#else
flags
#endif
));
g_object_class_install_property (gobject_class,
PROP_CLOSE_BUTTONS_ON_TABS,
g_param_spec_boolean (
"close-buttons-on-tabs",
_("Close Buttons on Tabs"),
_("Whether tabs have close buttons"),
TRUE,
flags));
/** /**
* MidoriWebSettings:close-buttons-left: * MidoriWebSettings:close-buttons-left:
* *
@ -549,110 +322,20 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
g_param_spec_enum ( g_param_spec_enum (
"open-new-pages-in", "open-new-pages-in",
_("Open new pages in:"), _("Open new pages in:"),
_("Where to open new pages"), "Where to open new pages",
MIDORI_TYPE_NEW_PAGE, MIDORI_TYPE_NEW_PAGE,
MIDORI_NEW_PAGE_TAB, MIDORI_NEW_PAGE_TAB,
flags)); flags));
g_object_class_install_property (gobject_class,
PROP_MIDDLE_CLICK_OPENS_SELECTION,
g_param_spec_boolean (
"middle-click-opens-selection",
_("Middle click opens Selection"),
_("Load an address from the selection via middle click"),
TRUE,
flags));
g_object_class_install_property (gobject_class,
PROP_OPEN_TABS_IN_THE_BACKGROUND,
g_param_spec_boolean (
"open-tabs-in-the-background",
_("Open tabs in the background"),
_("Whether to open new tabs in the background"),
FALSE,
flags));
g_object_class_install_property (gobject_class,
PROP_OPEN_TABS_NEXT_TO_CURRENT,
g_param_spec_boolean (
"open-tabs-next-to-current",
_("Open Tabs next to Current"),
_("Whether to open new tabs next to the current tab or after the last one"),
TRUE,
flags));
g_object_class_install_property (gobject_class,
PROP_OPEN_POPUPS_IN_TABS,
g_param_spec_boolean (
"open-popups-in-tabs",
_("Open popups in tabs"),
_("Whether to open popup windows in tabs"),
TRUE,
flags));
/* Override properties to localize them for preference proxies */
g_object_class_install_property (gobject_class,
PROP_AUTO_LOAD_IMAGES,
g_param_spec_boolean (
"auto-load-images",
_("Load images automatically"),
_("Load and display images automatically"),
TRUE,
flags));
g_object_class_install_property (gobject_class,
PROP_ENABLE_SCRIPTS,
g_param_spec_boolean (
"enable-scripts",
_("Enable scripts"),
_("Enable embedded scripting languages"),
TRUE,
flags));
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_ENABLE_PLUGINS, PROP_ENABLE_PLUGINS,
g_param_spec_boolean ( g_param_spec_boolean (
"enable-plugins", "enable-plugins",
_("Enable Netscape plugins"), "Enable Netscape plugins",
_("Enable embedded Netscape plugin objects"), "Enable embedded Netscape plugin objects",
midori_web_settings_has_plugin_support (),
midori_web_settings_has_plugin_support () ? flags : G_PARAM_READABLE));
/* Override properties to override defaults */
g_object_class_install_property (gobject_class,
PROP_ENABLE_DEVELOPER_EXTRAS,
g_param_spec_boolean (
"enable-developer-extras",
"Enable developer tools",
"Enable special extensions for developers",
TRUE, TRUE,
flags)); flags));
g_object_class_install_property (gobject_class,
PROP_ENABLE_SPELL_CHECKING,
g_param_spec_boolean ("enable-spell-checking",
_("Enable Spell Checking"),
_("Enable spell checking while typing"),
TRUE,
flags));
g_object_class_install_property (gobject_class,
PROP_ENABLE_HTML5_DATABASE,
g_param_spec_boolean ("enable-html5-database",
_("Enable HTML5 database support"),
_("Whether to enable HTML5 database support"),
FALSE,
flags));
g_object_class_install_property (gobject_class,
PROP_ENABLE_HTML5_LOCAL_STORAGE,
g_param_spec_boolean ("enable-html5-local-storage",
_("Enable HTML5 local storage support"),
_("Whether to enable HTML5 local storage support"),
FALSE,
flags));
g_object_class_install_property (gobject_class,
PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE,
g_param_spec_boolean ("enable-offline-web-application-cache",
_("Enable offline web application cache"),
_("Whether to enable offline web application cache"),
FALSE,
flags));
#if WEBKIT_CHECK_VERSION (1, 1, 18) #if WEBKIT_CHECK_VERSION (1, 1, 18)
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_ENABLE_PAGE_CACHE, PROP_ENABLE_PAGE_CACHE,
@ -662,29 +345,6 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
!midori_web_settings_low_memory_profile (), !midori_web_settings_low_memory_profile (),
flags)); flags));
#endif #endif
/**
* MidoriWebSettings::flash-window-on-new-bg-tabs
*
* Uses opacity to attract attention. Nothing on Windows.
*/
g_object_class_install_property (gobject_class,
PROP_FLASH_WINDOW_ON_BG_TABS,
g_param_spec_boolean (
"flash-window-on-new-bg-tabs",
_("Flash window on background tabs"),
_("Flash the browser window if a new tab was opened in the background"),
FALSE,
flags));
if (g_object_class_find_property (gobject_class, "enable-webgl"))
g_object_class_install_property (gobject_class,
PROP_ENABLE_WEBGL,
g_param_spec_boolean (
"enable-webgl",
_("Enable WebGL support"),
_("Allow websites to use OpenGL rendering"),
/* Enable by default for git builds */
!g_str_equal (PACKAGE_VERSION, MIDORI_VERSION),
flags));
if (g_object_class_find_property (gobject_class, "enable-fullscreen")) if (g_object_class_find_property (gobject_class, "enable-fullscreen"))
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_ENABLE_FULLSCREEN, PROP_ENABLE_FULLSCREEN,
@ -695,80 +355,6 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
TRUE, TRUE,
flags)); flags));
/**
* MidoriWebSettings:zoom-text-and-images:
*
* Whether to zoom text and images.
*
* Since: 0.1.3
*/
g_object_class_install_property (gobject_class,
PROP_ZOOM_TEXT_AND_IMAGES,
g_param_spec_boolean (
"zoom-text-and-images",
_("Zoom Text and Images"),
_("Whether to zoom text and images"),
TRUE,
flags));
/**
* MidoriWebSettings:kinetic-scrolling:
*
* Whether scrolling should kinetically move according to speed.
*
* Since: 0.2.0
*/
g_object_class_install_property (gobject_class,
PROP_KINETIC_SCROLLING,
g_param_spec_boolean (
"kinetic-scrolling",
_("Kinetic scrolling"),
_("Whether scrolling should kinetically move according to speed"),
TRUE,
flags));
g_object_class_install_property (gobject_class,
PROP_MAXIMUM_COOKIE_AGE,
g_param_spec_int (
"maximum-cookie-age",
_("Delete old Cookies after:"),
_("The maximum number of days to save cookies for"),
0, G_MAXINT, 30,
flags));
/**
* MidoriWebSettings:first-party-cookies-only:
*
* Whether only first party cookies should be accepted.
* WebKitGTK+ 1.1.21 is required for this to work.
*
* Since: 0.4.2
*/
g_object_class_install_property (gobject_class,
PROP_FIRST_PARTY_COOKIES_ONLY,
g_param_spec_boolean (
"first-party-cookies-only",
_("Only accept Cookies from sites you visit"),
_("Block cookies sent by third-party websites"),
#ifdef HAVE_LIBSOUP_2_29_91
TRUE,
g_object_class_find_property (gobject_class, /* WebKitGTK+ >= 1.1.21 */
"enable-file-access-from-file-uris") ? flags : G_PARAM_READABLE));
#else
FALSE,
G_PARAM_READABLE));
#endif
g_object_class_install_property (gobject_class,
PROP_MAXIMUM_HISTORY_AGE,
g_param_spec_int (
"maximum-history-age",
_("Delete pages from history after:"),
_("The maximum number of days to save the history for"),
0, G_MAXINT, 30,
flags));
/** /**
* MidoriWebSettings:proxy-type: * MidoriWebSettings:proxy-type:
* *
@ -780,56 +366,12 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
PROP_PROXY_TYPE, PROP_PROXY_TYPE,
g_param_spec_enum ( g_param_spec_enum (
"proxy-type", "proxy-type",
_("Proxy server"), "Proxy server",
_("The type of proxy server to use"), "The type of proxy server to use",
MIDORI_TYPE_PROXY, MIDORI_TYPE_PROXY,
MIDORI_PROXY_AUTOMATIC, MIDORI_PROXY_AUTOMATIC,
flags)); flags));
g_object_class_install_property (gobject_class,
PROP_HTTP_PROXY,
g_param_spec_string (
"http-proxy",
_("HTTP Proxy Server"),
_("The proxy server used for HTTP connections"),
NULL,
flags));
/**
* MidoriWebSettings:http-proxy-port:
*
* The proxy server port used for HTTP connections
*
* Since: 0.4.2
*/
g_object_class_install_property (gobject_class,
PROP_HTTP_PROXY_PORT,
g_param_spec_int (
"http-proxy-port",
_("Port"),
_("The proxy server port used for HTTP connections"),
1, 65535, 8080,
flags
));
#if WEBKIT_CHECK_VERSION (1, 3, 11)
/**
* MidoriWebSettings:maximum-cache-size:
*
* The maximum size of cached pages on disk.
*
* Since: 0.3.4
*/
g_object_class_install_property (gobject_class,
PROP_MAXIMUM_CACHE_SIZE,
g_param_spec_int (
"maximum-cache-size",
_("Web Cache"),
_("The maximum size of cached pages on disk"),
0, G_MAXINT, 100,
flags));
#endif
/** /**
* MidoriWebSettings:identify-as: * MidoriWebSettings:identify-as:
* *
@ -915,23 +457,6 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
flags)); flags));
#endif #endif
/**
* MidoriWebSettings:strip-referer:
*
* Whether to strip referrer details sent to external sites.
*
* Since: 0.3.4
*/
g_object_class_install_property (gobject_class,
PROP_STRIP_REFERER,
g_param_spec_boolean (
"strip-referer",
/* i18n: Reworded: Shorten details propagated when going to another page */
_("Strip referrer details sent to websites"),
/* i18n: Referer here is not a typo but a technical term */
_("Whether the \"Referer\" header should be shortened to the hostname"),
FALSE,
flags));
/** /**
* MidoriWebSettings:enforc-font-family: * MidoriWebSettings:enforc-font-family:
* *
@ -955,7 +480,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
"User stylesheet URI", "User stylesheet URI",
"Load stylesheets from a local URI", "Load stylesheets from a local URI",
NULL, NULL,
flags | MIDORI_PARAM_DELAY_SAVING)); flags));
} }
static void static void
@ -1000,10 +525,6 @@ notify_default_font_family_cb (GObject* object,
static void static void
midori_web_settings_init (MidoriWebSettings* web_settings) midori_web_settings_init (MidoriWebSettings* web_settings)
{ {
web_settings->download_folder = g_strdup (midori_get_download_dir ());
web_settings->http_proxy = NULL;
web_settings->open_popups_in_tabs = TRUE;
web_settings->kinetic_scrolling = TRUE;
web_settings->user_stylesheet_uri = web_settings->user_stylesheet_uri_cached = NULL; web_settings->user_stylesheet_uri = web_settings->user_stylesheet_uri_cached = NULL;
web_settings->user_stylesheets = NULL; web_settings->user_stylesheets = NULL;
@ -1034,11 +555,6 @@ midori_web_settings_finalize (GObject* object)
web_settings = MIDORI_WEB_SETTINGS (object); web_settings = MIDORI_WEB_SETTINGS (object);
katze_assign (web_settings->homepage, NULL);
katze_assign (web_settings->download_folder, NULL);
katze_assign (web_settings->text_editor, NULL);
katze_assign (web_settings->news_aggregator, NULL);
katze_assign (web_settings->http_proxy, NULL);
katze_assign (web_settings->http_accept_language, NULL); katze_assign (web_settings->http_accept_language, NULL);
katze_assign (web_settings->accept, NULL); katze_assign (web_settings->accept, NULL);
katze_assign (web_settings->ident_string, NULL); katze_assign (web_settings->ident_string, NULL);
@ -1374,47 +890,13 @@ midori_web_settings_set_property (GObject* object,
switch (prop_id) switch (prop_id)
{ {
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;
case PROP_SHOW_BOOKMARKBAR:
web_settings->show_bookmarkbar = g_value_get_boolean (value);
break;
case PROP_SHOW_PANEL:
web_settings->show_panel = g_value_get_boolean (value);
break;
case PROP_SHOW_STATUSBAR:
web_settings->show_statusbar = g_value_get_boolean (value);
break;
case PROP_TOOLBAR_STYLE: case PROP_TOOLBAR_STYLE:
web_settings->toolbar_style = g_value_get_enum (value); web_settings->toolbar_style = g_value_get_enum (value);
break; break;
case PROP_RIGHT_ALIGN_SIDEPANEL:
web_settings->right_align_sidepanel = g_value_get_boolean (value);
break;
case PROP_LOAD_ON_STARTUP: case PROP_LOAD_ON_STARTUP:
web_settings->load_on_startup = g_value_get_enum (value); web_settings->load_on_startup = g_value_get_enum (value);
break; break;
case PROP_HOMEPAGE:
katze_assign (web_settings->homepage, g_value_dup_string (value));
break;
case PROP_SHOW_CRASH_DIALOG:
web_settings->show_crash_dialog = g_value_get_boolean (value);
break;
case PROP_DOWNLOAD_FOLDER:
katze_assign (web_settings->download_folder, g_value_dup_string (value));
break;
case PROP_TEXT_EDITOR:
katze_assign (web_settings->text_editor, g_value_dup_string (value));
break;
case PROP_NEWS_AGGREGATOR:
katze_assign (web_settings->news_aggregator, g_value_dup_string (value));
break;
case PROP_PREFERRED_ENCODING: case PROP_PREFERRED_ENCODING:
web_settings->preferred_encoding = g_value_get_enum (value); web_settings->preferred_encoding = g_value_get_enum (value);
switch (web_settings->preferred_encoding) switch (web_settings->preferred_encoding)
@ -1445,36 +927,10 @@ midori_web_settings_set_property (GObject* object,
} }
break; break;
case PROP_ALWAYS_SHOW_TABBAR:
web_settings->always_show_tabbar = g_value_get_boolean (value);
break;
case PROP_CLOSE_BUTTONS_ON_TABS:
web_settings->close_buttons_on_tabs = g_value_get_boolean (value);
break;
case PROP_OPEN_NEW_PAGES_IN: case PROP_OPEN_NEW_PAGES_IN:
web_settings->open_new_pages_in = g_value_get_enum (value); web_settings->open_new_pages_in = g_value_get_enum (value);
break; break;
case PROP_MIDDLE_CLICK_OPENS_SELECTION:
web_settings->middle_click_opens_selection = g_value_get_boolean (value);
break;
case PROP_OPEN_TABS_IN_THE_BACKGROUND:
web_settings->open_tabs_in_the_background = g_value_get_boolean (value);
break;
case PROP_OPEN_TABS_NEXT_TO_CURRENT:
web_settings->open_tabs_next_to_current = g_value_get_boolean (value);
break;
case PROP_OPEN_POPUPS_IN_TABS:
web_settings->open_popups_in_tabs = g_value_get_boolean (value);
break;
case PROP_AUTO_LOAD_IMAGES:
g_object_set (web_settings, "WebKitWebSettings::auto-load-images",
g_value_get_boolean (value), NULL);
break;
case PROP_ENABLE_SCRIPTS:
g_object_set (web_settings, "WebKitWebSettings::enable-scripts",
g_value_get_boolean (value), NULL);
break;
case PROP_ENABLE_PLUGINS: case PROP_ENABLE_PLUGINS:
g_object_set (web_settings, g_object_set (web_settings,
"WebKitWebSettings::enable-plugins", g_value_get_boolean (value), "WebKitWebSettings::enable-plugins", g_value_get_boolean (value),
@ -1483,63 +939,16 @@ midori_web_settings_set_property (GObject* object,
#endif #endif
NULL); NULL);
break; break;
case PROP_ENABLE_DEVELOPER_EXTRAS:
g_object_set (web_settings, "WebKitWebSettings::enable-developer-extras",
g_value_get_boolean (value), NULL);
break;
case PROP_ENABLE_SPELL_CHECKING:
g_object_set (web_settings, "WebKitWebSettings::enable-spell-checking",
g_value_get_boolean (value), NULL);
break;
case PROP_ENABLE_HTML5_DATABASE:
g_object_set (web_settings, "WebKitWebSettings::enable-html5-database",
g_value_get_boolean (value), NULL);
break;
case PROP_ENABLE_HTML5_LOCAL_STORAGE:
g_object_set (web_settings, "WebKitWebSettings::enable-html5-local-storage",
g_value_get_boolean (value), NULL);
break;
case PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE:
g_object_set (web_settings, "WebKitWebSettings::enable-offline-web-application-cache",
g_value_get_boolean (value), NULL);
break;
#if WEBKIT_CHECK_VERSION (1, 1, 18) #if WEBKIT_CHECK_VERSION (1, 1, 18)
case PROP_ENABLE_PAGE_CACHE: case PROP_ENABLE_PAGE_CACHE:
g_object_set (web_settings, "WebKitWebSettings::enable-page-cache", g_object_set (web_settings, "WebKitWebSettings::enable-page-cache",
g_value_get_boolean (value), NULL); g_value_get_boolean (value), NULL);
break; break;
#endif #endif
case PROP_ZOOM_TEXT_AND_IMAGES:
web_settings->zoom_text_and_images = g_value_get_boolean (value);
break;
case PROP_KINETIC_SCROLLING:
web_settings->kinetic_scrolling = g_value_get_boolean (value);
break;
case PROP_MAXIMUM_COOKIE_AGE:
web_settings->maximum_cookie_age = g_value_get_int (value);
break;
case PROP_FIRST_PARTY_COOKIES_ONLY:
web_settings->first_party_cookies_only = g_value_get_boolean (value);
break;
case PROP_MAXIMUM_HISTORY_AGE:
web_settings->maximum_history_age = g_value_get_int (value);
break;
case PROP_PROXY_TYPE: case PROP_PROXY_TYPE:
web_settings->proxy_type = g_value_get_enum (value); web_settings->proxy_type = g_value_get_enum (value);
break; break;
case PROP_HTTP_PROXY:
katze_assign (web_settings->http_proxy, g_value_dup_string (value));
break;
case PROP_HTTP_PROXY_PORT:
web_settings->http_proxy_port = g_value_get_int (value);
break;
#if WEBKIT_CHECK_VERSION (1, 3, 11)
case PROP_MAXIMUM_CACHE_SIZE:
web_settings->maximum_cache_size = g_value_get_int (value);
break;
#endif
case PROP_IDENTIFY_AS: case PROP_IDENTIFY_AS:
web_settings->identify_as = g_value_get_enum (value); web_settings->identify_as = g_value_get_enum (value);
if (web_settings->identify_as != MIDORI_IDENT_CUSTOM) if (web_settings->identify_as != MIDORI_IDENT_CUSTOM)
@ -1569,9 +978,6 @@ midori_web_settings_set_property (GObject* object,
web_settings->enable_dns_prefetching = g_value_get_boolean (value); web_settings->enable_dns_prefetching = g_value_get_boolean (value);
break; break;
#endif #endif
case PROP_STRIP_REFERER:
web_settings->strip_referer = g_value_get_boolean (value);
break;
case PROP_ENFORCE_FONT_FAMILY: case PROP_ENFORCE_FONT_FAMILY:
if ((web_settings->enforce_font_family = g_value_get_boolean (value))) if ((web_settings->enforce_font_family = g_value_get_boolean (value)))
{ {
@ -1591,13 +997,6 @@ midori_web_settings_set_property (GObject* object,
else else
midori_web_settings_remove_style (web_settings, "enforce-font-family"); midori_web_settings_remove_style (web_settings, "enforce-font-family");
break; break;
case PROP_FLASH_WINDOW_ON_BG_TABS:
web_settings->flash_window_on_bg_tabs = g_value_get_boolean (value);
break;
case PROP_ENABLE_WEBGL:
g_object_set (web_settings, "WebKitWebSettings::enable-webgl",
g_value_get_boolean (value), NULL);
break;
case PROP_ENABLE_FULLSCREEN: case PROP_ENABLE_FULLSCREEN:
g_object_set (web_settings, "WebKitWebSettings::enable-fullscreen", g_object_set (web_settings, "WebKitWebSettings::enable-fullscreen",
g_value_get_boolean (value), NULL); g_value_get_boolean (value), NULL);
@ -1639,57 +1038,17 @@ midori_web_settings_get_property (GObject* object,
switch (prop_id) switch (prop_id)
{ {
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;
case PROP_SHOW_BOOKMARKBAR:
g_value_set_boolean (value, web_settings->show_bookmarkbar);
break;
case PROP_SHOW_PANEL:
g_value_set_boolean (value, web_settings->show_panel);
break;
case PROP_SHOW_STATUSBAR:
g_value_set_boolean (value, web_settings->show_statusbar);
break;
case PROP_TOOLBAR_STYLE: case PROP_TOOLBAR_STYLE:
g_value_set_enum (value, web_settings->toolbar_style); g_value_set_enum (value, web_settings->toolbar_style);
break; break;
case PROP_RIGHT_ALIGN_SIDEPANEL:
g_value_set_boolean (value, web_settings->right_align_sidepanel);
break;
case PROP_LOAD_ON_STARTUP: case PROP_LOAD_ON_STARTUP:
g_value_set_enum (value, web_settings->load_on_startup); g_value_set_enum (value, web_settings->load_on_startup);
break; break;
case PROP_HOMEPAGE:
g_value_set_string (value, web_settings->homepage);
break;
case PROP_SHOW_CRASH_DIALOG:
g_value_set_boolean (value, web_settings->show_crash_dialog);
break;
case PROP_DOWNLOAD_FOLDER:
g_value_set_string (value, web_settings->download_folder);
break;
case PROP_TEXT_EDITOR:
g_value_set_string (value, web_settings->text_editor);
break;
case PROP_NEWS_AGGREGATOR:
g_value_set_string (value, web_settings->news_aggregator);
break;
case PROP_PREFERRED_ENCODING: case PROP_PREFERRED_ENCODING:
g_value_set_enum (value, web_settings->preferred_encoding); g_value_set_enum (value, web_settings->preferred_encoding);
break; break;
case PROP_ALWAYS_SHOW_TABBAR:
g_value_set_boolean (value, web_settings->always_show_tabbar);
break;
case PROP_CLOSE_BUTTONS_ON_TABS:
g_value_set_boolean (value, web_settings->close_buttons_on_tabs);
break;
case PROP_CLOSE_BUTTONS_LEFT: case PROP_CLOSE_BUTTONS_LEFT:
#if HAVE_OSX #if HAVE_OSX
g_value_set_boolean (value, TRUE); g_value_set_boolean (value, TRUE);
@ -1731,88 +1090,21 @@ midori_web_settings_get_property (GObject* object,
case PROP_OPEN_NEW_PAGES_IN: case PROP_OPEN_NEW_PAGES_IN:
g_value_set_enum (value, web_settings->open_new_pages_in); g_value_set_enum (value, web_settings->open_new_pages_in);
break; break;
case PROP_MIDDLE_CLICK_OPENS_SELECTION:
g_value_set_boolean (value, web_settings->middle_click_opens_selection);
break;
case PROP_OPEN_TABS_IN_THE_BACKGROUND:
g_value_set_boolean (value, web_settings->open_tabs_in_the_background);
break;
case PROP_OPEN_TABS_NEXT_TO_CURRENT:
g_value_set_boolean (value, web_settings->open_tabs_next_to_current);
break;
case PROP_OPEN_POPUPS_IN_TABS:
g_value_set_boolean (value, web_settings->open_popups_in_tabs);
break;
case PROP_AUTO_LOAD_IMAGES:
g_value_set_boolean (value, katze_object_get_boolean (web_settings,
"WebKitWebSettings::auto-load-images"));
break;
case PROP_ENABLE_SCRIPTS:
g_value_set_boolean (value, katze_object_get_boolean (web_settings,
"WebKitWebSettings::enable-scripts"));
break;
case PROP_ENABLE_PLUGINS: case PROP_ENABLE_PLUGINS:
g_value_set_boolean (value, katze_object_get_boolean (web_settings, g_value_set_boolean (value, katze_object_get_boolean (web_settings,
"WebKitWebSettings::enable-plugins")); "WebKitWebSettings::enable-plugins"));
break; break;
case PROP_ENABLE_DEVELOPER_EXTRAS:
g_value_set_boolean (value, katze_object_get_boolean (web_settings,
"WebKitWebSettings::enable-developer-extras"));
break;
case PROP_ENABLE_SPELL_CHECKING:
g_value_set_boolean (value, katze_object_get_boolean (web_settings,
"WebKitWebSettings::enable-spell-checking"));
break;
case PROP_ENABLE_HTML5_DATABASE:
g_value_set_boolean (value, katze_object_get_boolean (web_settings,
"WebKitWebSettings::enable-html5-database"));
break;
case PROP_ENABLE_HTML5_LOCAL_STORAGE:
g_value_set_boolean (value, katze_object_get_boolean (web_settings,
"WebKitWebSettings::enable-html5-local-storage"));
break;
case PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE:
g_value_set_boolean (value, katze_object_get_boolean (web_settings,
"WebKitWebSettings::enable-offline-web-application-cache"));
break;
#if WEBKIT_CHECK_VERSION (1, 1, 18) #if WEBKIT_CHECK_VERSION (1, 1, 18)
case PROP_ENABLE_PAGE_CACHE: case PROP_ENABLE_PAGE_CACHE:
g_value_set_boolean (value, katze_object_get_boolean (web_settings, g_value_set_boolean (value, katze_object_get_boolean (web_settings,
"WebKitWebSettings::enable-page-cache")); "WebKitWebSettings::enable-page-cache"));
break; break;
#endif #endif
case PROP_ZOOM_TEXT_AND_IMAGES:
g_value_set_boolean (value, web_settings->zoom_text_and_images);
break;
case PROP_KINETIC_SCROLLING:
g_value_set_boolean (value, web_settings->kinetic_scrolling);
break;
case PROP_MAXIMUM_COOKIE_AGE:
g_value_set_int (value, web_settings->maximum_cookie_age);
break;
case PROP_FIRST_PARTY_COOKIES_ONLY:
g_value_set_boolean (value, web_settings->first_party_cookies_only);
break;
case PROP_MAXIMUM_HISTORY_AGE:
g_value_set_int (value, web_settings->maximum_history_age);
break;
case PROP_PROXY_TYPE: case PROP_PROXY_TYPE:
g_value_set_enum (value, web_settings->proxy_type); g_value_set_enum (value, web_settings->proxy_type);
break; break;
case PROP_HTTP_PROXY:
g_value_set_string (value, web_settings->http_proxy);
break;
case PROP_HTTP_PROXY_PORT:
g_value_set_int (value, web_settings->http_proxy_port);
break;
#if WEBKIT_CHECK_VERSION (1, 3, 11)
case PROP_MAXIMUM_CACHE_SIZE:
g_value_set_int (value, web_settings->maximum_cache_size);
break;
#endif
case PROP_IDENTIFY_AS: case PROP_IDENTIFY_AS:
g_value_set_enum (value, web_settings->identify_as); g_value_set_enum (value, web_settings->identify_as);
break; break;
@ -1835,19 +1127,9 @@ midori_web_settings_get_property (GObject* object,
g_value_set_boolean (value, web_settings->enable_dns_prefetching); g_value_set_boolean (value, web_settings->enable_dns_prefetching);
break; break;
#endif #endif
case PROP_STRIP_REFERER:
g_value_set_boolean (value, web_settings->strip_referer);
break;
case PROP_ENFORCE_FONT_FAMILY: case PROP_ENFORCE_FONT_FAMILY:
g_value_set_boolean (value, web_settings->enforce_font_family); g_value_set_boolean (value, web_settings->enforce_font_family);
break; break;
case PROP_FLASH_WINDOW_ON_BG_TABS:
g_value_set_boolean (value, web_settings->flash_window_on_bg_tabs);
break;
case PROP_ENABLE_WEBGL:
g_value_set_boolean (value, katze_object_get_boolean (web_settings,
"WebKitWebSettings::enable-webgl"));
break;
case PROP_ENABLE_FULLSCREEN: case PROP_ENABLE_FULLSCREEN:
g_value_set_boolean (value, katze_object_get_boolean (web_settings, g_value_set_boolean (value, katze_object_get_boolean (web_settings,
"WebKitWebSettings::enable-fullscreen")); "WebKitWebSettings::enable-fullscreen"));

View file

@ -34,8 +34,6 @@ G_BEGIN_DECLS
typedef struct _MidoriWebSettings MidoriWebSettings; typedef struct _MidoriWebSettings MidoriWebSettings;
typedef struct _MidoriWebSettingsClass MidoriWebSettingsClass; typedef struct _MidoriWebSettingsClass MidoriWebSettingsClass;
#define MIDORI_PARAM_DELAY_SAVING (1 << 8)
enum enum
{ {
MIDORI_CLEAR_NONE = 0, MIDORI_CLEAR_NONE = 0,