diff --git a/src/sysprof/sysprof-window.c b/src/sysprof/sysprof-window.c index fef99dd4..b3d95f59 100644 --- a/src/sysprof/sysprof-window.c +++ b/src/sysprof/sysprof-window.c @@ -54,11 +54,9 @@ G_DEFINE_FINAL_TYPE (SysprofWindow, sysprof_window, ADW_TYPE_APPLICATION_WINDOW) static GParamSpec *properties [N_PROPS]; static void -sysprof_window_open_capture_action (GtkWidget *widget, - const char *action_name, - GVariant *param) +show_greeter (SysprofWindow *self, + SysprofGreeterPage page) { - SysprofWindow *self = (SysprofWindow *)widget; SysprofGreeter *greeter; g_assert (SYSPROF_IS_WINDOW (self)); @@ -66,10 +64,26 @@ sysprof_window_open_capture_action (GtkWidget *widget, greeter = g_object_new (SYSPROF_TYPE_GREETER, "transient-for", self, NULL); - sysprof_greeter_set_page (greeter, SYSPROF_GREETER_PAGE_OPEN); + sysprof_greeter_set_page (greeter, page); gtk_window_present (GTK_WINDOW (greeter)); } +static void +sysprof_window_open_capture_action (GtkWidget *widget, + const char *action_name, + GVariant *param) +{ + show_greeter (SYSPROF_WINDOW (widget), SYSPROF_GREETER_PAGE_OPEN); +} + +static void +sysprof_window_record_capture_action (GtkWidget *widget, + const char *action_name, + GVariant *param) +{ + show_greeter (SYSPROF_WINDOW (widget), SYSPROF_GREETER_PAGE_RECORD); +} + static void sysprof_window_set_document (SysprofWindow *self, SysprofDocument *document) @@ -179,6 +193,7 @@ sysprof_window_class_init (SysprofWindowClass *klass) gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/sysprof-window.ui"); gtk_widget_class_install_action (widget_class, "win.open-capture", NULL, sysprof_window_open_capture_action); + gtk_widget_class_install_action (widget_class, "win.record-capture", NULL, sysprof_window_record_capture_action); g_type_ensure (SYSPROF_TYPE_DOCUMENT); g_type_ensure (SYSPROF_TYPE_FILES_SECTION); diff --git a/src/sysprof/sysprof-window.ui b/src/sysprof/sysprof-window.ui index 2f7ece09..d656adb9 100644 --- a/src/sysprof/sysprof-window.ui +++ b/src/sysprof/sysprof-window.ui @@ -8,6 +8,12 @@ 750 + + + <ctrl>n + action(win.record-capture) + + <ctrl>o @@ -158,19 +164,18 @@
+ + _Record Again… + win.record-capture + Open Recording… - win.open-capture + win.open-capture Save As…
-
- - Record Again… - -
Preferences @@ -193,11 +198,11 @@ Callgraph Hide System Libraries - win.callgraph.hide-system-libraries + win.callgraph.hide-system-libraries Include Threads - win.callgraph.include-threads + win.callgraph.include-threads