Commit 784a3228 authored by Paolo Bacchilega's avatar Paolo Bacchilega

shortcuts: moved list tools in theirs own category

parent 60ac11cb
......@@ -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" },
};
......
......@@ -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);
......
......@@ -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);
}
......
/* -*- 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 */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment