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.
This commit is contained in:
Christian Dywan 2009-02-11 23:41:09 +01:00
parent 60e81f734b
commit e727e714da
3 changed files with 39 additions and 7 deletions

View file

@ -269,13 +269,17 @@ _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);
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);
/* FIXME: This won't work due to a bug in GtkIconEntry */
@ -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

View file

@ -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");

View file

@ -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;