mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
Merge branch 'diegoe_missing-hig-shortcuts' into 'master'
sysprof: Add missing HIG shortcuts See merge request GNOME/sysprof!80
This commit is contained in:
@ -1,35 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkShortcutsWindow" id="help_overlay">
|
||||
<property name="modal">1</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsSection">
|
||||
<property name="section-name">shortcuts</property>
|
||||
<property name="max-height">12</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="title" translatable="yes" context="shortcut window">General</property>
|
||||
<property name="title" translatable="yes" context="shortcut window">Recording View</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="title" translatable="yes" context="shortcut window">Show Help</property>
|
||||
<property name="action-name">win.help</property>
|
||||
<property name="title" translatable="yes" context="shortcut window">Start New Recording</property>
|
||||
<property name="accelerator"><control>n</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="title" translatable="yes" context="shortcut window">Keyboard Shortcuts</property>
|
||||
<property name="action-name">win.show-help-overlay</property>
|
||||
<property name="title" translatable="yes" context="shortcut window">Save As</property>
|
||||
<property name="accelerator"><control>s</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="title" translatable="yes" context="shortcut window">Toggle Visibility of Main Sidebar</property>
|
||||
<property name="accelerator">F9</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="title" translatable="yes" context="shortcut window">Toggle Visibility of Stack Trace Sidebar</property>
|
||||
<property name="accelerator"><control>F9</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="title" translatable="yes" context="shortcut window">General</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="title" translatable="yes" context="shortcut window">Open Recording</property>
|
||||
<property name="accelerator"><control>o</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="title" translatable="yes" context="shortcut window">Close Window</property>
|
||||
<property name="action-name">window.close</property>
|
||||
<property name="accelerator"><ctrl>w</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="title" translatable="yes" context="shortcut window">Show Help</property>
|
||||
<property name="accelerator">F1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="title" translatable="yes" context="shortcut window">Show keyboard shortcuts</property>
|
||||
<property name="accelerator"><ctrl>question</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="title" translatable="yes" context="shortcut window">Quit</property>
|
||||
<property name="action-name">app.quit</property>
|
||||
<property name="accelerator"><ctrl>q</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
@ -190,11 +190,40 @@ sysprof_help (GSimpleAction *action,
|
||||
gtk_uri_launcher_launch (launcher, window, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_show_help_overlay (GSimpleAction *action,
|
||||
GVariant *variant,
|
||||
gpointer user_data)
|
||||
{
|
||||
SysprofApplication *self = user_data;
|
||||
g_autoptr(GtkBuilder) builder = NULL;
|
||||
GtkWindow *window;
|
||||
GObject *help_overlay;
|
||||
|
||||
g_assert (SYSPROF_IS_APPLICATION (self));
|
||||
g_assert (G_IS_SIMPLE_ACTION (action));
|
||||
|
||||
window = gtk_application_get_active_window (GTK_APPLICATION (self));
|
||||
builder = gtk_builder_new_from_resource ("/org/gnome/sysprof/gtk/help-overlay.ui");
|
||||
help_overlay = gtk_builder_get_object (builder, "help_overlay");
|
||||
|
||||
if (GTK_IS_SHORTCUTS_WINDOW (help_overlay))
|
||||
{
|
||||
#if DEVELOPMENT_BUILD
|
||||
gtk_widget_add_css_class (GTK_WIDGET (help_overlay), "devel");
|
||||
#endif
|
||||
gtk_window_set_transient_for (GTK_WINDOW (help_overlay), GTK_WINDOW (window));
|
||||
gtk_window_present (GTK_WINDOW (help_overlay));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_application_init (SysprofApplication *self)
|
||||
{
|
||||
static const GActionEntry actions[] = {
|
||||
{ "about", sysprof_about },
|
||||
{ "show-help-overlay", sysprof_show_help_overlay },
|
||||
{ "help", sysprof_help },
|
||||
{ "quit", sysprof_quit },
|
||||
};
|
||||
|
||||
@ -19,6 +19,30 @@
|
||||
<property name="action">action(window.close)</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcut">
|
||||
<property name="trigger"><control>q</property>
|
||||
<property name="action">action(app.quit)</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcut">
|
||||
<property name="trigger"><control>o</property>
|
||||
<property name="action">action(win.select-file)</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcut">
|
||||
<property name="trigger">F1</property>
|
||||
<property name="action">action(app.help)</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcut">
|
||||
<property name="trigger"><ctrl>question</property>
|
||||
<property name="action">action(app.show-help-overlay)</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<property name="content">
|
||||
@ -34,6 +58,7 @@
|
||||
<child type="end">
|
||||
<object class="GtkMenuButton">
|
||||
<property name="icon-name">open-menu-symbolic</property>
|
||||
<property name="primary">true</property>
|
||||
<property name="menu-model">primary_menu</property>
|
||||
</object>
|
||||
</child>
|
||||
@ -609,9 +634,18 @@
|
||||
</template>
|
||||
<menu id="primary_menu">
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Open Recording…</attribute>
|
||||
<attribute name="action">win.select-file</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
|
||||
<attribute name="action">app.show-help-overlay</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Help</attribute>
|
||||
<attribute name="accel">F1</attribute>
|
||||
<attribute name="action">app.help</attribute>
|
||||
</item>
|
||||
<item>
|
||||
@ -619,6 +653,12 @@
|
||||
<attribute name="action">app.about</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Quit</attribute>
|
||||
<attribute name="action">app.quit</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
<object class="SysprofRecordingTemplate" id="recording_template">
|
||||
</object>
|
||||
|
||||
@ -20,6 +20,12 @@
|
||||
<property name="action">action(win.show-left-sidebar)</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcut">
|
||||
<property name="trigger"><control>w</property>
|
||||
<property name="action">action(window.close)</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcut">
|
||||
<property name="trigger"><ctrl>n</property>
|
||||
@ -38,6 +44,24 @@
|
||||
<property name="action">action(win.save-capture)</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcut">
|
||||
<property name="trigger"><control>q</property>
|
||||
<property name="action">action(app.quit)</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcut">
|
||||
<property name="trigger">F1</property>
|
||||
<property name="action">action(app.help)</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcut">
|
||||
<property name="trigger"><ctrl>question</property>
|
||||
<property name="action">action(app.show-help-overlay)</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<property name="content">
|
||||
@ -180,6 +204,7 @@
|
||||
<child type="end">
|
||||
<object class="GtkMenuButton">
|
||||
<property name="icon-name">open-menu-symbolic</property>
|
||||
<property name="primary">true</property>
|
||||
<property name="menu-model">primary_menu</property>
|
||||
<property name="tooltip-text" translatable="yes">Main Menu</property>
|
||||
</object>
|
||||
@ -369,9 +394,12 @@
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
|
||||
<attribute name="action">app.show-help-overlay</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Help</attribute>
|
||||
<attribute name="accel">F1</attribute>
|
||||
<attribute name="action">app.help</attribute>
|
||||
</item>
|
||||
<item>
|
||||
@ -379,6 +407,12 @@
|
||||
<attribute name="action">app.about</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Quit</attribute>
|
||||
<attribute name="action">app.quit</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
<menu id="view_menu">
|
||||
<section>
|
||||
|
||||
Reference in New Issue
Block a user