[Xfce4-commits] <midori:master> Propagate URI changes and update Back, Forward actions

Christian Dywan noreply at xfce.org
Sun Feb 27 01:50:01 CET 2011


Updating branch refs/heads/master
         to 0e30ea37793defef3bcfdc8dffd449515d431c1d (commit)
       from 312821b016e53e9d0920e7ddf1a053f8cfcbbae3 (commit)

commit 0e30ea37793defef3bcfdc8dffd449515d431c1d
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sun Feb 27 01:48:06 2011 +0100

    Propagate URI changes and update Back, Forward actions
    
    Fixes: https://bugs.launchpad.net/midori/+bug/725826

 midori/midori-browser.c |    9 ++++++---
 midori/midori-view.c    |   11 +++++++++++
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 5a77b3f..e7e6f86 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -557,15 +557,18 @@ midori_view_context_ready_cb (GtkWidget*     view,
 }
 
 static void
-midori_view_notify_uri_cb (GtkWidget*     view,
+midori_view_notify_uri_cb (GtkWidget*     widget,
                            GParamSpec*    pspec,
                            MidoriBrowser* browser)
 {
-    if (view == midori_browser_get_current_tab (browser))
+    if (widget == midori_browser_get_current_tab (browser))
     {
-        const gchar* uri = midori_view_get_display_uri (MIDORI_VIEW (view));
+        MidoriView* view = MIDORI_VIEW (widget);
+        const gchar* uri = midori_view_get_display_uri (view);
         GtkAction* action = _action_by_name (browser, "Location");
         midori_location_action_set_text (MIDORI_LOCATION_ACTION (action), uri);
+        _action_set_sensitive (browser, "Back", midori_view_can_go_back (view));
+        _action_set_sensitive (browser, "Forward", midori_view_can_go_forward (view));
     }
 }
 
diff --git a/midori/midori-view.c b/midori/midori-view.c
index 5b5c178..fc1948b 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -1557,6 +1557,15 @@ midori_web_view_notify_icon_uri_cb (WebKitWebView* web_view,
 
 #if WEBKIT_CHECK_VERSION (1, 1, 4)
 static void
+webkit_web_view_notify_uri_cb (WebKitWebView* web_view,
+                               GParamSpec*    pspec,
+                               MidoriView*    view)
+{
+    katze_assign (view->uri, g_strdup (webkit_web_view_get_uri (web_view)));
+    g_object_notify (G_OBJECT (view), "uri");
+}
+
+static void
 webkit_web_view_notify_title_cb (WebKitWebView* web_view,
                                  GParamSpec*    pspec,
                                  MidoriView*    view)
@@ -3613,6 +3622,8 @@ midori_view_construct_web_view (MidoriView* view)
                       midori_web_view_notify_icon_uri_cb, view,
                       #endif
                       #if WEBKIT_CHECK_VERSION (1, 1, 4)
+                      "signal::notify::uri",
+                      webkit_web_view_notify_uri_cb, view,
                       "signal::notify::title",
                       webkit_web_view_notify_title_cb, view,
                       #else



More information about the Xfce4-commits mailing list