diff --git a/src/sysprof/gtk/help-overlay.ui b/src/sysprof/gtk/help-overlay.ui index 6b362cba..69db015c 100644 --- a/src/sysprof/gtk/help-overlay.ui +++ b/src/sysprof/gtk/help-overlay.ui @@ -3,46 +3,39 @@ - 1 - sysprof - Sysprof Shortcuts + shortcuts + 12 - 1 Files - 1 Save Recording Saves the current recording - <Primary>s + win.save-capture - 1 Open recording Opens a previously saved recording - <Primary>o + app.open-capture - 1 Recording - 1 Record again Starts a new recording - <Primary>r + win.replay-capture - 1 Stop recording Escape @@ -51,11 +44,9 @@ - 1 Callgraph - 1 Expand function Shows the direct descendants of the callgraph function Right @@ -63,7 +54,6 @@ - 1 Collapse function Hides all callgraph descendants below the selected function Left @@ -71,7 +61,6 @@ - 1 Jump into function Selects the function or file as the top of the callgraph Return @@ -81,31 +70,74 @@ - 1 Visualizers - 1 Zoom in <primary>plus - 1 Zoom out <primary>minus - 1 Reset zoom <primary>0 + + + General + + + Show Help + app.help + + + + + Keyboard Shortcuts + win.show-help-overlay + + + + + New Tab + win.new-tab + + + + + Switch Tab + <alt>1...9 + + + + + New Window + app.new-window + + + + + Close Window + win.close-tab + + + + + Quit + app.quit + + + + diff --git a/src/sysprof/gtk/menus.ui b/src/sysprof/gtk/menus.ui index 3e0a61f2..ea3d9ca0 100644 --- a/src/sysprof/gtk/menus.ui +++ b/src/sysprof/gtk/menus.ui @@ -5,50 +5,42 @@ New Tab win.new-tab - <primary>t New Window app.new-window - <primary>n
Open Recording… app.open-capture - <primary>o Save Recording… win.save-capture - <primary>s
Record Again win.replay-capture - <primary>r
Close win.close-tab - <primary>w
Keyboard Shortcuts - app.show-help-overlay - <primary>question + win.show-help-overlay Help app.help - F1 About Sysprof diff --git a/src/sysprof/sysprof-application.c b/src/sysprof/sysprof-application.c index ebe45beb..66ce5c25 100644 --- a/src/sysprof/sysprof-application.c +++ b/src/sysprof/sysprof-application.c @@ -37,6 +37,7 @@ struct { const gchar *accels[12]; } default_accels[] = { { "app.help", { "F1", NULL } }, + { "app.quit", { "q", NULL } }, { "app.new-window", { "n", NULL } }, { "app.open-capture", { "o", NULL } }, { "zoom.zoom-in", { "plus", "KP_Add", "equal", "ZoomIn", NULL } }, @@ -266,40 +267,6 @@ sysprof_open_capture (GSimpleAction *action, } } -static void -sysprof_show_help_overlay (GSimpleAction *action, - GVariant *variant, - gpointer user_data) -{ - GtkApplication *app = user_data; - SysprofWindow *window = NULL; - - g_assert (G_IS_APPLICATION (app)); - g_assert (G_IS_SIMPLE_ACTION (action)); - g_assert (variant == NULL); - - for (GList *list = gtk_application_get_windows (app); list; list = list->next) - { - GtkWindow *element = list->data; - - if (SYSPROF_IS_WINDOW (element)) - { - window = SYSPROF_WINDOW (element); - break; - } - } - - if (window == NULL) - { - window = SYSPROF_WINDOW (sysprof_window_new (SYSPROF_APPLICATION (app))); - gtk_window_present (GTK_WINDOW (window)); - } - - g_assert (g_action_group_has_action (G_ACTION_GROUP (window), "show-help-overlay")); - - g_action_group_activate_action (G_ACTION_GROUP (window), "show-help-overlay", NULL); -} - static void sysprof_application_init (SysprofApplication *self) { @@ -308,7 +275,6 @@ sysprof_application_init (SysprofApplication *self) { "new-window", sysprof_new_window }, { "open-capture", sysprof_open_capture }, { "help", sysprof_help }, - { "show-help-overlay", sysprof_show_help_overlay }, { "quit", sysprof_quit }, };