[gthumb] selections: group similar actions together
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] selections: group similar actions together
- Date: Sun, 24 Nov 2019 12:36:45 +0000 (UTC)
commit 45d3dae0a42661895ab2e43e2f501d2cca612505
Author: Paolo Bacchilega <paobac src gnome org>
Date: Fri Nov 22 10:18:35 2019 +0100
selections: group similar actions together
To reduce the size of the shortcuts window.
extensions/selections/callbacks.c | 24 +++++++++++++++---------
extensions/selections/main.c | 6 ++++++
2 files changed, 21 insertions(+), 9 deletions(-)
---
diff --git a/extensions/selections/callbacks.c b/extensions/selections/callbacks.c
index 3a8901d1..b7093d06 100644
--- a/extensions/selections/callbacks.c
+++ b/extensions/selections/callbacks.c
@@ -54,17 +54,23 @@ static const GActionEntry actions[] = {
static const GthShortcut shortcuts[] = {
- { "add-to-selection-1", N_("Add to selection 1"), GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_SELECTIONS, "<Alt>1" },
- { "add-to-selection-2", N_("Add to selection 2"), GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_SELECTIONS, "<Alt>2" },
- { "add-to-selection-3", N_("Add to selection 3"), GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_SELECTIONS, "<Alt>3" },
+ { "add-to-selection-1", N_("Add to selection"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Alt>1" },
+ { "add-to-selection-2", N_("Add to selection"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Alt>2" },
+ { "add-to-selection-3", N_("Add to selection"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Alt>3" },
- { "remove-from-selection-1", N_("Remove from selection 1"), GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_SELECTIONS, "<Shift><Alt>1" },
- { "remove-from-selection-2", N_("Remove from selection 2"), GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_SELECTIONS, "<Shift><Alt>2" },
- { "remove-from-selection-3", N_("Remove from selection 3"), GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_SELECTIONS, "<Shift><Alt>3" },
+ { "remove-from-selection-1", N_("Remove from selection"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift><Alt>1" },
+ { "remove-from-selection-2", N_("Remove from selection"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift><Alt>2" },
+ { "remove-from-selection-3", N_("Remove from selection"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift><Alt>3" },
- { "go-to-selection-1", N_("Show selection 1"), GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_SELECTIONS, "<Primary>1" },
- { "go-to-selection-2", N_("Show selection 2"), GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_SELECTIONS, "<Primary>2" },
- { "go-to-selection-3", N_("Show selection 3"), GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_SELECTIONS, "<Primary>3" },
+ { "go-to-selection-1", N_("Show selection"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>1" },
+ { "go-to-selection-2", N_("Show selection"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>2" },
+ { "go-to-selection-3", N_("Show selection"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>3" },
+
+ /* Not real actions, used in the shorcut window for documentation. */
+
+ { "add-to-selection-doc", N_("Add to selection"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER |
GTH_SHORTCUT_CONTEXT_DOC, GTH_SHORTCUT_CATEGORY_SELECTIONS, "<Alt>1...3" },
+ { "remove-from-selection-doc", N_("Remove from selection"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER |
GTH_SHORTCUT_CONTEXT_DOC, GTH_SHORTCUT_CATEGORY_SELECTIONS, "<Shift><Alt>1...3" },
+ { "go-to-selection-doc", N_("Show selection"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER |
GTH_SHORTCUT_CONTEXT_DOC, GTH_SHORTCUT_CATEGORY_SELECTIONS, "<Primary>1...3" },
};
diff --git a/extensions/selections/main.c b/extensions/selections/main.c
index 01f7b592..f2d8aabe 100644
--- a/extensions/selections/main.c
+++ b/extensions/selections/main.c
@@ -29,11 +29,17 @@
#include "shortcuts.h"
+static GthShortcutCategory shortcut_categories[] = {
+ { GTH_SHORTCUT_CATEGORY_SELECTIONS, N_("Selections"), 17 },
+};
+
+
G_MODULE_EXPORT void
gthumb_extension_activate (void)
{
gth_main_register_file_source (GTH_TYPE_FILE_SOURCE_SELECTIONS);
gth_main_register_metadata_provider (GTH_TYPE_METADATA_PROVIDER_SELECTIONS);
+ gth_main_register_shortcut_category (shortcut_categories, G_N_ELEMENTS (shortcut_categories));
gth_hook_add_callback ("gth-browser-construct", 10, G_CALLBACK
(selections__gth_browser_construct_cb), NULL);
gth_hook_add_callback ("gth-browser-selection-changed", 10, G_CALLBACK
(selections__gth_browser_selection_changed_cb), NULL);
gth_hook_add_callback ("gth-browser-file-list-key-press", 10, G_CALLBACK
(selections__gth_browser_file_list_key_press_cb), NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]