aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-tab.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-06-20 20:19:44 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-06-20 20:19:44 +0800
commit5b80fbd659cd964a59bd8a07ebf09616569608c3 (patch)
treea23bdcbb1f90a1c31fed2a394a00b67e97e9df6a /src/ephy-tab.c
parent2d8717b4bab5d9ee5431078b9a3a9288bc15e487 (diff)
downloadgsoc2013-epiphany-5b80fbd659cd964a59bd8a07ebf09616569608c3.tar
gsoc2013-epiphany-5b80fbd659cd964a59bd8a07ebf09616569608c3.tar.gz
gsoc2013-epiphany-5b80fbd659cd964a59bd8a07ebf09616569608c3.tar.bz2
gsoc2013-epiphany-5b80fbd659cd964a59bd8a07ebf09616569608c3.tar.lz
gsoc2013-epiphany-5b80fbd659cd964a59bd8a07ebf09616569608c3.tar.xz
gsoc2013-epiphany-5b80fbd659cd964a59bd8a07ebf09616569608c3.tar.zst
gsoc2013-epiphany-5b80fbd659cd964a59bd8a07ebf09616569608c3.zip
Rewrite the url typed by user overwrite logic to fix bugs.
2003-06-20 Marco Pesenti Gritti <marco@it.gnome.org> * embed/mozilla/EphyWrapper.cpp: * lib/widgets/ephy-location-entry.c: (ephy_location_entry_class_init), (location_focus_out_cb), (ephy_location_entry_init), (insert_text_cb), (ephy_location_entry_key_press_event_cb), (ephy_location_entry_activate_cb), (ephy_location_entry_set_location), (ephy_location_entry_autocompletion_window_url_selected_cb), (ephy_location_entry_autocompletion_window_url_activated_cb), (ephy_location_entry_editable_changed_cb): * lib/widgets/ephy-location-entry.h: * src/ephy-shell.c: (ephy_shell_new_tab): * src/ephy-tab.c: (ephy_tab_set_property), (ephy_tab_set_link_message), (ephy_tab_set_window), (ephy_tab_address_cb), (ensure_address), (ephy_tab_net_state_cb), (ephy_tab_init), (ephy_tab_update_navigation_flags), (ephy_tab_set_location): * src/ephy-tab.h: * src/ephy-window.c: (ephy_window_notebook_switch_page_cb): * src/popup-commands.c: (get_event_info), (popup_cmd_copy_link_address): * src/toolbar.c: (get_location_entry), (location_user_changed_cb), (toolbar_set_window), (toolbar_activate_location), (toolbar_set_location), (toolbar_get_location), (toolbar_clear_location_history): * src/toolbar.h: Rewrite the url typed by user overwrite logic to fix bugs.
Diffstat (limited to 'src/ephy-tab.c')
-rw-r--r--src/ephy-tab.c53
1 files changed, 36 insertions, 17 deletions
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index 35226b583..2c34b0542 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -59,6 +59,7 @@ struct EphyTabPrivate
int load_percent;
gboolean visibility;
gboolean load_status;
+ TabAddressExpire address_expire;
int cur_requests;
int total_requests;
int width;
@@ -152,7 +153,8 @@ ephy_tab_set_property (GObject *object,
{
case PROP_ADDRESS:
- ephy_tab_set_location (tab, g_value_get_string (value));
+ ephy_tab_set_location (tab, g_value_get_string (value),
+ TAB_ADDRESS_EXPIRE_NOW);
break;
case PROP_WINDOW:
ephy_tab_set_window (tab, g_value_get_object (value));
@@ -421,7 +423,7 @@ ephy_tab_set_link_message (EphyTab *tab, const char *message)
g_free (tab->priv->link_message);
tab->priv->link_message = g_strdup (message);
-
+
g_object_notify (G_OBJECT (tab), "message");
}
@@ -450,7 +452,7 @@ ephy_tab_set_window (EphyTab *tab, EphyWindow *window)
if (window != tab->priv->window)
{
tab->priv->window = window;
-
+
g_object_notify (G_OBJECT (tab), "window");
}
}
@@ -562,11 +564,14 @@ ephy_tab_link_message_cb (EphyEmbed *embed,
static void
ephy_tab_address_cb (EphyEmbed *embed, EphyTab *tab)
{
- char *address;
+ if (tab->priv->address_expire == TAB_ADDRESS_EXPIRE_NOW)
+ {
+ char *address;
- ephy_embed_get_location (embed, TRUE, &address);
- ephy_tab_set_location (tab, address);
- g_free (address);
+ ephy_embed_get_location (embed, TRUE, &address);
+ ephy_tab_set_location (tab, address, TAB_ADDRESS_EXPIRE_NOW);
+ g_free (address);
+ }
ephy_tab_set_link_message (tab, NULL);
ephy_tab_set_icon_address (tab, NULL);
@@ -709,9 +714,10 @@ build_progress_from_requests (EphyTab *tab, EmbedState state)
static void
ensure_address (EphyTab *tab, const char *address)
{
- if (tab->priv->address == NULL)
- {
- ephy_tab_set_location (tab, address);
+ if (tab->priv->address == NULL &&
+ tab->priv->address_expire == TAB_ADDRESS_EXPIRE_NOW)
+ {
+ ephy_tab_set_location (tab, address, TAB_ADDRESS_EXPIRE_NOW);
}
}
@@ -744,7 +750,7 @@ ephy_tab_net_state_cb (EphyEmbed *embed, const char *uri,
}
else if (state & EMBED_STATE_STOP)
{
- /* tab load completed, save in session */
+ /* tab load completed, save in session */
Session *s;
s = ephy_shell_get_session (ephy_shell);
session_save (s, SESSION_CRASHED);
@@ -752,6 +758,7 @@ ephy_tab_net_state_cb (EphyEmbed *embed, const char *uri,
ephy_tab_set_load_percent (tab, 0);
ephy_tab_set_load_status (tab, FALSE);
ephy_tab_update_navigation_flags (tab);
+ tab->priv->address_expire = TAB_ADDRESS_EXPIRE_NOW;
}
}
@@ -921,7 +928,7 @@ ephy_tab_init (EphyTab *tab)
char *id;
LOG ("EphyTab initialising %p", tab)
-
+
single = ephy_embed_shell_get_embed_single
(EPHY_EMBED_SHELL (ephy_shell));
@@ -942,7 +949,8 @@ ephy_tab_init (EphyTab *tab)
tab->priv->link_message = NULL;
tab->priv->security_level = STATE_IS_UNKNOWN;
tab->priv->status_message = NULL;
- tab->priv->zoom = 1.0;
+ tab->priv->zoom = 1.0;
+ tab->priv->address_expire = TAB_ADDRESS_EXPIRE_NOW;
tab->priv->embed = ephy_embed_new (G_OBJECT(single));
ephy_embed_shell_add_embed (EPHY_EMBED_SHELL (ephy_shell),
@@ -1063,9 +1071,9 @@ ephy_tab_update_navigation_flags (EphyTab *tab)
if (flags != tab->priv->nav_flags)
{
tab->priv->nav_flags = flags;
-
+
g_object_notify (G_OBJECT (tab), "navigation");
- }
+ }
}
TabNavigationFlags
@@ -1168,13 +1176,24 @@ ephy_tab_get_location (EphyTab *tab)
void
ephy_tab_set_location (EphyTab *tab,
- const char *address)
+ const char *address,
+ TabAddressExpire expire)
{
g_return_if_fail (IS_EPHY_TAB (tab));
if (tab->priv->address) g_free (tab->priv->address);
tab->priv->address = g_strdup (address);
-
+
+ if (expire == TAB_ADDRESS_EXPIRE_CURRENT &&
+ !tab->priv->load_status)
+ {
+ tab->priv->address_expire = TAB_ADDRESS_EXPIRE_NOW;
+ }
+ else
+ {
+ tab->priv->address_expire = expire;
+ }
+
g_object_notify (G_OBJECT (tab), "address");
}