From cea9c3f426dd328585553adea958de0b204168bf Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 13 Feb 2011 18:34:22 +0100 Subject: [PATCH] Always show progress inside location bar --- midori/midori-browser.c | 36 ++---------------------------------- midori/midori-preferences.c | 2 -- midori/midori-websettings.c | 24 ------------------------ 3 files changed, 2 insertions(+), 60 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 4ab29d9f..c84794f5 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -80,7 +80,6 @@ struct _MidoriBrowser GtkWidget* statusbar; GtkWidget* statusbar_contents; GtkWidget* transferbar; - GtkWidget* progressbar; gchar* statusbar_text; gint last_window_width, last_window_height; @@ -100,7 +99,6 @@ struct _MidoriBrowser gboolean show_navigationbar; gboolean show_statusbar; gboolean speed_dial_in_new_tabs; - gboolean progress_in_location; guint maximum_history_age; gchar* location_entry_search; gchar* news_aggregator; @@ -330,8 +328,7 @@ _midori_browser_update_interface (MidoriBrowser* browser) "stock-id", GTK_STOCK_REFRESH, "tooltip", _("Reload the current page"), "sensitive", can_reload, NULL); - gtk_widget_hide (browser->progressbar); - if (!browser->show_navigationbar && !browser->show_statusbar) + if (!browser->show_navigationbar) gtk_widget_hide (browser->navigationbar); } else @@ -339,11 +336,7 @@ _midori_browser_update_interface (MidoriBrowser* browser) g_object_set (action, "stock-id", GTK_STOCK_STOP, "tooltip", _("Stop loading the current page"), NULL); - if (!browser->progress_in_location || !gtk_widget_get_visible (browser->navigationbar)) - gtk_widget_show (browser->progressbar); - if (!gtk_widget_get_visible (browser->statusbar) && - !gtk_widget_get_visible (browser->navigationbar) && - browser->progress_in_location) + if (!gtk_widget_get_visible (browser->navigationbar)) gtk_widget_show (browser->navigationbar); } @@ -434,30 +427,12 @@ _midori_browser_update_progress (MidoriBrowser* browser, { MidoriLocationAction* action; gdouble progress; - gchar* message; action = MIDORI_LOCATION_ACTION (_action_by_name (browser, "Location")); progress = midori_view_get_progress (view); /* When we are finished, we don't want to *see* progress anymore */ if (midori_view_get_load_status (view) == MIDORI_LOAD_FINISHED) progress = 0.0; - if (progress > 0.0) - { - gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (browser->progressbar), - progress); - message = g_strdup_printf (_("%d%% loaded"), (gint)(progress * 100)); - gtk_progress_bar_set_text (GTK_PROGRESS_BAR (browser->progressbar), - message); - g_free (message); - if (!browser->progress_in_location) - progress = 0.0; - } - else - { - gtk_progress_bar_pulse (GTK_PROGRESS_BAR (browser->progressbar)); - gtk_progress_bar_set_text (GTK_PROGRESS_BAR (browser->progressbar), - NULL); - } midori_location_action_set_progress (action, progress); } @@ -5980,10 +5955,6 @@ midori_browser_init (MidoriBrowser* browser) #endif gtk_box_pack_start (GTK_BOX (vbox), browser->statusbar, FALSE, FALSE, 0); - browser->progressbar = gtk_progress_bar_new (); - gtk_box_pack_start (GTK_BOX (browser->statusbar_contents), - browser->progressbar, FALSE, FALSE, 3); - browser->transferbar = g_object_new (MIDORI_TYPE_TRANSFERBAR, NULL); gtk_box_pack_start (GTK_BOX (browser->statusbar_contents), browser->transferbar, FALSE, FALSE, 3); gtk_toolbar_set_show_arrow (GTK_TOOLBAR (browser->transferbar), FALSE); @@ -6171,7 +6142,6 @@ _midori_browser_update_settings (MidoriBrowser* browser) "last-web-search", &last_web_search, "location-entry-search", &browser->location_entry_search, "close-buttons-on-tabs", &close_buttons_on_tabs, - "progress-in-location", &browser->progress_in_location, "maximum-history-age", &browser->maximum_history_age, "news-aggregator", &browser->news_aggregator, NULL); @@ -6305,8 +6275,6 @@ midori_browser_settings_notify (MidoriWebSettings* web_settings, browser->show_statusbar = g_value_get_boolean (&value); else if (name == g_intern_string ("speed-dial-in-new-tabs")) browser->speed_dial_in_new_tabs = g_value_get_boolean (&value); - else if (name == g_intern_string ("progress-in-location")) - browser->progress_in_location = g_value_get_boolean (&value); else if (name == g_intern_string ("search-engines-in-completion")) { if (g_value_get_boolean (&value)) diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c index 405edfc1..991befbe 100644 --- a/midori/midori-preferences.c +++ b/midori/midori-preferences.c @@ -447,8 +447,6 @@ midori_preferences_set_settings (MidoriPreferences* preferences, INDENTED_ADD (katze_property_label (settings, "toolbar-style")); button = katze_property_proxy (settings, "toolbar-style", NULL); SPANNED_ADD (button); - button = katze_property_proxy (settings, "progress-in-location", NULL); - INDENTED_ADD (button); #endif FRAME_NEW (_("Browsing")); label = katze_property_label (settings, "open-new-pages-in"); diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c index 5035006f..81873bb4 100644 --- a/midori/midori-websettings.c +++ b/midori/midori-websettings.c @@ -37,7 +37,6 @@ struct _MidoriWebSettings gboolean show_transferbar : 1; gboolean show_statusbar : 1; MidoriToolbarStyle toolbar_style : 3; - gboolean progress_in_location : 1; gboolean search_engines_in_completion : 1; gboolean compact_sidepanel : 1; gboolean show_panel_controls : 1; @@ -115,7 +114,6 @@ enum PROP_SHOW_STATUSBAR, PROP_TOOLBAR_STYLE, - PROP_PROGRESS_IN_LOCATION, PROP_SEARCH_ENGINES_IN_COMPLETION, PROP_TOOLBAR_ITEMS, PROP_COMPACT_SIDEPANEL, @@ -506,22 +504,6 @@ 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)); - /** * MidoriWebSettings:search-engines-in-completion: * @@ -1288,9 +1270,6 @@ 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_SEARCH_ENGINES_IN_COMPLETION: web_settings->search_engines_in_completion = g_value_get_boolean (value); break; @@ -1560,9 +1539,6 @@ 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_SEARCH_ENGINES_IN_COMPLETION: g_value_set_boolean (value, web_settings->search_engines_in_completion); break; -- 2.39.5