diff options
author | David Bordoley <bordoley@msu.edu> | 2003-03-07 20:37:47 +0800 |
---|---|---|
committer | Dave Bordoley <Bordoley@src.gnome.org> | 2003-03-07 20:37:47 +0800 |
commit | ff8cb3c94a12a0c52f5d32c88598a018e7fa74c4 (patch) | |
tree | c9040fcd7f87bbc9eac0d190a9c076e282083b98 /src/ephy-go-action.c | |
parent | 49b1348c56bbcd4f00361b0aed4755242903efd8 (diff) | |
download | gsoc2013-epiphany-ff8cb3c94a12a0c52f5d32c88598a018e7fa74c4.tar gsoc2013-epiphany-ff8cb3c94a12a0c52f5d32c88598a018e7fa74c4.tar.gz gsoc2013-epiphany-ff8cb3c94a12a0c52f5d32c88598a018e7fa74c4.tar.bz2 gsoc2013-epiphany-ff8cb3c94a12a0c52f5d32c88598a018e7fa74c4.tar.lz gsoc2013-epiphany-ff8cb3c94a12a0c52f5d32c88598a018e7fa74c4.tar.xz gsoc2013-epiphany-ff8cb3c94a12a0c52f5d32c88598a018e7fa74c4.tar.zst gsoc2013-epiphany-ff8cb3c94a12a0c52f5d32c88598a018e7fa74c4.zip |
New toolbar action so that the "Go" button is always text only. Removed
2003-03-07 David Bordoley <bordoley@msu.edu>
* src/ephy-go-action.c: (new file)
* src/ephy-go-action.h: (new file)
* src/Makefile.am:
* src/ephy-window.c:
* src/toolbar.c:
* data/ui/epiphany-toolbar.xml.in:
* po/POTFILES.in:
New toolbar action so that the "Go" button is always text only.
Removed the old toolbar "Go" button.
Diffstat (limited to 'src/ephy-go-action.c')
-rw-r--r-- | src/ephy-go-action.c | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/src/ephy-go-action.c b/src/ephy-go-action.c new file mode 100644 index 000000000..0a5f1f77d --- /dev/null +++ b/src/ephy-go-action.c @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2003 Marco Pesenti Gritti + * Copyright (C) 2003 David Bordoley + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "ephy-go-action.h" + +#include <gtk/gtk.h> +#include <libgnome/gnome-i18n.h> +#include "eggtoolitem.h" +#include "ephy-debug.h" + +static void ephy_go_action_init (EphyGoAction *action); +static void ephy_go_action_class_init (EphyGoActionClass *class); +static void ephy_go_action_finalize (GObject *object); + +static GObjectClass *parent_class = NULL; + +GType +ephy_go_action_get_type (void) +{ + static GType type = 0; + + if (!type) + { + static const GTypeInfo type_info = + { + sizeof (EphyGoActionClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) ephy_go_action_class_init, + (GClassFinalizeFunc) NULL, + NULL, + sizeof (EphyGoAction), + 0, /* n_preallocs */ + (GInstanceInitFunc) ephy_go_action_init, + }; + + type = g_type_register_static (EGG_TYPE_ACTION, + "EphyGoAction", + &type_info, 0); + } + return type; +} + +static void +button_clicked (GtkWidget *widget, EggAction *action) +{ + g_signal_emit_by_name (action, "activate"); +} + +static GtkWidget * +create_tool_item (EggAction *action) +{ + GtkWidget *button; + GtkWidget *item; + + item = GTK_WIDGET (egg_tool_item_new ()); + + button = gtk_button_new_with_label (N_("Go")); + gtk_button_set_relief(GTK_BUTTON (button), GTK_RELIEF_NONE); + + g_signal_connect (G_OBJECT (button), "clicked", + G_CALLBACK (button_clicked), action); + + gtk_container_add (GTK_CONTAINER (item), button); + gtk_widget_show (button); + + return item; +} + +static void +ephy_go_action_class_init (EphyGoActionClass *class) +{ + EggActionClass *action_class; + GObjectClass *object_class = G_OBJECT_CLASS (class); + + object_class->finalize = ephy_go_action_finalize; + + parent_class = g_type_class_peek_parent (class); + action_class = EGG_ACTION_CLASS (class); + + action_class->create_tool_item = create_tool_item; +} + +static void +ephy_go_action_init (EphyGoAction *action) +{ +} + +static void +ephy_go_action_finalize (GObject *object) +{ + g_return_if_fail (EPHY_IS_GO_ACTION (object)); + + LOG ("Go action finalized") + + G_OBJECT_CLASS (parent_class)->finalize (object); +} |