[Xfce4-commits] <midori:master> Consistently use internal action toggling

Christian Dywan noreply at xfce.org
Tue Jan 24 23:58:05 CET 2012


Updating branch refs/heads/master
         to 3f8784213dfc06bc115c98df38e74af872f85149 (commit)
       from e4475b4c495dcab6fe74b843b6f8acfef51f3c07 (commit)

commit 3f8784213dfc06bc115c98df38e74af872f85149
Author: Christian Dywan <christian at twotoasts.de>
Date:   Tue Jan 24 23:40:45 2012 +0100

    Consistently use internal action toggling

 midori/midori-browser.c |   23 +++++++----------------
 1 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 72ab33b..32d72a5 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -298,8 +298,7 @@ _midori_browser_update_interface (MidoriBrowser* browser)
     _action_set_sensitive (browser, "Next",
         midori_view_get_next_page (view) != NULL);
 
-    gtk_action_set_visible (_action_by_name (browser, "AddSpeedDial"),
-        !midori_view_is_blank (view));
+    _action_set_visible (browser, "AddSpeedDial", !midori_view_is_blank (view));
     _action_set_sensitive (browser, "SaveAs", midori_view_can_save (view));
     _action_set_sensitive (browser, "Print", midori_view_can_print (view));
     _action_set_sensitive (browser, "ZoomIn", midori_view_can_zoom_in (view));
@@ -350,13 +349,13 @@ _midori_browser_update_interface (MidoriBrowser* browser)
     {
         midori_location_action_set_secondary_icon (
             MIDORI_LOCATION_ACTION (action), STOCK_NEWS_FEED);
-        gtk_action_set_sensitive (_action_by_name (browser, "AddNewsFeed"), TRUE);
+        _action_set_sensitive (browser, "AddNewsFeed", TRUE);
     }
     else
     {
         midori_location_action_set_secondary_icon (
             MIDORI_LOCATION_ACTION (action), GTK_STOCK_JUMP_TO);
-        gtk_action_set_sensitive (_action_by_name (browser, "AddNewsFeed"), FALSE);
+        _action_set_sensitive (browser, "AddNewsFeed", FALSE);
     }
     midori_location_action_set_security_hint (
         MIDORI_LOCATION_ACTION (action), midori_view_get_security (view));
@@ -6729,29 +6728,21 @@ midori_browser_settings_notify (MidoriWebSettings* web_settings,
         _toggle_tabbar_smartly (browser, FALSE);
     else if (name == g_intern_string ("show-menubar"))
     {
-        gtk_toggle_action_set_active (
-            GTK_TOGGLE_ACTION (_action_by_name (browser, "Menubar")),
-            g_value_get_boolean (&value));
+        _action_set_active (browser, "Menubar", g_value_get_boolean (&value));
     }
     else if (name == g_intern_string ("show-navigationbar"))
     {
         browser->show_navigationbar = g_value_get_boolean (&value);
-        gtk_toggle_action_set_active (
-            GTK_TOGGLE_ACTION (_action_by_name (browser, "Navigationbar")),
-            g_value_get_boolean (&value));
+        _action_set_active (browser, "Navigationbar", g_value_get_boolean (&value));
     }
     else if (name == g_intern_string ("show-bookmarkbar"))
     {
-        gtk_toggle_action_set_active (
-            GTK_TOGGLE_ACTION (_action_by_name (browser, "Bookmarkbar")),
-            g_value_get_boolean (&value));
+        _action_set_active (browser, "Bookmarkbar", g_value_get_boolean (&value));
     }
     else if (name == g_intern_string ("show-statusbar"))
     {
         browser->show_statusbar = g_value_get_boolean (&value);
-        gtk_toggle_action_set_active (
-            GTK_TOGGLE_ACTION (_action_by_name (browser, "Statusbar")),
-            g_value_get_boolean (&value));
+        _action_set_active (browser, "Statusbar", g_value_get_boolean (&value));
     }
     else if (name == g_intern_string ("location-entry-search"))
     {


More information about the Xfce4-commits mailing list