Revision: 5679 http://geany.svn.sourceforge.net/geany/?rev=5679&view=rev Author: colombanw Date: 2011-04-03 15:53:48 +0000 (Sun, 03 Apr 2011)
Log Message: ----------- Fix loading and updating menu accelerators for custom commands
Modified Paths: -------------- trunk/ChangeLog trunk/src/main.c trunk/src/prefs.c trunk/src/tools.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-04-03 11:52:27 UTC (rev 5678) +++ trunk/ChangeLog 2011-04-03 15:53:48 UTC (rev 5679) @@ -1,3 +1,9 @@ +2011-04-03 Colomban Wendling <colomban(at)geany(dot)org> + + * src/main.c, src/prefs.c, src/tools.c: + Fix loading and updating menu accelerators for custom commands. + + 2011-04-02 Colomban Wendling <colomban(at)geany(dot)org>
* src/tools.c, doc/geany.txt, doc/geany.html:
Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2011-04-03 11:52:27 UTC (rev 5678) +++ trunk/src/main.c 2011-04-03 15:53:48 UTC (rev 5679) @@ -1038,7 +1038,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(); @@ -1088,6 +1087,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: trunk/src/prefs.c =================================================================== --- trunk/src/prefs.c 2011-04-03 11:52:27 UTC (rev 5678) +++ trunk/src/prefs.c 2011-04-03 15:53:48 UTC (rev 5679) @@ -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: trunk/src/tools.c =================================================================== --- trunk/src/tools.c 2011-04-03 11:52:27 UTC (rev 5678) +++ trunk/src/tools.c 2011-04-03 15:53:48 UTC (rev 5679) @@ -660,13 +660,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.