diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-07-18 09:30:27 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-07-18 09:30:27 (GMT) |
commit | c7b064cf1470974aa304d181e1174f9a329d4d49 (patch) | |
tree | 2ef5c69b026c979a6496f03bc6ea6e9a923faf46 /src/gui/menus | |
parent | f225f8af4eff40b5096f512b699571554e54f097 (diff) |
Disabled simple accelerators when a text entry gets focus.
Diffstat (limited to 'src/gui/menus')
-rw-r--r-- | src/gui/menus/binary.c | 10 | ||||
-rw-r--r-- | src/gui/menus/binary.h | 2 | ||||
-rw-r--r-- | src/gui/menus/debug.c | 25 | ||||
-rw-r--r-- | src/gui/menus/debug.h | 2 | ||||
-rw-r--r-- | src/gui/menus/edition.c | 34 | ||||
-rw-r--r-- | src/gui/menus/edition.h | 2 | ||||
-rw-r--r-- | src/gui/menus/file.c | 14 | ||||
-rw-r--r-- | src/gui/menus/file.h | 2 | ||||
-rw-r--r-- | src/gui/menus/help.c | 5 | ||||
-rw-r--r-- | src/gui/menus/help.h | 2 | ||||
-rw-r--r-- | src/gui/menus/menubar.c | 25 | ||||
-rw-r--r-- | src/gui/menus/menubar.h | 2 | ||||
-rw-r--r-- | src/gui/menus/plugins.c | 5 | ||||
-rw-r--r-- | src/gui/menus/plugins.h | 2 | ||||
-rw-r--r-- | src/gui/menus/project.c | 7 | ||||
-rw-r--r-- | src/gui/menus/project.h | 2 | ||||
-rw-r--r-- | src/gui/menus/tools.c | 7 | ||||
-rw-r--r-- | src/gui/menus/tools.h | 2 | ||||
-rw-r--r-- | src/gui/menus/view.c | 25 | ||||
-rw-r--r-- | src/gui/menus/view.h | 2 |
20 files changed, 83 insertions, 94 deletions
diff --git a/src/gui/menus/binary.c b/src/gui/menus/binary.c index 1360011..954f3d4 100644 --- a/src/gui/menus/binary.c +++ b/src/gui/menus/binary.c @@ -28,6 +28,7 @@ #include <i18n.h> +#include "../agroup.h" #include "../editem-int.h" #include "../core/global.h" #include "../dialogs/export.h" @@ -54,9 +55,8 @@ static void mcb_binary_export(GtkMenuItem *, GMenuBar *); /****************************************************************************** * * -* Paramètres : ref = espace de référencement global. * -* accgroup = groupe d'accélérateurs pour les menus. * -* bar = barre de menu parente. * +* Paramètres : ref = espace de référencement global. * +* bar = barre de menu parente. * * * * Description : Construit le menu "Binaire". * * * @@ -66,7 +66,7 @@ static void mcb_binary_export(GtkMenuItem *, GMenuBar *); * * ******************************************************************************/ -GtkWidget *build_menu_binary(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *bar) +GtkWidget *build_menu_binary(GObject *ref, GMenuBar *bar) { GtkWidget *result; /* Support à retourner */ GtkWidget *menubar; /* Support pour éléments */ @@ -79,7 +79,7 @@ GtkWidget *build_menu_binary(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *ba submenuitem = qck_create_menu_item(ref, "mnu_binary_epoints", _("Entry points"), G_CALLBACK(mcb_binary_entry_points), bar); - add_accelerator_to_menu_item(submenuitem, "<Ctrl>E", accgroup); + add_accelerator_to_widget(submenuitem, "<Ctrl>E"); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); submenuitem = qck_create_menu_separator(); diff --git a/src/gui/menus/binary.h b/src/gui/menus/binary.h index 45140b6..c68b67c 100644 --- a/src/gui/menus/binary.h +++ b/src/gui/menus/binary.h @@ -35,7 +35,7 @@ /* Construit le menu "Binaire". */ -GtkWidget *build_menu_binary(GObject *, GtkAccelGroup *, GMenuBar *); +GtkWidget *build_menu_binary(GObject *, GMenuBar *); /* Réagit à un changement d'affichage principal de contenu. */ void update_access_for_content_in_menu_binary(GLoadedContent *); diff --git a/src/gui/menus/debug.c b/src/gui/menus/debug.c index 3e785b5..8684e49 100644 --- a/src/gui/menus/debug.c +++ b/src/gui/menus/debug.c @@ -28,8 +28,10 @@ #include <string.h> -#include <i18n.h> +#include<i18n.h> + +#include "../agroup.h" #include "../../debug/debugger.h" /* REMME ! */ #include "../../gtkext/easygtk.h" @@ -72,8 +74,7 @@ static void mcb_debug_options(GtkMenuItem *, GObject *); /****************************************************************************** * * -* Paramètres : ref = espace de référencement global. * -* accgroup = groupe d'accélérateurs pour les menus. * +* Paramètres : ref = espace de référencement global. * * * * Description : Construit le menu "Aide". * * * @@ -83,7 +84,7 @@ static void mcb_debug_options(GtkMenuItem *, GObject *); * * ******************************************************************************/ -GtkWidget *build_menu_debug(GObject *ref, GtkAccelGroup *accgroup) +GtkWidget *build_menu_debug(GObject *ref) { GtkWidget *result; /* Support à retourner */ GtkWidget *menubar; /* Support pour éléments */ @@ -96,17 +97,17 @@ GtkWidget *build_menu_debug(GObject *ref, GtkAccelGroup *accgroup) submenuitem = qck_create_menu_item(ref, "mnu_debug_continue", _("Continue"), G_CALLBACK(mcb_debug_continue), ref); - add_accelerator_to_menu_item(submenuitem, "F9", accgroup); + add_accelerator_to_widget(submenuitem, "F9"); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); submenuitem = qck_create_menu_item(ref, "mnu_debug_continue_to", _("Continue to selection"), G_CALLBACK(mcb_debug_continue_to), ref); - add_accelerator_to_menu_item(submenuitem, "<Alt>F9", accgroup); + add_accelerator_to_widget(submenuitem, "<Alt>F9"); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); submenuitem = qck_create_menu_item(ref, "mnu_debug_pause", _("Pause"), G_CALLBACK(mcb_debug_pause), ref); - add_accelerator_to_menu_item(submenuitem, "F10", accgroup); + add_accelerator_to_widget(submenuitem, "F10"); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); submenuitem = qck_create_menu_item(ref, "mnu_debug_restart", _("Restart"), @@ -122,27 +123,27 @@ GtkWidget *build_menu_debug(GObject *ref, GtkAccelGroup *accgroup) submenuitem = qck_create_menu_item(ref, "mnu_debug_step_into", _("Step into"), G_CALLBACK(mcb_debug_step_into), ref); - add_accelerator_to_menu_item(submenuitem, "F7", accgroup); + add_accelerator_to_widget(submenuitem, "F7"); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); submenuitem = qck_create_menu_item(ref, "mnu_debug_step_over", _("Step over"), G_CALLBACK(mcb_debug_step_over), ref); - add_accelerator_to_menu_item(submenuitem, "<Alt>F7", accgroup); + add_accelerator_to_widget(submenuitem, "<Alt>F7"); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); submenuitem = qck_create_menu_item(ref, "mnu_debug_basic", _("Visit basic blocks into"), G_CALLBACK(mcb_debug_visit_blocks_into), ref); - add_accelerator_to_menu_item(submenuitem, "F8", accgroup); + add_accelerator_to_widget(submenuitem, "F8"); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); submenuitem = qck_create_menu_item(ref, "mnu_debug_basic", _("Visit basic blocks over"), G_CALLBACK(mcb_debug_visit_blocks_over), ref); - add_accelerator_to_menu_item(submenuitem, "<Alt>F8", accgroup); + add_accelerator_to_widget(submenuitem, "<Alt>F8"); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); submenuitem = qck_create_menu_item(ref, "mnu_debug_return", _("Continue until return"), G_CALLBACK(mcb_debug_return), ref); - add_accelerator_to_menu_item(submenuitem, "F12", accgroup); + add_accelerator_to_widget(submenuitem, "F12"); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); submenuitem = qck_create_menu_separator(); diff --git a/src/gui/menus/debug.h b/src/gui/menus/debug.h index 1ca6853..e8405ea 100644 --- a/src/gui/menus/debug.h +++ b/src/gui/menus/debug.h @@ -31,7 +31,7 @@ /* Construit le menu "Aide". */ -GtkWidget *build_menu_debug(GObject *, GtkAccelGroup *); +GtkWidget *build_menu_debug(GObject *); diff --git a/src/gui/menus/edition.c b/src/gui/menus/edition.c index 4a24d33..80c0796 100644 --- a/src/gui/menus/edition.c +++ b/src/gui/menus/edition.c @@ -31,6 +31,7 @@ #include <i18n.h> +#include "../agroup.h" #include "../core/global.h" #include "../dialogs/bookmark.h" #include "../dialogs/goto.h" @@ -82,9 +83,8 @@ static void mcb_edition_comment_enter_next(GtkMenuItem *, GMenuBar *); /****************************************************************************** * * -* Paramètres : ref = espace de référencement global. * -* accgroup = groupe d'accélérateurs pour les menus. * -* bar = barre de menu parente. * +* Paramètres : ref = espace de référencement global. * +* bar = barre de menu parente. * * * * Description : Construit le menu "Edition". * * * @@ -94,7 +94,7 @@ static void mcb_edition_comment_enter_next(GtkMenuItem *, GMenuBar *); * * ******************************************************************************/ -GtkWidget *build_menu_edition(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *bar) +GtkWidget *build_menu_edition(GObject *ref, GMenuBar *bar) { GtkWidget *result; /* Support à retourner */ GtkWidget *menubar; /* Support pour éléments */ @@ -111,7 +111,7 @@ GtkWidget *build_menu_edition(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *b submenuitem = qck_create_menu_item(ref, "mnu_edit_goto", _("Go to address..."), G_CALLBACK(mcb_edition_goto), bar); - add_accelerator_to_menu_item(submenuitem, "<Ctrl>G", accgroup); + add_accelerator_to_widget(submenuitem, "<Ctrl>G"); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); /* Séparation */ @@ -128,25 +128,25 @@ GtkWidget *build_menu_edition(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *b deepmenuitem = qck_create_menu_item(ref, "mnu_edit_switch_hex", _("Hexadecimal"), G_CALLBACK(mcb_edition_switch_numeric_operand), NULL); - add_accelerator_to_menu_item(deepmenuitem, "H", accgroup); + add_accelerator_to_widget(deepmenuitem, "H"); g_object_set_data(G_OBJECT(deepmenuitem), "kind_of_switch", GUINT_TO_POINTER(IOD_HEX)); gtk_container_add(GTK_CONTAINER(deepmenubar), deepmenuitem); deepmenuitem = qck_create_menu_item(ref, "mnu_edit_switch_dec", _("Decimal"), G_CALLBACK(mcb_edition_switch_numeric_operand), NULL); - add_accelerator_to_menu_item(deepmenuitem, "D", accgroup); + add_accelerator_to_widget(deepmenuitem, "D"); g_object_set_data(G_OBJECT(deepmenuitem), "kind_of_switch", GUINT_TO_POINTER(IOD_DEC)); gtk_container_add(GTK_CONTAINER(deepmenubar), deepmenuitem); deepmenuitem = qck_create_menu_item(ref, "mnu_edit_switch_oct", _("Octal"), G_CALLBACK(mcb_edition_switch_numeric_operand), NULL); - add_accelerator_to_menu_item(deepmenuitem, "O", accgroup); + add_accelerator_to_widget(deepmenuitem, "O"); g_object_set_data(G_OBJECT(deepmenuitem), "kind_of_switch", GUINT_TO_POINTER(IOD_OCT)); gtk_container_add(GTK_CONTAINER(deepmenubar), deepmenuitem); deepmenuitem = qck_create_menu_item(ref, "mnu_edit_switch_bin", _("Binary"), G_CALLBACK(mcb_edition_switch_numeric_operand), NULL); - add_accelerator_to_menu_item(deepmenuitem, "B", accgroup); + add_accelerator_to_widget(deepmenuitem, "B"); g_object_set_data(G_OBJECT(deepmenuitem), "kind_of_switch", GUINT_TO_POINTER(IOD_BIN)); gtk_container_add(GTK_CONTAINER(deepmenubar), deepmenuitem); @@ -167,17 +167,17 @@ GtkWidget *build_menu_edition(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *b submenuitem = qck_create_menu_item(ref, "mnu_edit_go_back", _("Go back"), G_CALLBACK(mcb_edition_go_back), bar); - add_accelerator_to_menu_item(submenuitem, "Escape", accgroup); + add_accelerator_to_widget(submenuitem, "Escape"); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); submenuitem = qck_create_menu_item(ref, "mnu_edit_follow_ref", _("Follow the reference"), G_CALLBACK(mcb_edition_follow_ref), NULL); - add_accelerator_to_menu_item(submenuitem, "Return", accgroup); + add_accelerator_to_widget(submenuitem, "Return"); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); submenuitem = qck_create_menu_item(ref, "mnu_edit_list_xrefs", _("List all references leading to..."), G_CALLBACK(mcb_edition_list_xrefs), bar); - add_accelerator_to_menu_item(submenuitem, "X", accgroup); + add_accelerator_to_widget(submenuitem, "X"); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); /* Séparation */ @@ -194,7 +194,7 @@ GtkWidget *build_menu_edition(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *b deepmenuitem = qck_create_menu_item(ref, "mnu_edit_toggle_bmark", _("Toggle at current location"), G_CALLBACK(mcb_edition_bookmarks_toggle), bar); - add_accelerator_to_menu_item(deepmenuitem, "<Ctrl>D", accgroup); + add_accelerator_to_widget(deepmenuitem, "<Ctrl>D"); gtk_container_add(GTK_CONTAINER(deepmenubar), deepmenuitem); deepmenuitem = qck_create_menu_item(ref, "mnu_edit_delete_bmarks", _("Delete all bookmarks"), @@ -210,22 +210,22 @@ GtkWidget *build_menu_edition(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *b deepmenuitem = qck_create_menu_item(ref, "mnu_edit_enter_comment", _("Enter a comment..."), G_CALLBACK(mcb_edition_comment_enter), bar); - add_accelerator_to_menu_item(deepmenuitem, "semicolon", accgroup); + add_accelerator_to_widget(deepmenuitem, "semicolon"); gtk_container_add(GTK_CONTAINER(deepmenubar), deepmenuitem); deepmenuitem = qck_create_menu_item(ref, "mnu_edit_enter_rep_comment", _("Enter a repeatable comment..."), G_CALLBACK(mcb_edition_comment_enter_repeatable), bar); - add_accelerator_to_menu_item(deepmenuitem, "colon", accgroup); + add_accelerator_to_widget(deepmenuitem, "colon"); gtk_container_add(GTK_CONTAINER(deepmenubar), deepmenuitem); deepmenuitem = qck_create_menu_item(ref, "mnu_edit_enter_prev", _("Enter a comment in the previous line..."), G_CALLBACK(mcb_edition_comment_enter_previous), bar); - add_accelerator_to_menu_item(deepmenuitem, "Insert", accgroup); + add_accelerator_to_widget(deepmenuitem, "Insert"); gtk_container_add(GTK_CONTAINER(deepmenubar), deepmenuitem); deepmenuitem = qck_create_menu_item(ref, "mnu_edit_enter_next", _("Enter a comment in the next line..."), G_CALLBACK(mcb_edition_comment_enter_next), bar); - add_accelerator_to_menu_item(deepmenuitem, "<Shift>Insert", accgroup); + add_accelerator_to_widget(deepmenuitem, "<Shift>Insert"); gtk_container_add(GTK_CONTAINER(deepmenubar), deepmenuitem); return result; diff --git a/src/gui/menus/edition.h b/src/gui/menus/edition.h index a49e320..596ceba 100644 --- a/src/gui/menus/edition.h +++ b/src/gui/menus/edition.h @@ -35,7 +35,7 @@ /* Construit le menu "Edition". */ -GtkWidget *build_menu_edition(GObject *, GtkAccelGroup *, GMenuBar *); +GtkWidget *build_menu_edition(GObject *, GMenuBar *); /* Lance une actualisation du fait d'un changement de support. */ void update_access_for_view_in_menu_edition(GLoadedPanel *); diff --git a/src/gui/menus/file.c b/src/gui/menus/file.c index 9c0b218..ffe3e9e 100644 --- a/src/gui/menus/file.c +++ b/src/gui/menus/file.c @@ -28,6 +28,7 @@ #include <i18n.h> +#include "../agroup.h" #include "../core/global.h" #include "../../analysis/project.h" #include "../../core/global.h" @@ -54,8 +55,7 @@ static void mcb_file_quit(GtkMenuItem *, GObject *); /****************************************************************************** * * -* Paramètres : ref = espace de référencement global. * -* accgroup = groupe d'accélérateurs pour les menus. * +* Paramètres : ref = espace de référencement global. * * * * Description : Construit le menu "Fichier". * * * @@ -65,7 +65,7 @@ static void mcb_file_quit(GtkMenuItem *, GObject *); * * ******************************************************************************/ -GtkWidget *build_menu_file(GObject *ref, GtkAccelGroup *accgroup) +GtkWidget *build_menu_file(GObject *ref) { GtkWidget *result; /* Support à retourner */ GtkWidget *menubar; /* Support pour éléments */ @@ -80,7 +80,7 @@ GtkWidget *build_menu_file(GObject *ref, GtkAccelGroup *accgroup) submenuitem = qck_create_menu_item(NULL, NULL, _("New project"), G_CALLBACK(mcb_file_new_project), NULL); - add_accelerator_to_menu_item(submenuitem, "<Ctrl>N", accgroup); + add_accelerator_to_widget(submenuitem, "<Ctrl>N"); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); submenuitem = qck_create_menu_separator(); @@ -88,7 +88,7 @@ GtkWidget *build_menu_file(GObject *ref, GtkAccelGroup *accgroup) submenuitem = qck_create_menu_item(NULL, NULL, _("Open project"), G_CALLBACK(mcb_file_open_project), NULL); - add_accelerator_to_menu_item(submenuitem, "<Ctrl>O", accgroup); + add_accelerator_to_widget(submenuitem, "<Ctrl>O"); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); submenuitem = qck_create_menu_item(NULL, NULL, _("Recent projects..."), NULL, NULL); @@ -109,7 +109,7 @@ GtkWidget *build_menu_file(GObject *ref, GtkAccelGroup *accgroup) submenuitem = qck_create_menu_item(NULL, NULL, _("Save project"), G_CALLBACK(mcb_file_save_project), NULL); - add_accelerator_to_menu_item(submenuitem, "<Ctrl>S", accgroup); + add_accelerator_to_widget(submenuitem, "<Ctrl>S"); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); submenuitem = qck_create_menu_item(NULL, NULL, _("Save project as..."), @@ -120,7 +120,7 @@ GtkWidget *build_menu_file(GObject *ref, GtkAccelGroup *accgroup) gtk_container_add(GTK_CONTAINER(menubar), submenuitem); submenuitem = qck_create_menu_item(NULL, NULL, _("Quit"), G_CALLBACK(mcb_file_quit), ref); - add_accelerator_to_menu_item(submenuitem, "<Ctrl>Q", accgroup); + add_accelerator_to_widget(submenuitem, "<Ctrl>Q"); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); return result; diff --git a/src/gui/menus/file.h b/src/gui/menus/file.h index f73eb85..f176c7f 100644 --- a/src/gui/menus/file.h +++ b/src/gui/menus/file.h @@ -31,7 +31,7 @@ /* Construit le menu "Fichier". */ -GtkWidget *build_menu_file(GObject *, GtkAccelGroup *); +GtkWidget *build_menu_file(GObject *); diff --git a/src/gui/menus/help.c b/src/gui/menus/help.c index 922fa31..0371e20 100644 --- a/src/gui/menus/help.c +++ b/src/gui/menus/help.c @@ -40,8 +40,7 @@ static void mcb_help_about(GtkMenuItem *, GObject *); /****************************************************************************** * * -* Paramètres : ref = espace de référencement global. * -* accgroup = groupe d'accélérateurs pour les menus. * +* Paramètres : ref = espace de référencement global. * * * * Description : Construit le menu "Aide". * * * @@ -51,7 +50,7 @@ static void mcb_help_about(GtkMenuItem *, GObject *); * * ******************************************************************************/ -GtkWidget *build_menu_help(GObject *ref, GtkAccelGroup *accgroup) +GtkWidget *build_menu_help(GObject *ref) { GtkWidget *result; /* Support à retourner */ GtkWidget *menubar; /* Support pour éléments */ diff --git a/src/gui/menus/help.h b/src/gui/menus/help.h index 85d18f8..dd83116 100644 --- a/src/gui/menus/help.h +++ b/src/gui/menus/help.h @@ -31,7 +31,7 @@ /* Construit le menu "Aide". */ -GtkWidget *build_menu_help(GObject *, GtkAccelGroup *); +GtkWidget *build_menu_help(GObject *); diff --git a/src/gui/menus/menubar.c b/src/gui/menus/menubar.c index 7bc7e85..2e81619 100644 --- a/src/gui/menus/menubar.c +++ b/src/gui/menus/menubar.c @@ -192,8 +192,7 @@ static void g_menu_bar_finalize(GMenuBar *bar) /****************************************************************************** * * -* Paramètres : ref = espace de référencement global. * -* accgroup = groupe d'accélérateurs pour les menus. * +* Paramètres : ref = espace de référencement global. * * * * Description : Compose la barre de menus principale. * * * @@ -203,15 +202,13 @@ static void g_menu_bar_finalize(GMenuBar *bar) * * ******************************************************************************/ -GEditorItem *g_menu_bar_new(GObject *ref, GtkAccelGroup *accgroup) +GEditorItem *g_menu_bar_new(GObject *ref) { GMenuBar *result; /* Structure à retourner */ GEditorItem *item; /* Autre version de l'élément */ result = g_object_new(G_TYPE_MENU_BAR, NULL); - g_object_set_data(G_OBJECT(result), "accgroup", accgroup); - /* Initialisation générique */ item = G_EDITOR_ITEM(result); @@ -221,47 +218,47 @@ GEditorItem *g_menu_bar_new(GObject *ref, GtkAccelGroup *accgroup) /* Fichier */ - result->file = build_menu_file(ref, accgroup); + result->file = build_menu_file(ref); gtk_container_add(GTK_CONTAINER(item->widget), result->file); /* Edition */ - result->edition = build_menu_edition(ref, accgroup, result); + result->edition = build_menu_edition(ref, result); gtk_container_add(GTK_CONTAINER(item->widget), result->edition); /* Affichage */ - result->view = build_menu_view(ref, accgroup, result); + result->view = build_menu_view(ref, result); gtk_container_add(GTK_CONTAINER(item->widget), result->view); /* Projet */ - result->project = build_menu_project(ref, accgroup, result); + result->project = build_menu_project(ref, result); gtk_container_add(GTK_CONTAINER(item->widget), result->project); /* Binaire */ - result->binary = build_menu_binary(ref, accgroup, result); + result->binary = build_menu_binary(ref, result); gtk_container_add(GTK_CONTAINER(item->widget), result->binary); /* Débogage */ - result->debug = build_menu_debug(ref, accgroup); + result->debug = build_menu_debug(ref); gtk_container_add(GTK_CONTAINER(item->widget), result->debug); /* Outils */ - result->tools = build_menu_tools(ref, accgroup, result); + result->tools = build_menu_tools(ref, result); gtk_container_add(GTK_CONTAINER(item->widget), result->tools); /* Greffons */ - result->plugins = build_menu_plugins(ref, accgroup); + result->plugins = build_menu_plugins(ref); gtk_container_add(GTK_CONTAINER(item->widget), result->plugins); /* Aide */ - result->help = build_menu_help(ref, accgroup); + result->help = build_menu_help(ref); gtk_container_add(GTK_CONTAINER(item->widget), result->help); return G_EDITOR_ITEM(result); diff --git a/src/gui/menus/menubar.h b/src/gui/menus/menubar.h index d943566..591442b 100644 --- a/src/gui/menus/menubar.h +++ b/src/gui/menus/menubar.h @@ -49,7 +49,7 @@ typedef struct _GMenuBarClass GMenuBarClass; GType g_menu_bar_get_type(void); /* Compose la barre de menus principale. */ -GEditorItem *g_menu_bar_new(GObject *, GtkAccelGroup *); +GEditorItem *g_menu_bar_new(GObject *); diff --git a/src/gui/menus/plugins.c b/src/gui/menus/plugins.c index c1b0fc7..36c7eff 100644 --- a/src/gui/menus/plugins.c +++ b/src/gui/menus/plugins.c @@ -37,8 +37,7 @@ /****************************************************************************** * * -* Paramètres : ref = espace de référencement global. * -* accgroup = groupe d'accélérateurs pour les menus. * +* Paramètres : ref = espace de référencement global. * * * * Description : Construit le menu "Aide". * * * @@ -48,7 +47,7 @@ * * ******************************************************************************/ -GtkWidget *build_menu_plugins(GObject *ref, GtkAccelGroup *accgroup) +GtkWidget *build_menu_plugins(GObject *ref) { GtkWidget *result; /* Support à retourner */ GtkWidget *menubar; /* Support pour éléments */ diff --git a/src/gui/menus/plugins.h b/src/gui/menus/plugins.h index 21a19a6..a3a8f50 100644 --- a/src/gui/menus/plugins.h +++ b/src/gui/menus/plugins.h @@ -31,7 +31,7 @@ /* Construit le menu "Aide". */ -GtkWidget *build_menu_plugins(GObject *, GtkAccelGroup *); +GtkWidget *build_menu_plugins(GObject *); diff --git a/src/gui/menus/project.c b/src/gui/menus/project.c index 20da138..a6a078b 100644 --- a/src/gui/menus/project.c +++ b/src/gui/menus/project.c @@ -49,9 +49,8 @@ static void mcb_project_remove_content(GtkMenuItem *, GStudyProject *); /****************************************************************************** * * -* Paramètres : ref = espace de référencement global. * -* accgroup = groupe d'accélérateurs pour les menus. * -* bar = barre de menu parente. * +* Paramètres : ref = espace de référencement global. * +* bar = barre de menu parente. * * * * Description : Construit le menu "Projet". * * * @@ -61,7 +60,7 @@ static void mcb_project_remove_content(GtkMenuItem *, GStudyProject *); * * ******************************************************************************/ -GtkWidget *build_menu_project(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *bar) +GtkWidget *build_menu_project(GObject *ref, GMenuBar *bar) { GtkWidget *result; /* Support à retourner */ GtkWidget *menubar; /* Support pour éléments #1 */ diff --git a/src/gui/menus/project.h b/src/gui/menus/project.h index 3754914..204846a 100644 --- a/src/gui/menus/project.h +++ b/src/gui/menus/project.h @@ -35,7 +35,7 @@ /* Construit le menu "Projet". */ -GtkWidget *build_menu_project(GObject *, GtkAccelGroup *, GMenuBar *); +GtkWidget *build_menu_project(GObject *, GMenuBar *); /* Lance une actualisation relative à l'étendue du projet. */ void update_menu_project_for_project(GtkWidget *, GStudyProject *, GMenuBar *); diff --git a/src/gui/menus/tools.c b/src/gui/menus/tools.c index 2ec9551..d606c02 100644 --- a/src/gui/menus/tools.c +++ b/src/gui/menus/tools.c @@ -41,9 +41,8 @@ static void mcb_tools_identity(GtkMenuItem *, GMenuBar *); /****************************************************************************** * * -* Paramètres : ref = espace de référencement global. * -* accgroup = groupe d'accélérateurs pour les menus. * -* bar = barre de menu parente. * +* Paramètres : ref = espace de référencement global. * +* bar = barre de menu parente. * * * * Description : Construit le menu "Outils". * * * @@ -53,7 +52,7 @@ static void mcb_tools_identity(GtkMenuItem *, GMenuBar *); * * ******************************************************************************/ -GtkWidget *build_menu_tools(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *bar) +GtkWidget *build_menu_tools(GObject *ref, GMenuBar *bar) { GtkWidget *result; /* Support à retourner */ GtkWidget *menubar; /* Support pour éléments */ diff --git a/src/gui/menus/tools.h b/src/gui/menus/tools.h index 0c76137..441e46d 100644 --- a/src/gui/menus/tools.h +++ b/src/gui/menus/tools.h @@ -34,7 +34,7 @@ /* Construit le menu "Outils". */ -GtkWidget *build_menu_tools(GObject *, GtkAccelGroup *, GMenuBar *); +GtkWidget *build_menu_tools(GObject *, GMenuBar *); diff --git a/src/gui/menus/view.c b/src/gui/menus/view.c index f0e7450..d446278 100644 --- a/src/gui/menus/view.c +++ b/src/gui/menus/view.c @@ -31,6 +31,7 @@ #include <i18n.h> +#include "../agroup.h" #include "../editem-int.h" #include "../core/global.h" #include "../core/items.h" @@ -73,9 +74,8 @@ static void mcb_view_show_full_screen(GtkCheckMenuItem *, GMenuBar *); /****************************************************************************** * * -* Paramètres : ref = espace de référencement global. * -* accgroup = groupe d'accélérateurs pour les menus. * -* bar = barre de menu parente. * +* Paramètres : ref = espace de référencement global. * +* bar = barre de menu parente. * * * * Description : Construit le menu "Affichage". * * * @@ -85,7 +85,7 @@ static void mcb_view_show_full_screen(GtkCheckMenuItem *, GMenuBar *); * * ******************************************************************************/ -GtkWidget *build_menu_view(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *bar) +GtkWidget *build_menu_view(GObject *ref, GMenuBar *bar) { GtkWidget *result; /* Support à retourner */ GtkWidget *menubar; /* Support pour éléments */ @@ -114,7 +114,7 @@ GtkWidget *build_menu_view(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *bar) submenuitem = qck_create_radio_menu_item(ref, "mnu_view_switch_textview", NULL, _("Text view"), G_CALLBACK(mcb_view_change_support), NULL); - add_accelerator_to_menu_item(submenuitem, "F3", accgroup); + add_accelerator_to_widget(submenuitem, "F3"); g_object_set_data(G_OBJECT(submenuitem), "kind_of_view", GUINT_TO_POINTER(BVW_BLOCK)); g_object_set_data(G_OBJECT(submenuitem), "kind_of_display", GSIZE_TO_POINTER(GTK_TYPE_BLOCK_DISPLAY)); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); @@ -123,19 +123,19 @@ GtkWidget *build_menu_view(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *bar) submenuitem = qck_create_radio_menu_item(ref, "mnu_view_switch_graphview", rgroup, _("Graph view"), G_CALLBACK(mcb_view_change_support), NULL); - add_accelerator_to_menu_item(submenuitem, "F4", accgroup); + add_accelerator_to_widget(submenuitem, "F4"); g_object_set_data(G_OBJECT(submenuitem), "kind_of_view", GUINT_TO_POINTER(BVW_GRAPH)); g_object_set_data(G_OBJECT(submenuitem), "kind_of_display", GSIZE_TO_POINTER(GTK_TYPE_GRAPH_DISPLAY)); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); submenuitem = qck_create_menu_item(ref, "mcb_view_switch_to_next_support", _("Switch to next"), G_CALLBACK(mcb_view_switch_to_next_support), NULL); - add_accelerator_to_menu_item(submenuitem, "Tab", accgroup); + add_accelerator_to_widget(submenuitem, "Tab"); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); submenuitem = qck_create_menu_item(ref, "mcb_view_switch_to_prev_support", _("Switch to previous"), G_CALLBACK(mcb_view_switch_to_prev_support), NULL); - add_accelerator_to_menu_item(submenuitem, "<Shift>Tab", accgroup); + add_accelerator_to_widget(submenuitem, "<Shift>Tab"); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); /* Séparation */ @@ -169,7 +169,7 @@ GtkWidget *build_menu_view(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *bar) submenuitem = qck_create_check_menu_item(NULL, NULL, _("Full screen"), G_CALLBACK(mcb_view_show_full_screen), bar); - add_accelerator_to_menu_item(submenuitem, "F11", accgroup); + add_accelerator_to_widget(submenuitem, "F11"); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); return result; @@ -404,12 +404,10 @@ static void update_switch_access_in_menu_view(void) static void mcb_view_update_side_panels_list(GtkMenuItem *menuitem, GMenuBar *bar) { GtkWidget *menubar; /* Support pour éléments */ - GtkAccelGroup *accgroup; /* Groupe de raccourcis */ typedef struct _panels_loading_filter { GtkContainer *support; /* Support pour éléments */ - GtkAccelGroup *accel; /* Groupe de raccourcis */ PanelItemPersonality personality; /* Nature des éléments attendus*/ bool first; /* Premier ajout ? */ @@ -463,7 +461,7 @@ static void mcb_view_update_side_panels_list(GtkMenuItem *menuitem, GMenuBar *ba bindings = gtk_panel_item_get_key_bindings(panel); if (bindings != NULL) - add_accelerator_to_menu_item(submenuitem, bindings, filter->accel); + add_accelerator_to_widget(submenuitem, bindings); gtk_container_add(filter->support, submenuitem); @@ -485,10 +483,7 @@ static void mcb_view_update_side_panels_list(GtkMenuItem *menuitem, GMenuBar *ba } - accgroup = GTK_ACCEL_GROUP(g_object_get_data(G_OBJECT(bar), "accgroup")); - pfilter.support = GTK_CONTAINER(menubar); - pfilter.accel = accgroup; pfilter.personality = PIP_SINGLETON; pfilter.first = false; diff --git a/src/gui/menus/view.h b/src/gui/menus/view.h index 5216bcb..fadf881 100644 --- a/src/gui/menus/view.h +++ b/src/gui/menus/view.h @@ -35,7 +35,7 @@ /* Construit le menu "Affichage". */ -GtkWidget *build_menu_view(GObject *, GtkAccelGroup *, GMenuBar *); +GtkWidget *build_menu_view(GObject *, GMenuBar *); /* Lance une actualisation du fait d'un changement de vue. */ void rebuild_menu_view(GtkWidget *, GLoadedPanel *, GMenuBar *); |