From e7f273f39a2be023d4fdafafef324ef133d5140f Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Thu, 20 Jul 2006 10:25:38 +0000 Subject: When resetting the entry also emit user-changed, to restore the original 2006-07-20 Christian Persch * 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. --- ChangeLog | 9 +++++++++ lib/widgets/ephy-location-entry.c | 23 ++++++++++++++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0974185d3..1fd509a02 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-07-20 Christian Persch + + * 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. + 2006-07-18 Christian Persch * embed/mozilla/EphyPromptService.cpp: diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c index 88c097b4c..8f1af3db2 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; @@ -381,7 +382,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 */ } @@ -422,7 +423,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; } } @@ -548,7 +549,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); } } @@ -1079,8 +1080,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; @@ -1097,9 +1099,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) { -- cgit v1.2.1