From f0fcf240de77ebec6027c3463c0cbaf78fb1f38e Mon Sep 17 00:00:00 2001 From: Theo Linkspfeifer <lastonestanding@tutanota.com> Date: Fri, 23 Aug 2024 20:00:49 +0200 Subject: [PATCH] Use unique enum names for alternative shortcuts (#1421) The shortcuts editor relies on the number of elements in the Action enum to determine the total amount of shortcut rows. Fixes: #1421 (cherry picked from commit bb31d0a1f3727df13d1b2a565d48f7c580f7c407) --- thunar/thunar-action-manager.c | 12 ++++++------ thunar/thunar-action-manager.h | 8 +++++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/thunar/thunar-action-manager.c b/thunar/thunar-action-manager.c index 9d176d6df..7d807c4aa 100644 --- a/thunar/thunar-action-manager.c +++ b/thunar/thunar-action-manager.c @@ -291,17 +291,17 @@ static XfceGtkActionEntry thunar_action_manager_action_entries[] = { THUNAR_ACTION_MANAGER_ACTION_RESTORE_SHOW, "<Actions>/ThunarActionManager/restore-show", "", XFCE_GTK_MENU_ITEM, N_ ("_Restore and Show"), N_ ("_Restore and show the file(s)"), NULL, G_CALLBACK (thunar_action_manager_action_restore_and_show), }, {THUNAR_ACTION_MANAGER_ACTION_MOVE_TO_TRASH, "<Actions>/ThunarActionManager/move-to-trash", "", XFCE_GTK_IMAGE_MENU_ITEM, N_ ("Mo_ve to Trash"), NULL, "user-trash", G_CALLBACK (thunar_action_manager_action_trash_delete), }, {THUNAR_ACTION_MANAGER_ACTION_TRASH_DELETE, "<Actions>/ThunarActionManager/trash-delete", "Delete", XFCE_GTK_IMAGE_MENU_ITEM, NULL, NULL, NULL, G_CALLBACK (thunar_action_manager_action_trash_delete), }, - {THUNAR_ACTION_MANAGER_ACTION_TRASH_DELETE, "<Actions>/ThunarActionManager/trash-delete-2", "KP_Delete", XFCE_GTK_IMAGE_MENU_ITEM, NULL, NULL, NULL, G_CALLBACK (thunar_action_manager_action_trash_delete), }, + {THUNAR_ACTION_MANAGER_ACTION_TRASH_DELETE_ALT, "<Actions>/ThunarActionManager/trash-delete-2", "KP_Delete", XFCE_GTK_IMAGE_MENU_ITEM, NULL, NULL, NULL, G_CALLBACK (thunar_action_manager_action_trash_delete), }, {THUNAR_ACTION_MANAGER_ACTION_DELETE, "<Actions>/ThunarActionManager/delete", "", XFCE_GTK_IMAGE_MENU_ITEM, N_ ("_Delete"), NULL, "edit-delete", G_CALLBACK (thunar_action_manager_action_delete), }, - {THUNAR_ACTION_MANAGER_ACTION_DELETE, "<Actions>/ThunarActionManager/delete-2", "<Shift>Delete", XFCE_GTK_IMAGE_MENU_ITEM, NULL, NULL, NULL, G_CALLBACK (thunar_action_manager_action_delete), }, - {THUNAR_ACTION_MANAGER_ACTION_DELETE, "<Actions>/ThunarActionManager/delete-3", "<Shift>KP_Delete", XFCE_GTK_IMAGE_MENU_ITEM, NULL, NULL, NULL, G_CALLBACK (thunar_action_manager_action_delete), }, + {THUNAR_ACTION_MANAGER_ACTION_DELETE_ALT_1, "<Actions>/ThunarActionManager/delete-2", "<Shift>Delete", XFCE_GTK_IMAGE_MENU_ITEM, NULL, NULL, NULL, G_CALLBACK (thunar_action_manager_action_delete), }, + {THUNAR_ACTION_MANAGER_ACTION_DELETE_ALT_2, "<Actions>/ThunarActionManager/delete-3", "<Shift>KP_Delete", XFCE_GTK_IMAGE_MENU_ITEM, NULL, NULL, NULL, G_CALLBACK (thunar_action_manager_action_delete), }, { THUNAR_ACTION_MANAGER_ACTION_PASTE, "<Actions>/ThunarActionManager/paste", "<Primary>V", XFCE_GTK_IMAGE_MENU_ITEM, N_ ("_Paste"), N_ ("Move or copy files previously selected by a Cut or Copy command"), "edit-paste", G_CALLBACK (thunar_action_manager_action_paste), }, - { THUNAR_ACTION_MANAGER_ACTION_PASTE, "<Actions>/ThunarActionManager/paste-2", "<Shift>Insert", XFCE_GTK_IMAGE_MENU_ITEM, NULL, NULL, NULL, G_CALLBACK (thunar_action_manager_action_paste), }, + { THUNAR_ACTION_MANAGER_ACTION_PASTE_ALT, "<Actions>/ThunarActionManager/paste-2", "<Shift>Insert", XFCE_GTK_IMAGE_MENU_ITEM, NULL, NULL, NULL, G_CALLBACK (thunar_action_manager_action_paste), }, { THUNAR_ACTION_MANAGER_ACTION_PASTE_INTO_FOLDER,NULL, "", XFCE_GTK_IMAGE_MENU_ITEM, N_ ("_Paste Into Folder"), N_ ("Move or copy files previously selected by a Cut or Copy command into the selected folder"), "edit-paste", G_CALLBACK (thunar_action_manager_action_paste_into_folder), }, { THUNAR_ACTION_MANAGER_ACTION_COPY, "<Actions>/ThunarActionManager/copy", "<Primary>C", XFCE_GTK_IMAGE_MENU_ITEM, N_ ("_Copy"), N_ ("Prepare the selected files to be copied with a Paste command"), "edit-copy", G_CALLBACK (thunar_action_manager_action_copy), }, - { THUNAR_ACTION_MANAGER_ACTION_COPY, "<Actions>/ThunarActionManager/copy-2", "<Primary>Insert", XFCE_GTK_IMAGE_MENU_ITEM, NULL, NULL, NULL, G_CALLBACK (thunar_action_manager_action_copy), }, + { THUNAR_ACTION_MANAGER_ACTION_COPY_ALT, "<Actions>/ThunarActionManager/copy-2", "<Primary>Insert", XFCE_GTK_IMAGE_MENU_ITEM, NULL, NULL, NULL, G_CALLBACK (thunar_action_manager_action_copy), }, { THUNAR_ACTION_MANAGER_ACTION_CUT, "<Actions>/ThunarActionManager/cut", "<Primary>X", XFCE_GTK_IMAGE_MENU_ITEM, N_ ("Cu_t"), N_ ("Prepare the selected files to be moved with a Paste command"), "edit-cut", G_CALLBACK (thunar_action_manager_action_cut), }, - { THUNAR_ACTION_MANAGER_ACTION_CUT, "<Actions>/ThunarActionManager/cut-2", "", XFCE_GTK_IMAGE_MENU_ITEM, NULL, NULL, NULL, G_CALLBACK (thunar_action_manager_action_cut), }, + { THUNAR_ACTION_MANAGER_ACTION_CUT_ALT, "<Actions>/ThunarActionManager/cut-2", "", XFCE_GTK_IMAGE_MENU_ITEM, NULL, NULL, NULL, G_CALLBACK (thunar_action_manager_action_cut), }, { THUNAR_ACTION_MANAGER_ACTION_MOUNT, NULL, "", XFCE_GTK_MENU_ITEM, N_ ("_Mount"), N_ ("Mount the selected device"), NULL, G_CALLBACK (thunar_action_manager_action_mount), }, { THUNAR_ACTION_MANAGER_ACTION_UNMOUNT, NULL, "", XFCE_GTK_MENU_ITEM, N_ ("_Unmount"), N_ ("Unmount the selected device"), NULL, G_CALLBACK (thunar_action_manager_action_unmount), }, diff --git a/thunar/thunar-action-manager.h b/thunar/thunar-action-manager.h index 4416ee009..911caaae6 100644 --- a/thunar/thunar-action-manager.h +++ b/thunar/thunar-action-manager.h @@ -63,12 +63,18 @@ typedef enum THUNAR_ACTION_MANAGER_ACTION_RESTORE, THUNAR_ACTION_MANAGER_ACTION_RESTORE_SHOW, THUNAR_ACTION_MANAGER_ACTION_MOVE_TO_TRASH, - THUNAR_ACTION_MANAGER_ACTION_DELETE, THUNAR_ACTION_MANAGER_ACTION_TRASH_DELETE, + THUNAR_ACTION_MANAGER_ACTION_TRASH_DELETE_ALT, + THUNAR_ACTION_MANAGER_ACTION_DELETE, + THUNAR_ACTION_MANAGER_ACTION_DELETE_ALT_1, + THUNAR_ACTION_MANAGER_ACTION_DELETE_ALT_2, THUNAR_ACTION_MANAGER_ACTION_PASTE, + THUNAR_ACTION_MANAGER_ACTION_PASTE_ALT, THUNAR_ACTION_MANAGER_ACTION_PASTE_INTO_FOLDER, THUNAR_ACTION_MANAGER_ACTION_COPY, + THUNAR_ACTION_MANAGER_ACTION_COPY_ALT, THUNAR_ACTION_MANAGER_ACTION_CUT, + THUNAR_ACTION_MANAGER_ACTION_CUT_ALT, THUNAR_ACTION_MANAGER_ACTION_MOUNT, THUNAR_ACTION_MANAGER_ACTION_UNMOUNT, THUNAR_ACTION_MANAGER_ACTION_EJECT, -- GitLab