]> spindle.queued.net Git - midori/commitdiff
Update address and actions properly when navigating in-page
authorChristian Dywan <christian@twotoasts.de>
Thu, 14 May 2009 23:18:14 +0000 (01:18 +0200)
committerChristian Dywan <christian@twotoasts.de>
Thu, 14 May 2009 23:18:14 +0000 (01:18 +0200)
midori/midori-browser.c
midori/midori-view.c

index 2ed6fbe1a27245ed710c0884ea6c05c741296d1a..8cd62669ef6f28f95c728b7c358d24748c75c105 100644 (file)
@@ -509,6 +509,17 @@ midori_view_context_ready_cb (GtkWidget*     view,
     g_signal_emit (browser, signals[CONTEXT_READY], 0, js_context);
 }
 
+static void
+midori_view_notify_uri_cb (GtkWidget*     view,
+                           GParamSpec*    pspec,
+                           MidoriBrowser* browser)
+{
+    const gchar* uri = midori_view_get_display_uri (MIDORI_VIEW (view));
+    GtkAction* action = _action_by_name (browser, "Location");
+    midori_location_action_set_uri (MIDORI_LOCATION_ACTION (action), uri);
+    _midori_browser_update_interface (browser);
+}
+
 static void
 midori_view_notify_title_cb (GtkWidget*     view,
                              GParamSpec*    pspec,
@@ -1376,6 +1387,8 @@ _midori_browser_add_tab (MidoriBrowser* browser,
                       midori_view_notify_progress_cb, browser,
                       "signal::context-ready",
                       midori_view_context_ready_cb, browser,
+                      "signal::notify::uri",
+                      midori_view_notify_uri_cb, browser,
                       "signal::notify::title",
                       midori_view_notify_title_cb, browser,
                       "signal::notify::zoom-level",
index 867cb227606f4c872a7dcdfb203fa0134541b9a7..f8aa4c54fccd2ad8f661be2e253c7e5165ce1984 100644 (file)
@@ -793,6 +793,25 @@ webkit_web_view_load_finished_cb (WebKitWebView*  web_view,
     g_object_thaw_notify (G_OBJECT (view));
 }
 
+#if WEBKIT_CHECK_VERSION (1, 1, 4)
+static void
+webkit_web_view_notify_uri_cb (WebKitWebView* web_view,
+                               GParamSpec*    pspec,
+                               MidoriView*    view)
+{
+    g_object_get (web_view, "uri", &view->uri, NULL);
+    g_object_notify (G_OBJECT (view), "uri");
+}
+
+static void
+webkit_web_view_notify_title_cb (WebKitWebView* web_view,
+                                 GParamSpec*    pspec,
+                                 MidoriView*    view)
+{
+    g_object_get (web_view, "title", &view->title, NULL);
+    g_object_notify (G_OBJECT (view), "title");
+}
+#else
 static void
 webkit_web_view_title_changed_cb (WebKitWebView*  web_view,
                                   WebKitWebFrame* web_frame,
@@ -801,6 +820,7 @@ webkit_web_view_title_changed_cb (WebKitWebView*  web_view,
 {
     g_object_set (view, "title", title, NULL);
 }
+#endif
 
 static void
 webkit_web_view_statusbar_text_changed_cb (WebKitWebView* web_view,
@@ -1904,8 +1924,15 @@ midori_view_construct_web_view (MidoriView* view)
                       webkit_web_view_progress_changed_cb, view,
                       "signal::load-finished",
                       webkit_web_view_load_finished_cb, view,
+                      #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
                       "signal::title-changed",
                       webkit_web_view_title_changed_cb, view,
+                      #endif
                       "signal::status-bar-text-changed",
                       webkit_web_view_statusbar_text_changed_cb, view,
                       "signal::hovering-over-link",