[gthumb] tools menu: show the accelerators
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] tools menu: show the accelerators
- Date: Tue, 5 Nov 2019 10:40:24 +0000 (UTC)
commit 5b43a629ff15302170a362f0be020778797974bc
Author: Paolo Bacchilega <paobac src gnome org>
Date: Mon Oct 21 07:47:59 2019 +0200
tools menu: show the accelerators
extensions/list_tools/callbacks.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/extensions/list_tools/callbacks.c b/extensions/list_tools/callbacks.c
index fb059db3..e64d6858 100644
--- a/extensions/list_tools/callbacks.c
+++ b/extensions/list_tools/callbacks.c
@@ -88,20 +88,28 @@ update_scripts_menu (BrowserData *data)
script_list = gth_script_file_get_scripts (gth_script_file_get ());
for (scan = script_list; scan; scan = scan->next) {
- GthScript *script = scan->data;
- char *detailed_action;
+ GthScript *script = scan->data;
+ guint keyval;
+ GdkModifierType modifiers;
+ char *accelerator_name;
+ char *detailed_action;
if (! gth_script_is_visible (script))
continue;
detailed_action = g_strdup_printf ("win.exec-script('%s')", gth_script_get_id (script));
+
+ gth_script_get_accelerator (script, &keyval, &modifiers);
+ accelerator_name = gtk_accelerator_name (keyval, modifiers);
+
gth_menu_manager_append_entry (menu_manager,
data->menu_merge_id,
gth_script_get_display_name (script),
detailed_action,
- NULL,
+ accelerator_name,
NULL);
+ g_free (accelerator_name);
g_free (detailed_action);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]