Add a shortcuts window
This commit is contained in:
parent
6383f71fa0
commit
6159ad5be2
|
@ -0,0 +1,330 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.17 -->
|
||||
<object class="GtkShortcutsWindow" id="shortcuts-xed">
|
||||
<property name="modal">1</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsSection">
|
||||
<property name="visible">1</property>
|
||||
<property name="section-name">shortcuts</property>
|
||||
<property name="max-height">12</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Documents</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>N</property>
|
||||
<property name="title" translatable="yes">Create a new document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>O</property>
|
||||
<property name="title" translatable="yes">Open a document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>S</property>
|
||||
<property name="title" translatable="yes">Save the document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><shift>S</property>
|
||||
<property name="title" translatable="yes">Save the document with a new filename</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><shift>L</property>
|
||||
<property name="title" translatable="yes">Save all the documents</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>W</property>
|
||||
<property name="title" translatable="yes">Close the document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><shift>W</property>
|
||||
<property name="title" translatable="yes">Close all the documents</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><Alt>Page_Down</property>
|
||||
<property name="title" translatable="yes">Switch to the next document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><Alt>Page_Up</property>
|
||||
<property name="title" translatable="yes">Switch to the previous document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><Alt>1...9</property>
|
||||
<property name="title" translatable="yes">Switch to the first - ninth document</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Windows and Panes</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">F9</property>
|
||||
<property name="title" translatable="yes">Show side pane</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>F9</property>
|
||||
<property name="title" translatable="yes">Show bottom pane</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">F11</property>
|
||||
<property name="title" translatable="yes">Fullscreen on / off</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>Q</property>
|
||||
<property name="title" translatable="yes">Quit the application</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Find and Replace</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>F</property>
|
||||
<property name="title" translatable="yes">Find</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>G</property>
|
||||
<property name="title" translatable="yes">Find the next match</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><Shift>G</property>
|
||||
<property name="title" translatable="yes">Find the previous match</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>H</property>
|
||||
<property name="title" translatable="yes">Find and Replace</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>I</property>
|
||||
<property name="title" translatable="yes">Go to line</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Copy and Paste</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>C</property>
|
||||
<property name="title" translatable="yes">Copy selected text to clipboard</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>X</property>
|
||||
<property name="title" translatable="yes">Cut selected text to clipboard</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>V</property>
|
||||
<property name="title" translatable="yes">Paste text from clipboard</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Undo and Redo</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>Z</property>
|
||||
<property name="title" translatable="yes">Undo previous command</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>Y</property>
|
||||
<property name="title" translatable="yes">Redo previous command</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Selection</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>A</property>
|
||||
<property name="title" translatable="yes">Select all text</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Editing</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">Insert</property>
|
||||
<property name="title" translatable="yes">Toggle insert / overwrite</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>D</property>
|
||||
<property name="title" translatable="yes">Delete current line</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><alt>Up</property>
|
||||
<property name="title" translatable="yes">Move current line up</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><alt>Down</property>
|
||||
<property name="title" translatable="yes">Move current line down</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><alt>Left</property>
|
||||
<property name="title" translatable="yes">Move current word left</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><alt>Right</property>
|
||||
<property name="title" translatable="yes">Move current word right</property>
|
||||
</object>
|
||||
</child>
|
||||
<!--
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>U</property>
|
||||
<property name="title" translatable="yes">Convert to uppercase</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>L</property>
|
||||
<property name="title" translatable="yes">Convert to lowercase</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>asciitilde</property>
|
||||
<property name="title" translatable="yes">Invert case</property>
|
||||
</object>
|
||||
</child>
|
||||
-->
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><shift>a</property>
|
||||
<property name="title" translatable="yes">Increment number at cursor</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><shift>x</property>
|
||||
<property name="title" translatable="yes">Decrement number at cursor</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Tools</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><shift>F7</property>
|
||||
<property name="title" translatable="yes">Check spelling</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>P</property>
|
||||
<property name="title" translatable="yes">Print the document</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
|
@ -123,6 +123,8 @@
|
|||
<menu name="HelpMenu" action="Help">
|
||||
<menuitem name="HelpContentsMenu" action="HelpContents"/>
|
||||
<menuitem name="HelpAboutMenu" action="HelpAbout"/>
|
||||
<menuitem name="HelpAboutMenu" action="HelpAbout"/>
|
||||
<menuitem name="HelpShortcutsMenu" action="HelpShortcuts"/>
|
||||
</menu>
|
||||
</menubar>
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<file preprocess="xml-stripblanks">ui/xed-preferences-dialog.ui</file>
|
||||
<file preprocess="xml-stripblanks">ui/xed-print-preferences.ui</file>
|
||||
<file preprocess="xml-stripblanks">ui/xed-searchbar.ui</file>
|
||||
<file preprocess="xml-stripblanks">ui/xed-shortcuts.ui</file>
|
||||
<file preprocess="xml-stripblanks">ui/xed-view-frame.ui</file>
|
||||
<file>css/xed-style.css</file>
|
||||
</gresource>
|
||||
|
|
|
@ -67,3 +67,33 @@ void _xed_cmd_help_about (GtkAction *action,
|
|||
"website", "http://github.com/linuxmint/xed",
|
||||
NULL);
|
||||
}
|
||||
|
||||
void
|
||||
_xed_cmd_help_keyboard_shortcuts (GtkAction *action,
|
||||
XedWindow *window)
|
||||
{
|
||||
static GtkWidget *shortcuts_window;
|
||||
|
||||
xed_debug (DEBUG_COMMANDS);
|
||||
|
||||
if (shortcuts_window == NULL)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/org/x/editor/ui/xed-shortcuts.ui");
|
||||
shortcuts_window = GTK_WIDGET (gtk_builder_get_object (builder, "shortcuts-xed"));
|
||||
|
||||
g_signal_connect (shortcuts_window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &shortcuts_window);
|
||||
|
||||
g_object_unref (builder);
|
||||
}
|
||||
|
||||
if (GTK_WINDOW (window) != gtk_window_get_transient_for (GTK_WINDOW (shortcuts_window)))
|
||||
{
|
||||
gtk_window_set_transient_for (GTK_WINDOW (shortcuts_window), GTK_WINDOW (window));
|
||||
}
|
||||
|
||||
gtk_widget_show_all (shortcuts_window);
|
||||
gtk_window_present (GTK_WINDOW (shortcuts_window));
|
||||
}
|
||||
|
|
|
@ -66,6 +66,7 @@ void _xed_cmd_documents_move_to_new_window (GtkAction *action, XedWindow *window
|
|||
|
||||
void _xed_cmd_help_contents (GtkAction *action, XedWindow *window);
|
||||
void _xed_cmd_help_about (GtkAction *action, XedWindow *window);
|
||||
void _xed_cmd_help_keyboard_shortcuts (GtkAction *action, XedWindow *window);
|
||||
|
||||
void _xed_cmd_file_close_tab (XedTab *tab, XedWindow *window);
|
||||
|
||||
|
|
|
@ -67,6 +67,8 @@ static const GtkActionEntry xed_always_sensitive_menu_entries[] =
|
|||
N_("Open the xed manual"), G_CALLBACK (_xed_cmd_help_contents) },
|
||||
{ "HelpAbout", "help-about-symbolic", N_("_About"), NULL,
|
||||
N_("About this application"), G_CALLBACK (_xed_cmd_help_about) },
|
||||
{ "HelpShortcuts", NULL, N_("_Keyboard Shortcuts"), NULL,
|
||||
N_("Show the keyboard shortcuts dialog"), G_CALLBACK (_xed_cmd_help_keyboard_shortcuts) },
|
||||
|
||||
/* Fullscreen toolbar */
|
||||
{ "LeaveFullscreen", "view-restore-symbolic", NULL,
|
||||
|
|
Loading…
Reference in New Issue