]> spindle.queued.net Git - midori/commitdiff
Add a Preference Show progress in location entry
authorChristian Dywan <christian@twotoasts.de>
Wed, 11 Feb 2009 22:41:09 +0000 (23:41 +0100)
committerChristian Dywan <christian@twotoasts.de>
Wed, 11 Feb 2009 22:41:09 +0000 (23:41 +0100)
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.

midori/midori-browser.c
midori/midori-preferences.c
midori/midori-websettings.c

index b48df84a5af7e875f11dcd2fb5e212513b92a40e..0d2bd91998bbdfb97dbb93ecaff4d1b298107ff3 100644 (file)
@@ -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
index c17e6c7a70c1f5ab6a69674e56dde16d66ec3b3c..8a18e17b896a79f0c56ddd579a64053ccf00a6d4 100644 (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");
index 1a729b4f69dfe2b72ff6d211702b8eb4a306daed..69be9118b7565424f079ee81f4f10a2ec6de6d66 100644 (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;