aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-tabs-menu.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2003-08-30 20:34:34 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2003-08-30 20:34:34 +0800
commit676d6d40cf906f7fd2c626ec21ef66e28c5aa3f0 (patch)
tree5912819b0ffde208dca101c2237342226e7a203c /src/ephy-tabs-menu.c
parenta03cfa7451bad9af112897db73bd7eecc43e2f2c (diff)
downloadgsoc2013-epiphany-676d6d40cf906f7fd2c626ec21ef66e28c5aa3f0.tar
gsoc2013-epiphany-676d6d40cf906f7fd2c626ec21ef66e28c5aa3f0.tar.gz
gsoc2013-epiphany-676d6d40cf906f7fd2c626ec21ef66e28c5aa3f0.tar.bz2
gsoc2013-epiphany-676d6d40cf906f7fd2c626ec21ef66e28c5aa3f0.tar.lz
gsoc2013-epiphany-676d6d40cf906f7fd2c626ec21ef66e28c5aa3f0.tar.xz
gsoc2013-epiphany-676d6d40cf906f7fd2c626ec21ef66e28c5aa3f0.tar.zst
gsoc2013-epiphany-676d6d40cf906f7fd2c626ec21ef66e28c5aa3f0.zip
Complete gtk 2.3 port. It doesnt run here but it could be my env.
2003-08-30 Marco Pesenti Gritti <marco@gnome.org> * src/ephy-encoding-menu.c: (ephy_encoding_menu_verb_cb): * src/ephy-favicon-action.c: (create_tool_item): * src/ephy-favicon-action.h: * src/ephy-favorites-menu.c: (ephy_favorites_menu_clean): * src/ephy-go-action.c: (create_tool_item), (create_menu_proxy_cb): * src/ephy-go-action.h: * src/ephy-history-window.c: (ephy_history_window_construct): * src/ephy-location-action.c: (ephy_location_action_get_widget): * src/ephy-location-action.h: * src/ephy-navigation-action.c: * src/ephy-navigation-action.h: * src/ephy-spinner-action.c: (create_tool_item), (item_parent_set_cb): * src/ephy-spinner-action.h: * src/ephy-tab.c: (ephy_tab_init): * src/ephy-tabs-menu.c: (ephy_tabs_menu_clean), (tab_set_action_accelerator), (ephy_tabs_menu_update): * src/ephy-window.c: (ephy_window_state_event_cb), (setup_window), (update_layout_toggles): * src/popup-commands.c: * src/ppview-toolbar.c: (ppview_toolbar_set_window), (ppview_toolbar_init): * src/toolbar.c: (toolbar_activate_location): * src/window-commands.c: (window_cmd_view_bookmarks_bar), (window_cmd_view_toolbar), (window_cmd_view_statusbar), (window_cmd_view_fullscreen): Complete gtk 2.3 port. It doesnt run here but it could be my env.
Diffstat (limited to 'src/ephy-tabs-menu.c')
-rw-r--r--src/ephy-tabs-menu.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/ephy-tabs-menu.c b/src/ephy-tabs-menu.c
index 24bed0848..a7c9a265f 100644
--- a/src/ephy-tabs-menu.c
+++ b/src/ephy-tabs-menu.c
@@ -22,12 +22,13 @@
#include "ephy-tabs-menu.h"
#include "ephy-string.h"
-#include "egg-menu-merge.h"
#include "ephy-marshal.h"
#include "ephy-shell.h"
#include "ephy-debug.h"
-#include "egg-action.h"
+#include <gtk/gtkaccelmap.h>
+#include <gtk/gtkaction.h>
+#include <gtk/gtkuimanager.h>
#include <string.h>
#include <stdlib.h>
#include <libxml/entities.h>
@@ -166,7 +167,7 @@ ephy_tabs_menu_clean (EphyTabsMenu *menu)
if (p->ui_id > 0)
{
gtk_ui_manager_remove_ui (merge, p->ui_id);
- gtk_ui_manager_ensure_update (merge);
+/* FIXME gtk_ui_manager_ensure_update (merge); */
p->ui_id = 0;
}
@@ -205,25 +206,24 @@ ephy_tabs_menu_new (EphyWindow *window)
NULL));
}
-/* This code is from GtkActionGroup:
- * Ideally either GtkAction should support setting an accelerator from
- * a string or GtkActionGroup would support adding single EggActionEntry's
- * to an action group.
- */
static void
tab_set_action_accelerator (GtkActionGroup *action_group,
GtkAction *action,
guint tab_number)
{
+ const char *action_name, *action_group_name;
char *accel_path = NULL;
char accel[7];
gint accel_number;
guint accel_key;
GdkModifierType accel_mods;
+ action_name = gtk_action_get_name (action);
+ action_group_name = gtk_action_group_get_name (action_group);
+
/* set the accel path for the menu item */
- accel_path = g_strconcat ("<Actions>/", action_group->name, "/",
- action->name, NULL);
+ accel_path = g_strconcat ("<Actions>/", action_group_name, "/",
+ action_name, NULL);
/* Only the first ten tabs get accelerators starting from 1 through 0 */
if (tab_number < 10)
@@ -237,17 +237,13 @@ tab_set_action_accelerator (GtkActionGroup *action_group,
if (accel_key != 0)
{
- gtk_accel_map_change_entry (accel_path, accel_key,
- accel_mods, TRUE);
+ gtk_action_set_accel_path (action, accel_path);
}
}
else
{
- gtk_accel_map_change_entry (accel_path, 0, 0, TRUE);
+ gtk_action_set_accel_path (action, accel_path);
}
-
- action->accel_quark = g_quark_from_string (accel_path);
- g_free (accel_path);
}
void
@@ -288,17 +284,20 @@ ephy_tabs_menu_update (EphyTabsMenu *menu)
for (l = tabs; l != NULL; l = l->next)
{
+ const char *action_name;
+
tab = (EphyTab *) l->data;
action = GTK_ACTION (ephy_tab_get_action (tab));
+ action_name = gtk_action_get_name (action);
tab_set_action_accelerator (p->action_group, action, i);
gtk_action_group_add_action (p->action_group, action);
g_string_append (xml, "<menuitem name=\"");
- g_string_append (xml, action->name);
+ g_string_append (xml, action_name);
g_string_append (xml, "Menu\" verb=\"");
- g_string_append (xml, action->name);
+ g_string_append (xml, action_name);
g_string_append (xml, "\"/>\n");
++i;