From: Christian Dywan Date: Wed, 11 Feb 2009 22:41:09 +0000 (+0100) Subject: Add a Preference Show progress in location entry X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e727e714da2e463a1c32ec54631d6dc2a2cc5e64;p=midori Add a Preference Show progress in location entry Disabling the preference will suppress the progress bar inside the location entry and also prevent the navigationbar from showing up during loads if it was otherwise hidden. --- diff --git a/midori/midori-browser.c b/midori/midori-browser.c index b48df84a..0d2bd919 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -269,12 +269,16 @@ _midori_browser_update_interface (MidoriBrowser* browser) "stock-id", GTK_STOCK_STOP, "tooltip", _("Stop loading the current page"), NULL); gtk_widget_show (browser->progressbar); - if (!GTK_WIDGET_VISIBLE (browser->statusbar) - && !GTK_WIDGET_VISIBLE (browser->navigationbar)) + if (!GTK_WIDGET_VISIBLE (browser->statusbar) && + !GTK_WIDGET_VISIBLE (browser->navigationbar) && + katze_object_get_boolean (browser->settings, "progress-in-location")) gtk_widget_show (browser->navigationbar); - action = _action_by_name (browser, "Location"); - midori_location_action_set_progress (MIDORI_LOCATION_ACTION (action), - midori_view_get_progress (MIDORI_VIEW (view))); + if (katze_object_get_boolean (browser->settings, "progress-in-location")) + { + action = _action_by_name (browser, "Location"); + midori_location_action_set_progress (MIDORI_LOCATION_ACTION (action), + midori_view_get_progress (MIDORI_VIEW (view))); + } } katze_throbber_set_animated (KATZE_THROBBER (browser->throbber), loading); @@ -329,6 +333,8 @@ _midori_browser_update_progress (MidoriBrowser* browser, gtk_progress_bar_set_text (GTK_PROGRESS_BAR (browser->progressbar), message); g_free (message); + if (!katze_object_get_boolean (browser->settings, "progress-in-location")) + progress = 0.0; midori_location_action_set_progress (action, progress); } else diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c index c17e6c7a..8a18e17b 100644 --- a/midori/midori-preferences.c +++ b/midori/midori-preferences.c @@ -495,13 +495,15 @@ midori_preferences_set_settings (MidoriPreferences* preferences, /* Page "Interface" */ PAGE_NEW (GTK_STOCK_CONVERT, _("Interface")); - #if !HAVE_HILDON FRAME_NEW (_("Navigationbar")); - TABLE_NEW (1, 2); + TABLE_NEW (2, 2); + #if !HAVE_HILDON INDENTED_ADD (katze_property_label (settings, "toolbar-style"), 0, 1, 0, 1); button = katze_property_proxy (settings, "toolbar-style", NULL); FILLED_ADD (button, 1, 2, 0, 1); #endif + button = katze_property_proxy (settings, "progress-in-location", NULL); + FILLED_ADD (button, 1, 2, 1, 2); FRAME_NEW (_("Browsing")); TABLE_NEW (5, 2); label = katze_property_label (settings, "open-new-pages-in"); diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c index 1a729b4f..69be9118 100644 --- a/midori/midori-websettings.c +++ b/midori/midori-websettings.c @@ -39,6 +39,7 @@ struct _MidoriWebSettings gboolean show_statusbar; MidoriToolbarStyle toolbar_style; + gboolean progress_in_location; gchar* toolbar_items; gboolean compact_sidepanel; @@ -102,6 +103,7 @@ enum PROP_SHOW_STATUSBAR, PROP_TOOLBAR_STYLE, + PROP_PROGRESS_IN_LOCATION, PROP_TOOLBAR_ITEMS, PROP_COMPACT_SIDEPANEL, @@ -425,6 +427,22 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class) MIDORI_TOOLBAR_DEFAULT, flags)); + /** + * MidoriWebSettings:progress-in-location: + * + * Whether to show loading progress in the location entry. + * + * Since: 0.1.3 + */ + g_object_class_install_property (gobject_class, + PROP_PROGRESS_IN_LOCATION, + g_param_spec_boolean ( + "progress-in-location", + _("Show progress in location entry"), + _("Whether to show loading progress in the location entry"), + TRUE, + flags)); + g_object_class_install_property (gobject_class, PROP_TOOLBAR_ITEMS, g_param_spec_string ( @@ -956,6 +974,9 @@ midori_web_settings_set_property (GObject* object, case PROP_TOOLBAR_STYLE: web_settings->toolbar_style = g_value_get_enum (value); break; + case PROP_PROGRESS_IN_LOCATION: + web_settings->progress_in_location = g_value_get_boolean (value); + break; case PROP_TOOLBAR_ITEMS: katze_assign (web_settings->toolbar_items, g_value_dup_string (value)); break; @@ -1134,6 +1155,9 @@ midori_web_settings_get_property (GObject* object, case PROP_TOOLBAR_STYLE: g_value_set_enum (value, web_settings->toolbar_style); break; + case PROP_PROGRESS_IN_LOCATION: + g_value_set_boolean (value, web_settings->progress_in_location); + break; case PROP_TOOLBAR_ITEMS: g_value_set_string (value, web_settings->toolbar_items); break;