From a838f6d5ab82bac98a25fb3ce9cb2c0cd575146c Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Fri, 20 Jun 2003 15:43:38 +0000 Subject: Use the embed url, the tab one can make no sense if the user edited it. 2003-06-20 Marco Pesenti Gritti * src/ephy-favicon-action.c: (each_url_get_data_binder): Use the embed url, the tab one can make no sense if the user edited it. * src/toolbar.c: (location_user_changed_cb), (toolbar_set_window), (toolbar_init), (toolbar_set_location): Block location updating when setting tab title on user_changed. --- ChangeLog | 12 ++++++++++++ src/ephy-favicon-action.c | 8 ++++++-- src/toolbar.c | 23 +++++++++++++++-------- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 17369ed4c..31a5047bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2003-06-20 Marco Pesenti Gritti + + * src/ephy-favicon-action.c: (each_url_get_data_binder): + + Use the embed url, the tab one can make no sense if the user + edited it. + + * src/toolbar.c: (location_user_changed_cb), (toolbar_set_window), + (toolbar_init), (toolbar_set_location): + + Block location updating when setting tab title on user_changed. + 2003-06-20 Marco Pesenti Gritti * lib/widgets/ephy-location-entry.c: diff --git a/src/ephy-favicon-action.c b/src/ephy-favicon-action.c index aa88571c5..8a35d8012 100644 --- a/src/ephy-favicon-action.c +++ b/src/ephy-favicon-action.c @@ -84,14 +84,18 @@ static void each_url_get_data_binder (EphyDragEachSelectedItemDataGet iteratee, gpointer iterator_context, gpointer data) { - const char *location; + char *location; EphyTab *tab; + EphyEmbed *embed; EphyWindow *window = EPHY_WINDOW(iterator_context); tab = ephy_window_get_active_tab (window); - location = ephy_tab_get_location (tab); + embed = ephy_tab_get_embed (tab); + ephy_embed_get_location (embed, TRUE, &location); iteratee (location, -1, -1, -1, -1, data); + + g_free (location); } static void diff --git a/src/toolbar.c b/src/toolbar.c index 78c0d39f5..e47ed7d8c 100755 --- a/src/toolbar.c +++ b/src/toolbar.c @@ -81,6 +81,7 @@ struct ToolbarPrivate EggMenuMerge *ui_merge; EggActionGroup *action_group; gboolean visibility; + gboolean can_set_location; GtkWidget *spinner; GtkWidget *favicon; GtkWidget *go; @@ -471,17 +472,19 @@ get_location_entry (Toolbar *t) } static void -location_user_changed_cb (GtkWidget *entry, EphyWindow *window) +location_user_changed_cb (GtkWidget *entry, Toolbar *t) { EphyTab *tab; char *address; - tab = ephy_window_get_active_tab (window); + tab = ephy_window_get_active_tab (t->priv->window); g_return_if_fail (IS_EPHY_TAB (tab)); + t->priv->can_set_location = FALSE; address = ephy_location_entry_get_location (EPHY_LOCATION_ENTRY (entry)); ephy_tab_set_location (tab, address, TAB_ADDRESS_EXPIRE_CURRENT); g_free (address); + t->priv->can_set_location = TRUE; } static void @@ -517,7 +520,7 @@ toolbar_set_window (Toolbar *t, EphyWindow *window) g_signal_connect_object (get_location_entry (t), "user_changed", G_CALLBACK (location_user_changed_cb), - window, 0); + t, 0); } static void @@ -528,6 +531,7 @@ toolbar_init (Toolbar *t) t->priv->window = NULL; t->priv->ui_merge = NULL; t->priv->visibility = TRUE; + t->priv->can_set_location = TRUE; } static void @@ -631,12 +635,15 @@ toolbar_set_location (Toolbar *t, { GtkWidget *location; - location = get_location_entry (t); - g_return_if_fail (location != NULL); + if (t->priv->can_set_location) + { + location = get_location_entry (t); + g_return_if_fail (location != NULL); - ephy_location_entry_set_location - (EPHY_LOCATION_ENTRY (location), - alocation ? alocation : ""); + ephy_location_entry_set_location + (EPHY_LOCATION_ENTRY (location), + alocation ? alocation : ""); + } } void -- cgit v1.2.3