aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog15
-rw-r--r--src/Makefile.am1
-rw-r--r--src/ephy-lockdown.c3
-rw-r--r--src/ephy-shell.c2
-rw-r--r--src/ephy-tab.c56
-rw-r--r--src/ephy-tab.h12
-rwxr-xr-xsrc/ephy-toolbar.c3
-rw-r--r--src/epiphany.defs1
8 files changed, 68 insertions, 25 deletions
diff --git a/ChangeLog b/ChangeLog
index 6d2e77f74..ec767d3c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2005-08-10 Christian Persch <chpe@cvs.gnome.org>
+
+ * src/ephy-lockdown.c: (update_location_editable):
+ * src/ephy-shell.c: (ephy_shell_new_tab_full):
+ * src/ephy-tab.c: (ephy_tab_set_property), (ephy_tab_set_address),
+ (ephy_tab_open_uri_cb), (ephy_tab_address_cb), (ensure_page_info),
+ (ephy_tab_net_state_cb), (ephy_tab_init), (ephy_tab_get_address),
+ (ephy_tab_get_typed_address), (ephy_tab_set_typed_address):
+ * src/ephy-tab.h:
+ * src/ephy-toolbar.c: (sync_user_input_cb):
+ * src/epiphany.defs:
+
+ Open new tabs with blank url bar if we're loading the homepage.
+ Fixes bug #313012.
+
2005-08-10 Jean-François Rameau <jframeau@cvs.gnome.org>
* embed/mozilla/MozDownload.cpp (OnStateChange):
diff --git a/src/Makefile.am b/src/Makefile.am
index 3ae99e5f0..b32a7cc83 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -302,7 +302,6 @@ MAINTAINERCLEANFILES = $(stamp_files) $(BUILT_SOURCES)
if ENABLE_PYTHON
BINDING_HEADERS_SRCDIR_IN = \
- embed/mozilla/mozilla-embed-event.h \
embed/ephy-command-manager.h \
embed/ephy-cookie-manager.h \
embed/ephy-embed-event.h \
diff --git a/src/ephy-lockdown.c b/src/ephy-lockdown.c
index e02ebb79f..a2397c9df 100644
--- a/src/ephy-lockdown.c
+++ b/src/ephy-lockdown.c
@@ -108,7 +108,8 @@ update_location_editable (EphyWindow *window,
address = ephy_embed_get_location (embed, TRUE);
ephy_toolbar_set_location (EPHY_TOOLBAR (toolbar), address, NULL);
- ephy_tab_set_typed_address (tab, NULL);
+ ephy_tab_set_typed_address (tab, NULL,
+ EPHY_TAB_ADDRESS_EXPIRE_CURRENT);
g_free (address);
}
}
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 9dec961e9..0fba9847f 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -768,6 +768,8 @@ ephy_shell_new_tab_full (EphyShell *shell,
if (flags & EPHY_NEW_TAB_HOME_PAGE ||
flags & EPHY_NEW_TAB_NEW_PAGE)
{
+ ephy_tab_set_typed_address (tab, "",
+ EPHY_TAB_ADDRESS_EXPIRE_NEXT);
ephy_toolbar_activate_location (toolbar);
is_empty = load_homepage (embed);
}
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index 427e0a124..06088717f 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -96,15 +96,9 @@ struct _EphyTabPrivate
guint is_loading : 1;
guint is_setting_zoom : 1;
EphyEmbedSecurityLevel security_level;
- /*
- guint security_level : 3; ??
- */
- /*
- gboolean visibility;
- gboolean load_status;
- gboolean is_setting_zoom;
- gboolean address_expire;
- */
+ /* guint security_level : 3; ? */
+ EphyTabAddressExpire address_expire;
+ /* guint address_expire : 2; ? */
/* File watch */
GnomeVFSMonitorHandle *monitor;
@@ -219,7 +213,8 @@ ephy_tab_set_property (GObject *object,
{
case PROP_TYPED_ADDRESS:
- ephy_tab_set_typed_address (tab, g_value_get_string (value));
+ ephy_tab_set_typed_address (tab, g_value_get_string (value),
+ EPHY_TAB_ADDRESS_EXPIRE_NOW);
break;
case PROP_POPUPS_ALLOWED:
ephy_tab_set_popups_allowed (tab, g_value_get_boolean (value));
@@ -929,6 +924,7 @@ ephy_tab_set_address (EphyTab *tab,
char *address)
{
EphyTabPrivate *priv = tab->priv;
+ GObject *object = G_OBJECT (tab);
g_free (priv->address);
priv->address = address;
@@ -936,14 +932,17 @@ ephy_tab_set_address (EphyTab *tab,
priv->is_blank = address == NULL ||
strcmp (address, "about:blank") == 0;
- if (priv->is_loading && priv->typed_address != NULL)
+ if (priv->is_loading &&
+ priv->address_expire == EPHY_TAB_ADDRESS_EXPIRE_NOW &&
+ priv->typed_address != NULL)
{
g_free (priv->typed_address);
priv->typed_address = NULL;
+
+ g_object_notify (object, "typed-address");
}
- g_object_notify (G_OBJECT (tab), "address");
- g_object_notify (G_OBJECT (tab), "typed-address");
+ g_object_notify (object, "address");
}
/* Public functions */
@@ -1418,7 +1417,7 @@ ephy_tab_open_uri_cb (EphyEmbed *embed,
EphyTabPrivate *priv = tab->priv;
/* Set the address here if we have a blank page.
- * See bug # .
+ * See bug #147840.
*/
if (priv->is_blank)
{
@@ -1446,7 +1445,8 @@ ephy_tab_address_cb (EphyEmbed *embed,
/* Do not expose about:blank to the user, an empty address
bar will do better */
- if (address == NULL || strcmp (address, "about:blank") == 0)
+ if (address == NULL || address[0] == '\0' ||
+ strcmp (address, "about:blank") == 0)
{
ephy_tab_set_address (tab, NULL);
ephy_tab_set_title (tab, embed, NULL);
@@ -1688,7 +1688,8 @@ ensure_page_info (EphyTab *tab, EphyEmbed *embed, const char *address)
{
EphyTabPrivate *priv = tab->priv;
- if (priv->address == NULL || priv->address[0] != '\0')
+ if ((priv->address == NULL || priv->address[0] == '\0') &&
+ priv->address_expire == EPHY_TAB_ADDRESS_EXPIRE_NOW)
{
ephy_tab_set_address (tab, g_strdup (address));
}
@@ -1744,6 +1745,8 @@ ephy_tab_net_state_cb (EphyEmbed *embed,
g_free (priv->loading_title);
priv->loading_title = NULL;
+ priv->address_expire = EPHY_TAB_ADDRESS_EXPIRE_NOW;
+
g_object_notify (object, "title");
g_object_thaw_notify (object);
@@ -2008,6 +2011,7 @@ ephy_tab_init (EphyTab *tab)
priv->typed_address = NULL;
priv->title = NULL;
priv->loading_title = NULL;
+ priv->address_expire = EPHY_TAB_ADDRESS_EXPIRE_NOW;
embed = ephy_embed_factory_new_object (EPHY_TYPE_EMBED);
g_assert (embed != NULL);
@@ -2295,19 +2299,31 @@ ephy_tab_get_typed_address (EphyTab *tab)
/**
* ephy_tab_set_typed_address:
* @tab: an #EphyTab
- *
+ * @address: the new typed address, or %NULL to clear it
+ * @expire: when to expire this address_expire
+ *
* Sets the text that @tab's #EphyWindow will display in its location toolbar
* entry when @tab is selected.
**/
void
ephy_tab_set_typed_address (EphyTab *tab,
- const char *address)
+ const char *address,
+ EphyTabAddressExpire expire)
{
EphyTabPrivate *priv = tab->priv;
g_free (priv->typed_address);
- priv->typed_address = address != NULL && address[0] != '\0'
- ? g_strdup (address) : NULL;
+ priv->typed_address = g_strdup (address);
+
+ if (expire == EPHY_TAB_ADDRESS_EXPIRE_CURRENT &&
+ !priv->is_loading)
+ {
+ priv->address_expire = EPHY_TAB_ADDRESS_EXPIRE_NOW;
+ }
+ else
+ {
+ priv->address_expire = expire;
+ }
g_object_notify (G_OBJECT (tab), "typed-address");
}
diff --git a/src/ephy-tab.h b/src/ephy-tab.h
index ac39899ce..f84595c02 100644
--- a/src/ephy-tab.h
+++ b/src/ephy-tab.h
@@ -42,11 +42,18 @@ typedef struct _EphyTabPrivate EphyTabPrivate;
typedef enum
{
- EPHY_TAB_NAV_UP = 1 << 0,
+ EPHY_TAB_NAV_UP = 1 << 0,
EPHY_TAB_NAV_BACK = 1 << 1,
EPHY_TAB_NAV_FORWARD = 1 << 2
} EphyTabNavigationFlags;
+typedef enum
+{
+ EPHY_TAB_ADDRESS_EXPIRE_NOW,
+ EPHY_TAB_ADDRESS_EXPIRE_NEXT,
+ EPHY_TAB_ADDRESS_EXPIRE_CURRENT
+} EphyTabAddressExpire;
+
struct _EphyTab
{
GtkBin parent;
@@ -89,7 +96,8 @@ const char *ephy_tab_get_address (EphyTab *tab);
const char *ephy_tab_get_typed_address (EphyTab *tab);
void ephy_tab_set_typed_address (EphyTab *tab,
- const char *address);
+ const char *address,
+ EphyTabAddressExpire expire);
EphyTabNavigationFlags ephy_tab_get_navigation_flags (EphyTab *tab);
diff --git a/src/ephy-toolbar.c b/src/ephy-toolbar.c
index 377eb5357..eb8691fae 100755
--- a/src/ephy-toolbar.c
+++ b/src/ephy-toolbar.c
@@ -224,7 +224,8 @@ sync_user_input_cb (EphyLocationAction *action,
address = ephy_location_action_get_address (action);
priv->updating_address = TRUE;
- ephy_tab_set_typed_address (tab, address);
+ ephy_tab_set_typed_address (tab, address,
+ EPHY_TAB_ADDRESS_EXPIRE_CURRENT);
priv->updating_address = FALSE;
}
diff --git a/src/epiphany.defs b/src/epiphany.defs
index 338e88b46..058c038e8 100644
--- a/src/epiphany.defs
+++ b/src/epiphany.defs
@@ -3106,6 +3106,7 @@
(return-type "none")
(parameters
'("const-char*" "address")
+ '("EphyTabAddressExpire" "expire")
)
)