Update address and actions properly when navigating in-page

This commit is contained in:
Christian Dywan 2009-05-15 01:18:14 +02:00
parent ade0f16053
commit 8b3a74b6f0
2 changed files with 40 additions and 0 deletions

View 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",

View 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",