aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-07-20 18:26:11 +0800
committerChristian Persch <chpe@src.gnome.org>2006-07-20 18:26:11 +0800
commit9e6e63aae67c930bba8116171a32930b922321f0 (patch)
tree5b8cb0ab6671905bd89315b0e278d5dc48bf167a /lib
parent845877cbbba8ce71c5a9415b2efdd91c14850a7a (diff)
downloadgsoc2013-epiphany-9e6e63aae67c930bba8116171a32930b922321f0.tar
gsoc2013-epiphany-9e6e63aae67c930bba8116171a32930b922321f0.tar.gz
gsoc2013-epiphany-9e6e63aae67c930bba8116171a32930b922321f0.tar.bz2
gsoc2013-epiphany-9e6e63aae67c930bba8116171a32930b922321f0.tar.lz
gsoc2013-epiphany-9e6e63aae67c930bba8116171a32930b922321f0.tar.xz
gsoc2013-epiphany-9e6e63aae67c930bba8116171a32930b922321f0.tar.zst
gsoc2013-epiphany-9e6e63aae67c930bba8116171a32930b922321f0.zip
When resetting the entry also emit user-changed, to restore the original
2006-07-20 Christian Persch <chpe@cvs.gnome.org> * lib/widgets/ephy-location-entry.c: (entry_key_press_cb), (entry_activate_after_cb), (action_activated_after_cb), (ephy_location_entry_reset_internal), (ephy_location_entry_reset): When resetting the entry also emit user-changed, to restore the original URI in the tab's property. Bug #345934.
Diffstat (limited to 'lib')
-rw-r--r--lib/widgets/ephy-location-entry.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index d55a8de28..16b2c523b 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -110,6 +110,7 @@ static const GdkColor fallback_bg_colour = { 0, 0xf7f7, 0xf7f7, 0xbebe }; /* yel
static void ephy_location_entry_class_init (EphyLocationEntryClass *klass);
static void ephy_location_entry_init (EphyLocationEntry *le);
+static gboolean ephy_location_entry_reset_internal (EphyLocationEntry *, gboolean);
static GObjectClass *parent_class = NULL;
@@ -385,7 +386,7 @@ entry_key_press_cb (GtkEntry *entry,
if (event->keyval == GDK_Escape && state == 0)
{
- ephy_location_entry_reset (lentry);
+ ephy_location_entry_reset_internal (lentry, TRUE);
/* don't return TRUE since we want to cancel the autocompletion popup too */
}
@@ -426,7 +427,7 @@ entry_activate_after_cb (GtkEntry *entry,
if (priv->needs_reset)
{
- ephy_location_entry_reset (lentry);
+ ephy_location_entry_reset_internal (lentry, TRUE);
priv->needs_reset = FALSE;
}
}
@@ -552,7 +553,7 @@ action_activated_after_cb (GtkEntryCompletion *completion,
state == (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) ||
button == 2)
{
- ephy_location_entry_reset (lentry);
+ ephy_location_entry_reset_internal (lentry, TRUE);
}
}
@@ -1082,8 +1083,9 @@ ephy_location_entry_get_location (EphyLocationEntry *entry)
return gtk_entry_get_text (GTK_ENTRY (priv->icon_entry->entry));
}
-gboolean
-ephy_location_entry_reset (EphyLocationEntry *entry)
+static gboolean
+ephy_location_entry_reset_internal (EphyLocationEntry *entry,
+ gboolean notify)
{
EphyLocationEntryPrivate *priv = entry->priv;
const char *text, *old_text;
@@ -1100,9 +1102,20 @@ ephy_location_entry_reset (EphyLocationEntry *entry)
ephy_location_entry_set_location (entry, text, NULL);
g_free (url);
+ if (notify)
+ {
+ g_signal_emit (entry, signals[USER_CHANGED], 0);
+ }
+
return retval;
}
+gboolean
+ephy_location_entry_reset (EphyLocationEntry *entry)
+{
+ return ephy_location_entry_reset_internal (entry, FALSE);
+}
+
void
ephy_location_entry_activate (EphyLocationEntry *entry)
{