aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Bordoley <bordoley@msu.edu>2003-03-07 20:37:47 +0800
committerDave Bordoley <Bordoley@src.gnome.org>2003-03-07 20:37:47 +0800
commitff8cb3c94a12a0c52f5d32c88598a018e7fa74c4 (patch)
treec9040fcd7f87bbc9eac0d190a9c076e282083b98
parent49b1348c56bbcd4f00361b0aed4755242903efd8 (diff)
downloadgsoc2013-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.
-rw-r--r--ChangeLog12
-rw-r--r--data/ui/epiphany-toolbar.xml.in2
-rw-r--r--po/POTFILES.in1
-rw-r--r--src/Makefile.am2
-rw-r--r--src/ephy-go-action.c113
-rw-r--r--src/ephy-go-action.h46
-rw-r--r--src/ephy-window.c5
-rwxr-xr-xsrc/toolbar.c12
8 files changed, 187 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 2ead458c7..ee0d40e52 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+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.
+
2003-03-06 James Willcox <jwillcox@gnome.org>
* lib/egg/eggtoolbar.c: (egg_toolbar_size_allocate): Fix the padding.
diff --git a/data/ui/epiphany-toolbar.xml.in b/data/ui/epiphany-toolbar.xml.in
index ef98ceb0d..f6403e171 100644
--- a/data/ui/epiphany-toolbar.xml.in
+++ b/data/ui/epiphany-toolbar.xml.in
@@ -19,7 +19,7 @@
<toolitem verb="Favicon"/>
<toolitem verb="Location"/>
<toolitem verb="Spinner"/>
- <toolitem verb="LoadLocation"/>
+ <toolitem verb="ToolbarGo"/>
</available>
<default>
<toolbar>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 6938369e1..bd02c781f 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -33,6 +33,7 @@ lib/widgets/ephy-notebook.c
src/bookmarks/ephy-bookmarks-editor.c
src/bookmarks/ephy-bookmarks.c
src/bookmarks/ephy-new-bookmark.c
+src/ephy-go-action.c
src/ephy-main.c
src/ephy-nautilus-view.c
src/ephy-shell.c
diff --git a/src/Makefile.am b/src/Makefile.am
index e3b977cd8..03882891f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -50,6 +50,8 @@ epiphany_SOURCES = \
ephy-encoding-menu.h \
ephy-favicon-action.c \
ephy-favicon-action.h \
+ ephy-go-action.c \
+ ephy-go-action.h \
ephy-favorites-menu.c \
ephy-favorites-menu.h \
ephy-history-model.c \
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);
+}
diff --git a/src/ephy-go-action.h b/src/ephy-go-action.h
new file mode 100644
index 000000000..aa575986d
--- /dev/null
+++ b/src/ephy-go-action.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2003 Marco Pesenti Gritti
+ *
+ * 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.
+ */
+
+#ifndef EPHY_GO_ACTION_H
+#define EPHY_GO_ACTION_H
+
+#include <egg-action.h>
+
+#define EPHY_TYPE_GO_ACTION (ephy_go_action_get_type ())
+#define EPHY_GO_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EPHY_TYPE_GO_ACTION, EphyGoAction))
+#define EPHY_GO_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EPHY_TYPE_GO_ACTION, EphyGoActionClass))
+#define EPHY_IS_GO_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EPHY_TYPE_GO_ACTION))
+#define EPHY_IS_GO_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), EPHY_TYPE_GO_ACTION))
+#define EPHY_GO_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), EPHY_TYPE_GO_ACTION, EphyGoActionClass))
+
+typedef struct _EphyGoAction EphyGoAction;
+typedef struct _EphyGoActionClass EphyGoActionClass;
+
+struct _EphyGoAction
+{
+ EggAction parent;
+};
+
+struct _EphyGoActionClass
+{
+ EggActionClass parent_class;
+};
+
+GType ephy_go_action_get_type (void);
+
+#endif
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 37a1ead9f..c0df5980f 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -197,11 +197,6 @@ static EggActionGroupEntry ephy_menu_entries [] = {
{ "HelpAbout", N_("_About"), GNOME_STOCK_ABOUT, NULL,
N_("Display credits for the web browser creators"),
G_CALLBACK (window_cmd_help_about), NULL },
-
- /* Toolbar only */
- { "LoadLocation", N_("_Go"), GTK_STOCK_JUMP_TO, NULL,
- N_("Type a web address or a word in the field on the left, then click Go"),
- G_CALLBACK (window_cmd_load_location), NULL },
};
static guint ephy_menu_n_entries = G_N_ELEMENTS (ephy_menu_entries);
diff --git a/src/toolbar.c b/src/toolbar.c
index 690edc1b7..86730d97f 100755
--- a/src/toolbar.c
+++ b/src/toolbar.c
@@ -27,6 +27,7 @@
#include "ephy-spinner-action.h"
#include "ephy-location-action.h"
#include "ephy-favicon-action.h"
+#include "ephy-go-action.h"
#include "ephy-navigation-action.h"
#include "ephy-bookmark-action.h"
#include "window-commands.h"
@@ -70,6 +71,7 @@ struct ToolbarPrivate
GtkWidget *location_entry;
GtkWidget *spinner;
GtkWidget *favicon;
+ GtkWidget *go;
};
GType
@@ -323,6 +325,16 @@ toolbar_setup_actions (Toolbar *t)
NULL);
egg_action_group_add_action (t->priv->action_group, action);
g_object_unref (action);
+
+ action = g_object_new (EPHY_TYPE_GO_ACTION,
+ "name", "ToolbarGo",
+ "label", "Go",
+ "stock_id", GTK_STOCK_JUMP_TO,
+ NULL);
+ g_signal_connect (action, "activate",
+ G_CALLBACK (window_cmd_load_location), t->priv->window);
+ egg_action_group_add_action (t->priv->action_group, action);
+ g_object_unref (action);
}
static void