summaryrefslogtreecommitdiff
path: root/src/ui.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui.h')
-rw-r--r--src/ui.h281
1 files changed, 72 insertions, 209 deletions
diff --git a/src/ui.h b/src/ui.h
index ce77575..aadacbe 100644
--- a/src/ui.h
+++ b/src/ui.h
@@ -25,217 +25,80 @@
#include "actions.h"
-static GtkActionEntry action_entries[] = {
- { "FileMenu", NULL, N_("_Archive"), NULL, NULL, NULL },
- { "EditMenu", NULL, N_("_Edit"), NULL, NULL, NULL },
- { "ViewMenu", NULL, N_("_View"), NULL, NULL, NULL },
- { "HelpMenu", NULL, N_("_Help"), NULL, NULL, NULL },
- { "ArrangeFilesMenu", NULL, N_("_Arrange Files"), NULL, NULL, NULL },
-
- { "About", "help-about",
- N_("_About"), NULL,
- N_("Information about the program"),
- G_CALLBACK (activate_action_about) },
- { "AddFiles", "add-files-to-archive",
- N_("_Add Files…"), NULL,
- N_("Add files to the archive"),
- G_CALLBACK (activate_action_add_files) },
- { "AddFiles_Toolbar", "add-files-to-archive",
- N_("Add Files"), NULL,
- N_("Add files to the archive"),
- G_CALLBACK (activate_action_add_files) },
- { "AddFolder", "add-folder-to-archive",
- N_("Add a _Folder…"), NULL,
- N_("Add a folder to the archive"),
- G_CALLBACK (activate_action_add_folder) },
- { "AddFolder_Toolbar", "add-folder-to-archive",
- N_("Add Folder"), NULL,
- N_("Add a folder to the archive"),
- G_CALLBACK (activate_action_add_folder) },
- { "Close", "window-close",
- N_("_Close"), "<control>W",
- N_("Close the current archive"),
- G_CALLBACK (activate_action_close) },
- { "Contents", "help-browser",
- N_("Contents"), "F1",
- N_("Display the Engrampa Manual"),
- G_CALLBACK (activate_action_manual) },
-
- { "Copy", "edit-copy",
- N_("_Copy"), "<control>C",
- N_("Copy the selection"),
- G_CALLBACK (activate_action_copy) },
- { "Cut", "edit-cut",
- N_("Cu_t"), "<control>X",
- N_("Cut the selection"),
- G_CALLBACK (activate_action_cut) },
- { "Paste", "edit-paste",
- N_("_Paste"), "<control>V",
- N_("Paste the clipboard"),
- G_CALLBACK (activate_action_paste) },
- { "Rename", NULL,
- N_("_Rename…"), "F2",
- N_("Rename the selection"),
- G_CALLBACK (activate_action_rename) },
- { "Delete", "edit-delete",
- N_("_Delete"), "Delete",
- N_("Delete the selection from the archive"),
- G_CALLBACK (activate_action_delete) },
-
- { "CopyFolderFromSidebar", "edit-copy",
- N_("_Copy"), "<control>C",
- N_("Copy the selection"),
- G_CALLBACK (activate_action_copy_folder_from_sidebar) },
- { "CutFolderFromSidebar", "edit-cut",
- N_("Cu_t"), "<control>X",
- N_("Cut the selection"),
- G_CALLBACK (activate_action_cut_folder_from_sidebar) },
- { "PasteFolderFromSidebar", "edit-paste",
- N_("_Paste"), "<control>V",
- N_("Paste the clipboard"),
- G_CALLBACK (activate_action_paste_folder_from_sidebar) },
- { "RenameFolderFromSidebar", NULL,
- N_("_Rename…"), "F2",
- N_("Rename the selection"),
- G_CALLBACK (activate_action_rename_folder_from_sidebar) },
- { "DeleteFolderFromSidebar", "edit-delete",
- N_("_Delete"), "Delete",
- N_("Delete the selection from the archive"),
- G_CALLBACK (activate_action_delete_folder_from_sidebar) },
-
- { "DeselectAll", NULL,
- N_("Dese_lect All"), "<shift><control>A",
- N_("Deselect all files"),
- G_CALLBACK (activate_action_deselect_all) },
- { "Extract", "extract-archive",
- N_("_Extract…"), "<control>E",
- N_("Extract files from the archive"),
- G_CALLBACK (activate_action_extract) },
- { "ExtractFolderFromSidebar", "extract-archive",
- N_("_Extract…"), NULL,
- N_("Extract files from the archive"),
- G_CALLBACK (activate_action_extract_folder_from_sidebar) },
- { "Extract_Toolbar", "extract-archive",
- N_("Extract"), NULL,
- N_("Extract files from the archive"),
- G_CALLBACK (activate_action_extract) },
- { "Find", "edit-find",
- N_("Find…"), "<control>F",
- NULL,
- G_CALLBACK (activate_action_find) },
-
- { "LastOutput", NULL,
- N_("_Last Output"), NULL,
- N_("View the output produced by the last executed command"),
- G_CALLBACK (activate_action_last_output) },
- { "New", "document-new",
- N_("New…"), "<control>N",
- N_("Create a new archive"),
- G_CALLBACK (activate_action_new) },
- { "Open", "document-open",
- N_("Open…"), "<control>O",
- N_("Open archive"),
- G_CALLBACK (activate_action_open) },
- { "Open_Toolbar", "document-open",
- N_("_Open"), "<control>O",
- N_("Open archive"),
- G_CALLBACK (activate_action_open) },
- { "OpenSelection", NULL,
- N_("_Open With…"), NULL,
- N_("Open selected files with an application"),
- G_CALLBACK (activate_action_open_with) },
- { "Password", NULL,
- N_("Pass_word…"), NULL,
- N_("Specify a password for this archive"),
- G_CALLBACK (activate_action_password) },
- { "Properties", "document-properties",
- N_("_Properties"), "<alt>Return",
- N_("Show archive properties"),
- G_CALLBACK (activate_action_properties) },
- { "Reload", "view-refresh",
- N_("_Refresh"), "<control>R",
- N_("Reload current archive"),
- G_CALLBACK (activate_action_reload) },
- { "SaveAs", "document-save-as",
- N_("Save As…"), NULL,
- N_("Save the current archive with a different name"),
- G_CALLBACK (activate_action_save_as) },
- { "SelectAll", "edit-select-all",
- N_("Select _All"), "<control>A",
- N_("Select all files"),
- G_CALLBACK (activate_action_select_all) },
- { "Stop", "process-stop",
- N_("_Stop"), "Escape",
- N_("Stop current operation"),
- G_CALLBACK (activate_action_stop) },
- { "TestArchive", NULL,
- N_("_Test Integrity"), NULL,
- N_("Test whether the archive contains errors"),
- G_CALLBACK (activate_action_test_archive) },
- { "ViewSelection", "document-open",
- N_("_Open"), "<control>O",
- N_("Open the selected file"),
- G_CALLBACK (activate_action_view_or_open) },
- { "ViewSelection_Toolbar", "document-open",
- N_("_Open"), "<control>O",
- N_("Open the selected file"),
- G_CALLBACK (activate_action_view_or_open) },
- { "OpenFolder", "document-open",
- N_("_Open"), "<control>O",
- N_("Open the selected folder"),
- G_CALLBACK (activate_action_open_folder) },
- { "OpenFolderFromSidebar", "document-open",
- N_("_Open"), "<control>O",
- N_("Open the selected folder"),
- G_CALLBACK (activate_action_open_folder_from_sidebar) },
-
- { "GoBack", "go-previous",
- NULL, NULL,
- N_("Go to the previous visited location"),
- G_CALLBACK (activate_action_go_back) },
- { "GoForward", "go-next",
- NULL, NULL,
- N_("Go to the next visited location"),
- G_CALLBACK (activate_action_go_forward) },
- { "GoUp", "go-up",
- NULL, NULL,
- N_("Go up one level"),
- G_CALLBACK (activate_action_go_up) },
- { "GoHome", "go-home",
- NULL, NULL,
- /* Translators: the home location is the home folder. */
- N_("Go to the home location"),
- G_CALLBACK (activate_action_go_home) },
-};
-static guint n_action_entries = G_N_ELEMENTS (action_entries);
-
-static GtkToggleActionEntry action_toggle_entries[] = {
- { "ViewToolbar", NULL,
- N_("_Toolbar"), NULL,
- N_("View the main toolbar"),
- G_CALLBACK (activate_action_view_toolbar),
- TRUE },
- { "ViewStatusbar", NULL,
- N_("Stat_usbar"), NULL,
- N_("View the statusbar"),
- G_CALLBACK (activate_action_view_statusbar),
- TRUE },
- { "ViewFolders", NULL,
- N_("_Folders"), "F9",
- N_("View the folders pane"),
- G_CALLBACK (activate_action_view_folders),
- FALSE },
+static GActionEntry action_entries[] = {
+ /* FileMenu */
+ { "New", activate_action_new, NULL, NULL, NULL, { 0 } },
+ { "Open", activate_action_open, NULL, NULL, NULL, { 0 } },
+ { "SaveAs", activate_action_save_as, NULL, NULL, NULL, { 0 } },
+ { "Extract", activate_action_extract, NULL, NULL, NULL, { 0 } },
+ { "TestArchive", activate_action_test_archive, NULL, NULL, NULL, { 0 } },
+ { "Properties", activate_action_properties, NULL, NULL, NULL, { 0 } },
+ { "Close", activate_action_close, NULL, NULL, NULL, { 0 } },
+ /* EditMenu */
+ { "Copy", activate_action_copy, NULL, NULL, NULL, { 0 } },
+ { "Cut", activate_action_cut, NULL, NULL, NULL, { 0 } },
+ { "Paste", activate_action_paste, NULL, NULL, NULL, { 0 } },
+ { "Rename", activate_action_rename, NULL, NULL, NULL, { 0 } },
+ { "Delete", activate_action_delete, NULL, NULL, NULL, { 0 } },
+ { "SelectAll", activate_action_select_all, NULL, NULL, NULL, { 0 } },
+ { "DeselectAll", activate_action_deselect_all, NULL, NULL, NULL, { 0 } },
+ { "Find", activate_action_find, NULL, NULL, NULL, { 0 } },
+ { "AddFiles", activate_action_add_files, NULL, NULL, NULL, { 0 } },
+ { "AddFolder", activate_action_add_folder, NULL, NULL, NULL, { 0 } },
+ { "Password", activate_action_password, NULL, NULL, NULL, { 0 } },
+ /* ViewMenu */
+ { "ViewToolbar", activate_toggle, NULL, "true", activate_action_view_toolbar, { 0 } },
+ { "ViewStatusbar", activate_toggle, NULL, "true", activate_action_view_statusbar, { 0 } },
+ { "ViewFolders", activate_toggle, NULL, "false", activate_action_view_folders, { 0 } },
+ { "LastOutput", activate_action_last_output, NULL, NULL, NULL, { 0 } },
+ { "Stop", activate_action_stop, NULL, NULL, NULL, { 0 } },
+ { "Reload", activate_action_reload, NULL, NULL, NULL, { 0 } },
+ /* HelpMenu */
+ { "About", activate_action_about, NULL, NULL, NULL, { 0 } },
+ { "Contents", activate_action_manual, NULL, NULL, NULL, { 0 } },
+ /* Toolbar */
+ { "OpenRecent_Toolbar", activate_action_open, NULL, NULL, NULL, { 0 } },
+ { "ExtractToolbar", activate_action_extract, NULL, NULL, NULL, { 0 } },
+ { "AddFilesToolbar", activate_action_add_files, NULL, NULL, NULL, { 0 } },
+ { "AddFolderToolbar", activate_action_add_folder, NULL, NULL, NULL, { 0 } },
+ /* LocationBar*/
+ { "GoBack", activate_action_go_back, NULL, NULL, NULL, { 0 } },
+ { "GoForward", activate_action_go_forward, NULL, NULL, NULL, { 0 } },
+ { "GoUp", activate_action_go_up, NULL, NULL, NULL, { 0 } },
+ { "GoHome", activate_action_go_home, NULL, NULL, NULL, { 0 } },
};
-static guint n_action_toggle_entries = G_N_ELEMENTS (action_toggle_entries);
-static GtkRadioActionEntry view_as_entries[] = {
- { "ViewAllFiles", NULL,
- N_("View All _Files"), "<control>1",
- " ", FR_WINDOW_LIST_MODE_FLAT },
- { "ViewAsFolder", NULL,
- N_("View as a F_older"), "<control>2",
- " ", FR_WINDOW_LIST_MODE_AS_DIR },
+static const struct {
+ guint keyval;
+ GdkModifierType modifier;
+ const gchar *widget_id;
+} menu_keybindings [] = {
+ { GDK_KEY_N, GDK_CONTROL_MASK, "new_item"},
+ { GDK_KEY_O, GDK_CONTROL_MASK, "open_item"},
+ { GDK_KEY_O, GDK_CONTROL_MASK, "open_recent_item"},
+ { GDK_KEY_E, GDK_CONTROL_MASK, "extract_item"},
+ { GDK_KEY_Return, GDK_MOD1_MASK, "properties_item"},
+ { GDK_KEY_W, GDK_CONTROL_MASK, "close_item"},
+ { GDK_KEY_X, GDK_CONTROL_MASK, "cut_item"},
+ { GDK_KEY_C, GDK_CONTROL_MASK, "copy_item"},
+ { GDK_KEY_V, GDK_CONTROL_MASK, "paste_item"},
+ { GDK_KEY_F2, 0, "rename_item"},
+ { GDK_KEY_Delete, 0, "delete_item"},
+ { GDK_KEY_A, GDK_CONTROL_MASK, "select_all_item"},
+ { GDK_KEY_A, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "deselect_all_item"},
+ { GDK_KEY_F, GDK_CONTROL_MASK, "find_item"},
+ { GDK_KEY_F9, 0, "view_folder_item"},
+ { GDK_KEY_1, GDK_CONTROL_MASK, "view_all_files_item"},
+ { GDK_KEY_2, GDK_CONTROL_MASK, "view_as_folder_item"},
+ { GDK_KEY_Escape, 0, "stop_item"},
+ { GDK_KEY_R, GDK_CONTROL_MASK, "reload_item"},
+ { GDK_KEY_F1, 0, "help_item"},
+ { GDK_KEY_O, GDK_CONTROL_MASK, "popup_open_item2"},
+ { GDK_KEY_X, GDK_CONTROL_MASK, "popup_cut_item2"},
+ { GDK_KEY_C, GDK_CONTROL_MASK, "popup_copy_item2"},
+ { GDK_KEY_V, GDK_CONTROL_MASK, "popup_paste_item2"},
+ { GDK_KEY_F2, 0, "popup_rename_item2"},
+ { GDK_KEY_Delete, 0, "popup_delete_item2"},
};
-static guint n_view_as_entries = G_N_ELEMENTS (view_as_entries);
#endif /* UI_H */