Commit c3b9b4d9 authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

shortcuts: reorganized the categories; added a sort order

parent daed48a4
......@@ -42,8 +42,8 @@ static const GActionEntry actions[] = {
static const GthShortcut shortcuts[] = {
{ "edit-metadata", N_("Edit comment"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_EDIT, "c" },
{ "edit-tags", N_("Edit tags"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_EDIT, "t" },
{ "edit-metadata", N_("Edit comment"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_MANAGER, "c" },
{ "edit-tags", N_("Edit tags"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_MANAGER, "t" },
};
......
......@@ -120,14 +120,14 @@ static const GthMenuEntry vfs_entries[] = {
static const GthShortcut shortcuts[] = {
{ "rename", N_("Rename File"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_EDIT, "F2" },
{ "duplicate", N_("Duplicate File"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_EDIT, "d" },
{ "remove-from-source", N_("Delete File"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_EDIT, "Delete" },
{ "remove-from-source-permanently", N_("Delete File Permanently"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_EDIT, "<Shift>Delete" },
{ "open-with-gimp", N_("Open With Gimp"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_EDIT, "g" },
{ "edit-cut", N_("Cut"), GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_FIXED, GTH_SHORTCUT_CATEGORY_FILE_MANAGER, "<Primary>x" },
{ "edit-copy", N_("Copy"), GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_FIXED, GTH_SHORTCUT_CATEGORY_FILE_MANAGER, "<Primary>c" },
{ "edit-paste", N_("Paste"), GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_FIXED, GTH_SHORTCUT_CATEGORY_FILE_MANAGER, "<Primary>v" },
{ "rename", N_("Rename"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_MANAGER, "F2" },
{ "duplicate", N_("Duplicate"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_MANAGER, "d" },
{ "remove-from-source", N_("Delete"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_MANAGER, "Delete" },
{ "remove-from-source-permanently", N_("Delete permanently"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_MANAGER, "<Shift>Delete" },
{ "open-with-gimp", N_("Open with Gimp"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_MANAGER, "g" },
};
......
......@@ -26,6 +26,7 @@
#include <gdk/gdkkeysyms.h>
#include <gthumb.h>
#include <extensions/image_viewer/gth-image-viewer-page.h>
#include <extensions/image_viewer/shortcuts.h>
#include "actions.h"
#include "callbacks.h"
#include "gth-file-tool-adjust-contrast.h"
......@@ -49,13 +50,13 @@ static const GActionEntry actions[] = {
static const GthShortcut shortcuts[] = {
{ "file-tool-adjust-contrast", N_("Adjust Contrast"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_EDIT, "a" },
{ "file-tool-flip", N_("Flip"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_EDIT, "l" },
{ "file-tool-mirror", N_("Mirror"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_EDIT, "m" },
{ "file-tool-rotate-right", N_("Rotate Right"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_EDIT, "r" },
{ "file-tool-rotate-left", N_("Rotate Left"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_EDIT, "<Shift>r" },
{ "file-tool-crop", N_("Crop"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_EDIT, "<Shift>c" },
{ "file-tool-resize", N_("Resize"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_EDIT, "<Shift>s" },
{ "file-tool-adjust-contrast", N_("Adjust contrast"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_EDITOR, "a" },
{ "file-tool-flip", N_("Flip"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_EDITOR, "l" },
{ "file-tool-mirror", N_("Mirror"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_EDITOR, "m" },
{ "file-tool-rotate-right", N_("Rotate right"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_EDITOR, "r" },
{ "file-tool-rotate-left", N_("Rotate left"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_EDITOR, "<Shift>r" },
{ "file-tool-crop", N_("Crop"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_EDITOR, "<Shift>c" },
{ "file-tool-resize", N_("Resize"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_EDITOR, "<Shift>s" },
};
......
......@@ -35,7 +35,7 @@ static const GActionEntry actions[] = {
static const GthShortcut shortcuts[] = {
{ "print", N_("Print"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_EDIT, "<Primary>p" },
{ "print", N_("Print"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_MANAGER, "<Primary>p" },
};
......
......@@ -43,8 +43,8 @@ static const GActionEntry actions[] = {
static const GthShortcut shortcuts[] = {
{ "rotate-right", N_("Rotate Right"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_EDIT, "bracketright" },
{ "rotate-left", N_("Rotate Left"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_EDIT, "bracketleft" },
{ "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" },
};
......
......@@ -25,24 +25,25 @@
#include <glib-object.h>
#include <gthumb.h>
#include "callbacks.h"
#include "shortcuts.h"
static const GthShortcut shortcuts[] = {
{ "image-zoom-in", N_("Zoom In"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEW, "plus" },
{ "image-zoom-out", N_("Zoom Out"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEW, "minus" },
{ "image-zoom-100", N_("Zoom 100%"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEW, "1" },
{ "image-zoom-200", N_("Zoom 200%"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEW, "2" },
{ "image-zoom-300", N_("Zoom 300%"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEW, "3" },
{ "image-zoom-fit", N_("Zoom To Fit"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEW, "<Shift>x" },
{ "image-zoom-fit-if-larger", N_("Zoom To Fit If Larger"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEW, "x" },
{ "image-zoom-fit-width", N_("Zoom To Fit Width"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEW, "<Shift>w" },
{ "image-zoom-fit-width-if-larger", N_("Zoom To Fit Width If Larger"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEW, "w" },
{ "image-zoom-fit-height", N_("Zoom To Fit Height"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEW, "<Shift>h" },
{ "image-zoom-fit-height-if-larger", N_("Zoom To Fit Height If Larger"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEW, "h" },
{ "image-undo", N_("Undo Edit"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEW, "<Primary>z" },
{ "image-redo", N_("Redo Edit"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEW, "<Primary><Shift>z" },
{ "image-zoom-in", N_("Zoom in"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEWER, "plus" },
{ "image-zoom-out", N_("Zoom out"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEWER, "minus" },
{ "image-zoom-100", N_("Zoom 100%"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEWER, "1" },
{ "image-zoom-200", N_("Zoom 200%"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEWER, "2" },
{ "image-zoom-300", N_("Zoom 300%"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEWER, "3" },
{ "image-zoom-fit", N_("Zoom to fit"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEWER, "<Shift>x" },
{ "image-zoom-fit-if-larger", N_("Zoom to fit if larger"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEWER, "x" },
{ "image-zoom-fit-width", N_("Zoom to fit width"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEWER, "<Shift>w" },
{ "image-zoom-fit-width-if-larger", N_("Zoom to fit width if larger"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEWER, "w" },
{ "image-zoom-fit-height", N_("Zoom to fit height"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEWER, "<Shift>h" },
{ "image-zoom-fit-height-if-larger", N_("Zoom to fit height if larger"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEWER, "h" },
{ "image-undo", N_("Undo edit"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_EDITOR, "<Primary>z" },
{ "image-redo", N_("Redo edit"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_EDITOR, "<Primary><Shift>z" },
};
......
......@@ -26,5 +26,6 @@
#include "gth-image-viewer-page-tool.h"
#include "gth-image-viewer-task.h"
#include "preferences.h"
#include "shortcuts.h"
#endif /* IMAGE_VIEWER_H */
......@@ -28,6 +28,13 @@
#include "gth-metadata-provider-image.h"
#include "callbacks.h"
#include "preferences.h"
#include "shortcuts.h"
static GthShortcutCategory shortcut_categories[] = {
{ GTH_SHORTCUT_CATEGORY_IMAGE_VIEWER, N_("Image Viewer"), 21 },
{ GTH_SHORTCUT_CATEGORY_IMAGE_EDITOR, N_("Image Editor"), 22 }
};
G_MODULE_EXPORT void
......@@ -36,6 +43,7 @@ gthumb_extension_activate (void)
gth_main_register_metadata_provider (GTH_TYPE_METADATA_PROVIDER_IMAGE);
gth_main_register_object (GTH_TYPE_VIEWER_PAGE, NULL, GTH_TYPE_IMAGE_VIEWER_PAGE, NULL);
gth_main_register_type ("file-properties", GTH_TYPE_IMAGE_HISTOGRAM);
gth_main_register_shortcut_category (shortcut_categories, G_N_ELEMENTS (shortcut_categories));
gth_hook_add_callback ("dlg-preferences-construct", 10, G_CALLBACK (image_viewer__dlg_preferences_construct_cb), NULL);
gth_hook_add_callback ("gth-browser-construct", 7, G_CALLBACK (image_viewer__gth_browser_construct_cb), NULL);
}
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* GThumb
*
* Copyright (C) 2009 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 SHORTCUTS_H
#define SHORTCUTS_H
#define GTH_SHORTCUT_CATEGORY_IMAGE_VIEWER "image-viewer"
#define GTH_SHORTCUT_CATEGORY_IMAGE_EDITOR "image-editor"
#endif /* SHORTCUTS_H */
......@@ -28,6 +28,7 @@
#include "callbacks.h"
#include "gth-file-source-selections.h"
#include "gth-selections-manager.h"
#include "shortcuts.h"
#define BROWSER_DATA_KEY "selections-browser-data"
......@@ -53,17 +54,19 @@ static const GActionEntry actions[] = {
static const GthShortcut shortcuts[] = {
{ "add-to-selection-1", "", GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Alt>1" },
{ "add-to-selection-2", "", GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Alt>2" },
{ "add-to-selection-3", "", GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Alt>3" },
{ "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" },
{ "remove-from-selection-1", "", GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift><Alt>1" },
{ "remove-from-selection-2", "", GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift><Alt>2" },
{ "remove-from-selection-3", "", GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift><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" },
{ "go-to-selection-1", "", GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>1" },
{ "go-to-selection-2", "", GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>2" },
{ "go-to-selection-3", "", GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>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-container-from-selection", N_("Open the file folder"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_SELECTIONS, "<Alt>End" },
};
......
......@@ -26,6 +26,12 @@
#include "callbacks.h"
#include "gth-file-source-selections.h"
#include "gth-metadata-provider-selections.h"
#include "shortcuts.h"
static GthShortcutCategory shortcut_categories[] = {
{ GTH_SHORTCUT_CATEGORY_SELECTIONS, N_("Selections"), 17 },
};
G_MODULE_EXPORT void
......@@ -33,6 +39,7 @@ 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-update-sensitivity", 10, G_CALLBACK (selections__gth_browser_update_sensitivity_cb), NULL);
gth_hook_add_callback ("gth-browser-file-list-key-press", 10, G_CALLBACK (selections__gth_browser_file_list_key_press_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 SHORTCUTS_H
#define SHORTCUTS_H
#define GTH_SHORTCUT_CATEGORY_SELECTIONS "selections"
#endif /* SHORTCUTS_H */
......@@ -3,7 +3,7 @@
/*
* GThumb
*
* Copyright (C) 2005-2009 Free Software Foundation, Inc.
* Copyright (C) 2005-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
......@@ -71,34 +71,34 @@ static const GActionEntry gth_browser_actions[] = {
static const GthAccelerator gth_browser_accelerators[] = {
{ "browser-mode", "Escape" },
{ "close", "<Control>w" },
};
static const GthShortcut gth_browser_shortcuts[] = {
{ "close", N_("Close Window"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_UI, "" },
{ "open-location", N_("Open Location"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_NAVIGATION, "o" },
{ "fullscreen", N_("Fullscreen"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEW, "f" },
{ "revert-to-saved", N_("Revert Image to Saved"), GTH_SHORTCUT_CONTEXT_BROWSER, GTH_SHORTCUT_CATEGORY_FILE_EDIT, "F4" },
{ "show-sidebar", N_("Sidebar"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_UI, "F9" },
{ "show-statusbar", N_("Statusbar"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_UI, "F7" },
{ "show-thumbnail-list", N_("Thumbnails List"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_UI, "F8" },
{ "go-back", N_("Load Previuos Location"), GTH_SHORTCUT_CONTEXT_BROWSER, GTH_SHORTCUT_CATEGORY_FILE_NAVIGATION, "<Alt>Left" },
{ "go-forward", N_("Load Next Location"), GTH_SHORTCUT_CONTEXT_BROWSER, GTH_SHORTCUT_CATEGORY_FILE_NAVIGATION, "<Alt>Right" },
{ "go-up", N_("Load Parent Folder"), GTH_SHORTCUT_CONTEXT_BROWSER, GTH_SHORTCUT_CATEGORY_FILE_NAVIGATION, "<Alt>Up" },
{ "go-home", N_("Load Home"), GTH_SHORTCUT_CONTEXT_BROWSER, GTH_SHORTCUT_CATEGORY_FILE_NAVIGATION, "<Alt>Home" },
{ "reload", N_("Reload Location"), GTH_SHORTCUT_CONTEXT_BROWSER, GTH_SHORTCUT_CATEGORY_FILE_NAVIGATION, "r" },
{ "show-hidden-files", N_("Show/Hide Hidden Files"), GTH_SHORTCUT_CONTEXT_BROWSER, GTH_SHORTCUT_CATEGORY_FILE_NAVIGATION, "h" },
{ "sort-by", N_("Change Sorting Order"), GTH_SHORTCUT_CONTEXT_BROWSER, GTH_SHORTCUT_CATEGORY_FILE_NAVIGATION, "s" },
{ "show-previous-image", N_("Show Previous Image"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEW, "BackSpace" },
{ "show-next-image", N_("Show Next Image"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEW, "space" },
{ "show-first-image", N_("Show First Image"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEW, "Home" },
{ "show-last-image", N_("Show Last Image"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_IMAGE_VIEW, "End" },
{ "toggle-edit-file", N_("Edit Image"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_UI, "e" },
{ "toggle-file-properties", N_("File Properties"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_UI, "i" },
{ "browser-mode", N_("Show browser"), GTH_SHORTCUT_CONTEXT_INTERNAL | GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_GENERAL, "Escape" },
{ "close", N_("Close window"), GTH_SHORTCUT_CONTEXT_INTERNAL | GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_GENERAL, "<Primary>w" },
{ "quit", N_("Quit"), GTH_SHORTCUT_CONTEXT_INTERNAL | GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_GENERAL, "<Primary>q" },
{ "new-window", N_("New Window"), GTH_SHORTCUT_CONTEXT_INTERNAL | GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_GENERAL, "<Primary>n" },
{ "open-location", N_("Open location"), GTH_SHORTCUT_CONTEXT_BROWSER, GTH_SHORTCUT_CATEGORY_NAVIGATION, "o" },
{ "fullscreen", N_("Fullscreen"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_VIEWER, "f" },
{ "revert-to-saved", N_("Revert image to saved"), GTH_SHORTCUT_CONTEXT_BROWSER, GTH_SHORTCUT_CATEGORY_FILE_MANAGER, "F4" },
{ "go-back", N_("Load previuos location"), GTH_SHORTCUT_CONTEXT_BROWSER, GTH_SHORTCUT_CATEGORY_NAVIGATION, "<Alt>Left" },
{ "go-forward", N_("Load next location"), GTH_SHORTCUT_CONTEXT_BROWSER, GTH_SHORTCUT_CATEGORY_NAVIGATION, "<Alt>Right" },
{ "go-up", N_("Load parent folder"), GTH_SHORTCUT_CONTEXT_BROWSER, GTH_SHORTCUT_CATEGORY_NAVIGATION, "<Alt>Up" },
{ "go-home", N_("Load home"), GTH_SHORTCUT_CONTEXT_BROWSER, GTH_SHORTCUT_CATEGORY_NAVIGATION, "<Alt>Home" },
{ "reload", N_("Reload location"), GTH_SHORTCUT_CONTEXT_BROWSER, GTH_SHORTCUT_CATEGORY_NAVIGATION, "r" },
{ "show-hidden-files", N_("Show/Hide hidden files"), GTH_SHORTCUT_CONTEXT_BROWSER, GTH_SHORTCUT_CATEGORY_NAVIGATION, "h" },
{ "sort-by", N_("Change sorting order"), GTH_SHORTCUT_CONTEXT_BROWSER, GTH_SHORTCUT_CATEGORY_NAVIGATION, "s" },
{ "show-previous-image", N_("Show previous file"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_VIEWER, "BackSpace" },
{ "show-next-image", N_("Show next file"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_VIEWER, "space" },
{ "show-first-image", N_("Show first file"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_VIEWER, "Home" },
{ "show-last-image", N_("Show last file"), GTH_SHORTCUT_CONTEXT_VIEWER, GTH_SHORTCUT_CATEGORY_VIEWER, "End" },
{ "toggle-edit-file", N_("Image tools"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_UI, "e" },
{ "toggle-file-properties", N_("File properties"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_UI, "i" },
};
......
......@@ -33,14 +33,14 @@
#include "pixbuf-io.h"
GthShortcutCategory shortcut_categories[] = {
static GthShortcutCategory shortcut_categories[] = {
{ GTH_SHORTCUT_CATEGORY_HIDDEN, NULL },
{ GTH_SHORTCUT_CATEGORY_UI, N_("Show/Hide") },
{ GTH_SHORTCUT_CATEGORY_FILE_NAVIGATION, N_("File Navigation") },
{ GTH_SHORTCUT_CATEGORY_FILE_EDIT, N_("File Edit") },
{ GTH_SHORTCUT_CATEGORY_IMAGE_VIEW, N_("Viewer") },
{ GTH_SHORTCUT_CATEGORY_IMAGE_EDIT, N_("Image Edit") },
{ GTH_SHORTCUT_CATEGORY_SLIDESHOW, N_("Slideshow") },
{ GTH_SHORTCUT_CATEGORY_GENERAL, N_("General"), 30 },
{ GTH_SHORTCUT_CATEGORY_UI, N_("Show/Hide"), 31 },
{ GTH_SHORTCUT_CATEGORY_NAVIGATION, N_("Navigation"), 15 },
{ GTH_SHORTCUT_CATEGORY_FILE_MANAGER, N_("File Manager"), 10 },
{ GTH_SHORTCUT_CATEGORY_VIEWER, N_("Viewer"), 20 },
{ GTH_SHORTCUT_CATEGORY_SLIDESHOW, N_("Slideshow"), 21 }
};
......
......@@ -26,20 +26,19 @@
G_BEGIN_DECLS
#define GTH_SHORTCUT_CONTEXT_INTERNAL -1
#define GTH_SHORTCUT_CATEGORY_HIDDEN "hidden"
#define GTH_SHORTCUT_CATEGORY_GENERAL "general"
#define GTH_SHORTCUT_CATEGORY_UI "ui"
#define GTH_SHORTCUT_CATEGORY_FILE_NAVIGATION "file-navigation"
#define GTH_SHORTCUT_CATEGORY_FILE_EDIT "file-edit"
#define GTH_SHORTCUT_CATEGORY_IMAGE_VIEW "image-view"
#define GTH_SHORTCUT_CATEGORY_IMAGE_EDIT "image-edit"
#define GTH_SHORTCUT_CATEGORY_NAVIGATION "file-navigation"
#define GTH_SHORTCUT_CATEGORY_FILE_MANAGER "file-manager"
#define GTH_SHORTCUT_CATEGORY_VIEWER "file-viewer"
#define GTH_SHORTCUT_CATEGORY_SLIDESHOW "slideshow"
typedef struct {
char *id;
char *display_name;
int sort_order;
} GthShortcutCategory;
......
......@@ -827,10 +827,27 @@ static int
sort_shortcuts_by_category (gconstpointer a,
gconstpointer b)
{
const GthShortcut *sa = * (GthShortcut **) a;
const GthShortcut *sb = * (GthShortcut **) b;
const GthShortcut *sa = * (GthShortcut **) a;
const GthShortcut *sb = * (GthShortcut **) b;
int result;
GthShortcutCategory *cat_a;
GthShortcutCategory *cat_b;
result = 0;
cat_a = gth_main_get_shortcut_category (sa->category);
cat_b = gth_main_get_shortcut_category (sb->category);
if ((cat_a != NULL) && (cat_b != NULL)) {
if (cat_a->sort_order < cat_b->sort_order)
result = -1;
else if (cat_a->sort_order > cat_b->sort_order)
result = 1;
}
if (result == 0)
result = g_strcmp0 (sa->category, sb->category);
if (result == 0)
result = g_strcmp0 (sa->description, sb->description);
return g_strcmp0 (sa->category, sb->category);
return result;
}
......
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