aboutsummaryrefslogtreecommitdiffstats
path: root/src/toolbar.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/toolbar.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/toolbar.c')
-rwxr-xr-xsrc/toolbar.c73
1 files changed, 36 insertions, 37 deletions
diff --git a/src/toolbar.c b/src/toolbar.c
index 2896c7341..78c0d39f5 100755
--- a/src/toolbar.c
+++ b/src/toolbar.c
@@ -81,7 +81,6 @@ struct ToolbarPrivate
EggMenuMerge *ui_merge;
EggActionGroup *action_group;
gboolean visibility;
- GtkWidget *location_entry;
GtkWidget *spinner;
GtkWidget *favicon;
GtkWidget *go;
@@ -457,6 +456,34 @@ update_toolbar_remove_flag (EphyToolbarsModel *model, gpointer data)
}
}
+static GtkWidget *
+get_location_entry (Toolbar *t)
+{
+ EggAction *action;
+ GtkWidget *location;
+
+ action = egg_action_group_get_action
+ (t->priv->action_group, "Location");
+ location = ephy_location_action_get_widget
+ (EPHY_LOCATION_ACTION (action));
+
+ return location;
+}
+
+static void
+location_user_changed_cb (GtkWidget *entry, EphyWindow *window)
+{
+ EphyTab *tab;
+ char *address;
+
+ tab = ephy_window_get_active_tab (window);
+ g_return_if_fail (IS_EPHY_TAB (tab));
+
+ address = ephy_location_entry_get_location (EPHY_LOCATION_ENTRY (entry));
+ ephy_tab_set_location (tab, address, TAB_ADDRESS_EXPIRE_CURRENT);
+ g_free (address);
+}
+
static void
toolbar_set_window (Toolbar *t, EphyWindow *window)
{
@@ -487,6 +514,10 @@ toolbar_set_window (Toolbar *t, EphyWindow *window)
"MenuMerge", t->priv->ui_merge,
NULL);
init_bookmarks_toolbar (t);
+
+ g_signal_connect_object (get_location_entry (t), "user_changed",
+ G_CALLBACK (location_user_changed_cb),
+ window, 0);
}
static void
@@ -539,22 +570,6 @@ toolbar_new (EphyWindow *window)
return t;
}
-void
-toolbar_edit_location (Toolbar *t)
-{
- EggAction *action;
- GtkWidget *location;
-
- action = egg_action_group_get_action
- (t->priv->action_group, "Location");
- location = ephy_location_action_get_widget
- (EPHY_LOCATION_ACTION (action));
- g_return_if_fail (location != NULL);
-
- ephy_location_entry_edit
- (EPHY_LOCATION_ENTRY(location));
-}
-
static void
location_finished_cb (GtkWidget *location, GtkWidget *toolbar)
{
@@ -568,14 +583,10 @@ location_finished_cb (GtkWidget *location, GtkWidget *toolbar)
void
toolbar_activate_location (Toolbar *t)
{
- EggAction *action;
GtkWidget *location;
GtkWidget *location_tb;
- action = egg_action_group_get_action
- (t->priv->action_group, "Location");
- location = ephy_location_action_get_widget
- (EPHY_LOCATION_ACTION (action));
+ location = get_location_entry (t);
g_return_if_fail (location != NULL);
location_tb = gtk_widget_get_ancestor (location, EGG_TYPE_TOOLBAR);
@@ -618,13 +629,9 @@ void
toolbar_set_location (Toolbar *t,
const char *alocation)
{
- EggAction *action;
GtkWidget *location;
- action = egg_action_group_get_action
- (t->priv->action_group, "Location");
- location = ephy_location_action_get_widget
- (EPHY_LOCATION_ACTION (action));
+ location = get_location_entry (t);
g_return_if_fail (location != NULL);
ephy_location_entry_set_location
@@ -650,13 +657,9 @@ toolbar_update_favicon (Toolbar *t)
char *
toolbar_get_location (Toolbar *t)
{
- EggAction *action;
GtkWidget *location;
- action = egg_action_group_get_action
- (t->priv->action_group, "Location");
- location = ephy_location_action_get_widget
- (EPHY_LOCATION_ACTION (action));
+ location = get_location_entry (t);
g_return_val_if_fail (location != NULL, NULL);
return ephy_location_entry_get_location
@@ -666,13 +669,9 @@ toolbar_get_location (Toolbar *t)
void
toolbar_clear_location_history (Toolbar *t)
{
- EggAction *action;
GtkWidget *location;
- action = egg_action_group_get_action
- (t->priv->action_group, "Location");
- location = ephy_location_action_get_widget
- (EPHY_LOCATION_ACTION (action));
+ location = get_location_entry (t),
g_return_if_fail (location != NULL);
ephy_location_entry_clear_history (EPHY_LOCATION_ENTRY (location));