[gthumb] shortcuts: moved list tools in theirs own category
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] shortcuts: moved list tools in theirs own category
- Date: Sun, 24 Nov 2019 12:32:53 +0000 (UTC)
commit 784a3228448d4b0a6adbb2c1b9f11e71c6a537d5
Author: Paolo Bacchilega <paobac src gnome org>
Date: Thu Nov 14 18:19:30 2019 +0100
shortcuts: moved list tools in theirs own category
extensions/image_rotation/callbacks.c | 5 +++--
extensions/list_tools/gth-script.c | 3 ++-
extensions/list_tools/main.c | 7 +++++++
extensions/list_tools/shortcuts.h | 27 +++++++++++++++++++++++++++
4 files changed, 39 insertions(+), 3 deletions(-)
---
diff --git a/extensions/image_rotation/callbacks.c b/extensions/image_rotation/callbacks.c
index f6868ff4..0ec42c76 100644
--- a/extensions/image_rotation/callbacks.c
+++ b/extensions/image_rotation/callbacks.c
@@ -27,6 +27,7 @@
#include <gthumb.h>
#include <extensions/image_viewer/image-viewer.h>
#include <extensions/list_tools/list-tools.h>
+#include <extensions/list_tools/shortcuts.h>
#include "actions.h"
#include "callbacks.h"
@@ -43,8 +44,8 @@ static const GActionEntry actions[] = {
static const GthShortcut shortcuts[] = {
- { "rotate-right", N_("Rotate right"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER,
GTH_SHORTCUT_CATEGORY_FILE_MANAGER, "bracketright" },
- { "rotate-left", N_("Rotate left"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER,
GTH_SHORTCUT_CATEGORY_FILE_MANAGER, "bracketleft" },
+ { "rotate-right", N_("Rotate right"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER,
GTH_SHORTCUT_CATEGORY_LIST_TOOLS, "bracketright" },
+ { "rotate-left", N_("Rotate left"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER,
GTH_SHORTCUT_CATEGORY_LIST_TOOLS, "bracketleft" },
};
diff --git a/extensions/list_tools/gth-script.c b/extensions/list_tools/gth-script.c
index 7dfebadc..891868fe 100644
--- a/extensions/list_tools/gth-script.c
+++ b/extensions/list_tools/gth-script.c
@@ -23,6 +23,7 @@
#include <gthumb.h>
#include <gdk/gdkkeysyms.h>
#include "gth-script.h"
+#include "shortcuts.h"
static void gth_script_dom_domizable_interface_init (DomDomizableInterface *iface);
@@ -1046,7 +1047,7 @@ gth_script_get_shortcut (GthScript *self)
shortcut->action_parameter = g_variant_ref_sink (g_variant_new_string (gth_script_get_id (self)));
shortcut->description = g_strdup (self->priv->display_name);
shortcut->context = GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER;
- shortcut->category = GTH_SHORTCUT_CATEGORY_FILE_MANAGER;
+ shortcut->category = GTH_SHORTCUT_CATEGORY_LIST_TOOLS;
gth_shortcut_set_key (shortcut, self->priv->accelerator.keyval, self->priv->accelerator.modifiers);
shortcut->default_accelerator = g_strdup (shortcut->accelerator);
diff --git a/extensions/list_tools/main.c b/extensions/list_tools/main.c
index 270032e2..c5684b47 100644
--- a/extensions/list_tools/main.c
+++ b/extensions/list_tools/main.c
@@ -24,11 +24,18 @@
#include <gtk/gtk.h>
#include <gthumb.h>
#include "callbacks.h"
+#include "shortcuts.h"
+
+
+static GthShortcutCategory shortcut_categories[] = {
+ { GTH_SHORTCUT_CATEGORY_LIST_TOOLS, N_("Tools"), 12 },
+};
G_MODULE_EXPORT void
gthumb_extension_activate (void)
{
+ gth_main_register_shortcut_category (shortcut_categories, G_N_ELEMENTS (shortcut_categories));
gth_hook_add_callback ("gth-browser-construct", 5, G_CALLBACK (list_tools__gth_browser_construct_cb),
NULL);
gth_hook_add_callback ("gth-browser-selection-changed", 10, G_CALLBACK
(list_tools__gth_browser_selection_changed_cb), NULL);
}
diff --git a/extensions/list_tools/shortcuts.h b/extensions/list_tools/shortcuts.h
new file mode 100644
index 00000000..2239ab61
--- /dev/null
+++ b/extensions/list_tools/shortcuts.h
@@ -0,0 +1,27 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ * GThumb
+ *
+ * Copyright (C) 2019 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef LIST_TOOLS_SHORTCUTS_H
+#define LIST_TOOLS_SHORTCUTS_H
+
+#define GTH_SHORTCUT_CATEGORY_LIST_TOOLS "list-tools"
+
+#endif /* LIST_TOOLS_SHORTCUTS_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]