Revision: 5791 http://geany.svn.sourceforge.net/geany/?rev=5791&view=rev Author: colombanw Date: 2011-05-09 17:40:47 +0000 (Mon, 09 May 2011)
Log Message: ----------- Fix loading and updating menu accelerators for custom commands
Modified Paths: -------------- branches/0.20.1/ChangeLog branches/0.20.1/src/main.c branches/0.20.1/src/prefs.c branches/0.20.1/src/tools.c
Modified: branches/0.20.1/ChangeLog =================================================================== --- branches/0.20.1/ChangeLog 2011-05-09 17:40:16 UTC (rev 5790) +++ branches/0.20.1/ChangeLog 2011-05-09 17:40:47 UTC (rev 5791) @@ -31,6 +31,8 @@ * src/encodings.c: Update regex used to find encodings for it to allow the encoding to be quoted, adding support for XML (closes #3183506). + * src/main.c, src/prefs.c, src/tools.c: + Fix loading and updating menu accelerators for custom commands.
2011-05-08 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: branches/0.20.1/src/main.c =================================================================== --- branches/0.20.1/src/main.c 2011-05-09 17:40:16 UTC (rev 5790) +++ branches/0.20.1/src/main.c 2011-05-09 17:40:47 UTC (rev 5791) @@ -1030,7 +1030,6 @@ ui_create_insert_menu_items(); ui_create_insert_date_menu_items(); keybindings_init(); - tools_create_insert_custom_command_menu_items(); notebook_init(); filetypes_init(); templates_init(); @@ -1080,6 +1079,10 @@ /* load keybinding settings after plugins have added their groups */ keybindings_load_keyfile();
+ /* create the custom command menu after the keybindings have been loaded to have the proper + * accelerator shown for the menu items */ + tools_create_insert_custom_command_menu_items(); + /* load any command line files or session files */ main_status.opening_session_files = TRUE; load_startup_files(argc, argv);
Modified: branches/0.20.1/src/prefs.c =================================================================== --- branches/0.20.1/src/prefs.c 2011-05-09 17:40:16 UTC (rev 5790) +++ branches/0.20.1/src/prefs.c 2011-05-09 17:40:47 UTC (rev 5791) @@ -59,6 +59,7 @@ #include "templates.h" #include "search.h" #include "toolbar.h" +#include "tools.h" #include "stash.h" #include "keyfile.h" #include "filetypes.h" @@ -1120,6 +1121,7 @@ if (edited) { kb_update(); + tools_create_insert_custom_command_menu_items(); keybindings_write_to_file(); }
@@ -1342,7 +1344,7 @@ gchar *str; gint state;
- state = event->state & gtk_accelerator_get_default_mod_mask(); + state = event->state & gtk_accelerator_get_default_mod_mask();
if (event->keyval == GDK_Escape) return FALSE; /* close the dialog, don't allow escape when detecting keybindings. */
Modified: branches/0.20.1/src/tools.c =================================================================== --- branches/0.20.1/src/tools.c 2011-05-09 17:40:16 UTC (rev 5790) +++ branches/0.20.1/src/tools.c 2011-05-09 17:40:47 UTC (rev 5791) @@ -459,13 +459,13 @@ case 2: key_idx = GEANY_KEYS_FORMAT_SENDTOCMD3; break; }
+ item = gtk_menu_item_new_with_label(label); if (key_idx != -1) + { kb = keybindings_lookup_item(GEANY_KEY_GROUP_FORMAT, key_idx); - - item = gtk_menu_item_new_with_label(label); - if (key_idx != -1) gtk_widget_add_accelerator(item, "activate", gtk_accel_group_new(), kb->key, kb->mods, GTK_ACCEL_VISIBLE); + } gtk_container_add(GTK_CONTAINER(me), item); gtk_widget_show(item); g_signal_connect(item, "activate", G_CALLBACK(cc_on_custom_command_activate),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.