diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2003-07-02 02:28:05 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-07-02 02:28:05 +0800 |
commit | c621f76b4e81a30f6d6db5eb16bf2c75d0980468 (patch) | |
tree | d2b3d20a5b3482fc27b0faa3fdfcf2624d9ab93a /src | |
parent | 0ab1c928c782530b2d5ab0ad81cb46e5aaed539d (diff) | |
download | gsoc2013-epiphany-c621f76b4e81a30f6d6db5eb16bf2c75d0980468.tar gsoc2013-epiphany-c621f76b4e81a30f6d6db5eb16bf2c75d0980468.tar.gz gsoc2013-epiphany-c621f76b4e81a30f6d6db5eb16bf2c75d0980468.tar.bz2 gsoc2013-epiphany-c621f76b4e81a30f6d6db5eb16bf2c75d0980468.tar.lz gsoc2013-epiphany-c621f76b4e81a30f6d6db5eb16bf2c75d0980468.tar.xz gsoc2013-epiphany-c621f76b4e81a30f6d6db5eb16bf2c75d0980468.tar.zst gsoc2013-epiphany-c621f76b4e81a30f6d6db5eb16bf2c75d0980468.zip |
Make the location entry an EggToolItem, and provide a custom tooptip
2003-07-01 Christian Persch <chpe@cvs.gnome.org>
* lib/widgets/ephy-location-entry.h:
* lib/widgets/ephy-location-entry.c: (ephy_location_entry_set_tooltip),
(ephy_location_entry_construct_contents),
(ephy_location_entry_class_init), (ephy_location_entry_init),
(ephy_location_entry_finalize):
Make the location entry an EggToolItem, and provide a custom
tooptip setter. Fix mem leak.
* src/ephy-location-action.c: (create_tool_item),
(ephy_location_action_class_init), (connect_proxy):
Use the location entry EggToolItem instead of constructing it
explicitly.
* src/toolbar.c: (toolbar_setup_action):
Set tooltip for location entry.
* lib/egg/egg-action.c: (connect_proxy), (disconnect_proxy):
Connect the tooltip sync'er on any EggToolItem, not just EggTollButton:s.
Disconnect the tooltip sync func on disconnect, too.
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-location-action.c | 28 | ||||
-rwxr-xr-x | src/toolbar.c | 1 |
2 files changed, 5 insertions, 24 deletions
diff --git a/src/ephy-location-action.c b/src/ephy-location-action.c index 67ac05be3..d8d62b82e 100644 --- a/src/ephy-location-action.c +++ b/src/ephy-location-action.c @@ -20,7 +20,6 @@ #include "ephy-location-entry.h" #include "ephy-shell.h" #include "ephy-debug.h" -#include "eggtoolitem.h" static void ephy_location_action_init (EphyLocationAction *action); static void ephy_location_action_class_init (EphyLocationActionClass *class); @@ -62,25 +61,6 @@ ephy_location_action_get_type (void) return type; } -static GtkWidget * -create_tool_item (EggAction *action) -{ - GtkWidget *item; - GtkWidget *location; - - LOG ("Create location toolitem") - - item = GTK_WIDGET (egg_tool_item_new ()); - location = ephy_location_entry_new (); - gtk_container_add (GTK_CONTAINER (item), location); - egg_tool_item_set_expand (EGG_TOOL_ITEM (item), TRUE); - gtk_widget_show (location); - - LOG ("Create location toolitem: Done.") - - return item; -} - static void location_url_activate_cb (EphyLocationEntry *entry, const char *content, @@ -119,11 +99,12 @@ static void connect_proxy (EggAction *action, GtkWidget *proxy) { EphyAutocompletion *ac = ephy_shell_get_autocompletion (ephy_shell); - EphyLocationEntry *e; + EphyLocationEntry *e = EPHY_LOCATION_ENTRY (proxy); LOG ("Connect location proxy") - e = EPHY_LOCATION_ENTRY (GTK_BIN (proxy)->child); + g_return_if_fail (EPHY_IS_LOCATION_ENTRY (e)); + ephy_location_entry_set_autocompletion (e, ac); g_signal_connect (e, "activated", @@ -143,7 +124,6 @@ ephy_location_action_class_init (EphyLocationActionClass *class) action_class = EGG_ACTION_CLASS (class); action_class->toolbar_item_type = EPHY_TYPE_LOCATION_ENTRY; - action_class->create_tool_item = create_tool_item; action_class->connect_proxy = connect_proxy; ephy_location_action_signals[GO_LOCATION] = @@ -172,7 +152,7 @@ ephy_location_action_get_widget (EphyLocationAction *action) if (slist) { - return GTK_BIN (slist->data)->child; + return GTK_WIDGET (slist->data); } else { diff --git a/src/toolbar.c b/src/toolbar.c index da506f8c4..0a290d551 100755 --- a/src/toolbar.c +++ b/src/toolbar.c @@ -346,6 +346,7 @@ toolbar_setup_actions (Toolbar *t) "name", "Location", "label", _("Address Entry"), "stock_id", EPHY_STOCK_ENTRY, + "tooltip", _("Enter a web address to open, or a phrase to search for on the web."), NULL); g_signal_connect (action, "go_location", G_CALLBACK (go_location_cb), t->priv->window); |