diff --git a/src/sysprof/sysprof-greeter.c b/src/sysprof/sysprof-greeter.c index 615b3466..18cedf49 100644 --- a/src/sysprof/sysprof-greeter.c +++ b/src/sysprof/sysprof-greeter.c @@ -29,29 +29,31 @@ #include "sysprof-entry-popover.h" #include "sysprof-greeter.h" #include "sysprof-recording-pad.h" +#include "sysprof-recording-template.h" G_DEFINE_AUTOPTR_CLEANUP_FUNC (SysprofCaptureWriter, sysprof_capture_writer_unref) struct _SysprofGreeter { - AdwWindow parent_instance; + AdwWindow parent_instance; - GFile *file; - GtkStringList *envvars; + GFile *file; + GtkStringList *envvars; - AdwViewStack *view_stack; - GtkListBox *sidebar_list_box; - AdwPreferencesPage *record_page; - GtkListBox *app_environment; - GtkSwitch *sample_native_stacks; - GtkSwitch *sample_javascript_stacks; - GtkSwitch *record_disk_usage; - GtkSwitch *record_network_usage; - GtkSwitch *record_compositor; - GtkSwitch *record_system_logs; - GtkSwitch *record_session_bus; - GtkSwitch *record_system_bus; - GtkSwitch *bundle_symbols; + AdwViewStack *view_stack; + GtkListBox *sidebar_list_box; + AdwPreferencesPage *record_page; + GtkListBox *app_environment; + GtkSwitch *sample_native_stacks; + GtkSwitch *sample_javascript_stacks; + GtkSwitch *record_disk_usage; + GtkSwitch *record_network_usage; + GtkSwitch *record_compositor; + GtkSwitch *record_system_logs; + GtkSwitch *record_session_bus; + GtkSwitch *record_system_bus; + GtkSwitch *bundle_symbols; + SysprofRecordingTemplate *recording_template; }; enum { @@ -590,6 +592,7 @@ sysprof_greeter_class_init (SysprofGreeterClass *klass) gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, app_environment); gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, bundle_symbols); + gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, envvars); gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, record_compositor); gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, record_disk_usage); gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, record_network_usage); @@ -597,8 +600,9 @@ sysprof_greeter_class_init (SysprofGreeterClass *klass) gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, record_session_bus); gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, record_system_bus); gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, record_system_logs); - gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, sample_native_stacks); + gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, recording_template); gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, sample_javascript_stacks); + gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, sample_native_stacks); gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, sidebar_list_box); gtk_widget_class_bind_template_child (widget_class, SysprofGreeter, view_stack); @@ -612,6 +616,7 @@ sysprof_greeter_class_init (SysprofGreeterClass *klass) gtk_widget_class_install_action (widget_class, "win.select-file", NULL, sysprof_greeter_select_file_action); g_type_ensure (SYSPROF_TYPE_ENTRY_POPOVER); + g_type_ensure (SYSPROF_TYPE_RECORDING_TEMPLATE); } static void @@ -619,14 +624,14 @@ sysprof_greeter_init (SysprofGreeter *self) { GtkListBoxRow *row; - self->envvars = gtk_string_list_new (NULL); + gtk_widget_init_template (GTK_WIDGET (self)); + g_signal_connect_object (self->envvars, "items-changed", G_CALLBACK (on_env_items_changed_cb), self, G_CONNECT_SWAPPED); - - gtk_widget_init_template (GTK_WIDGET (self)); + on_env_items_changed_cb (self, 0, 0, 0, G_LIST_MODEL (self->envvars)); gtk_list_box_bind_model (self->sidebar_list_box, G_LIST_MODEL (adw_view_stack_get_pages (self->view_stack)), diff --git a/src/sysprof/sysprof-greeter.ui b/src/sysprof/sysprof-greeter.ui index 8de03437..e8203574 100644 --- a/src/sysprof/sysprof-greeter.ui +++ b/src/sysprof/sysprof-greeter.ui @@ -87,8 +87,8 @@ Record native stack traces using a sampling profiler - true center + @@ -105,6 +105,7 @@ center + @@ -133,6 +134,7 @@ center + @@ -166,6 +168,7 @@ Command Line + @@ -191,8 +194,8 @@ Clear the environment before launching application - false center + @@ -251,8 +254,8 @@ Record coarse-grained counters about CPU usage and frequency - true center + @@ -264,8 +267,8 @@ Record coarse-grained counters about system memory usage - true center + @@ -277,7 +280,7 @@ Record coarse-grained counters about storage throughput - true + center @@ -290,7 +293,7 @@ Record coarse-grained counters about network traffic - true + center @@ -307,7 +310,7 @@ Record coarse-grained counters about energy usage in Watts - true + center @@ -320,7 +323,7 @@ Record coarse-grained counters about battery charge or discharge rates - true + center @@ -348,6 +351,7 @@ Record messages on the D-Bus system bus + center @@ -364,6 +368,7 @@ Record messages on the D-Bus user session bus + center @@ -402,7 +407,7 @@ Record frame-timing information from the GNOME Shell compositor - true + center @@ -479,7 +484,7 @@ Watch the system log for new messages and record them - true + center @@ -497,7 +502,7 @@ Make recording shareable by symbolizing stack traces after recording - true + center @@ -535,4 +540,8 @@ + + + + diff --git a/src/sysprof/sysprof-recording-template.c b/src/sysprof/sysprof-recording-template.c index 20971099..ff240a0c 100644 --- a/src/sysprof/sysprof-recording-template.c +++ b/src/sysprof/sysprof-recording-template.c @@ -147,6 +147,10 @@ sysprof_recording_template_get_property (GObject *object, g_value_set_boolean (value, self->memory_allocations); break; + case PROP_MEMORY_USAGE: + g_value_set_boolean (value, self->memory_usage); + break; + case PROP_NATIVE_STACKS: g_value_set_boolean (value, self->native_stacks); break; @@ -235,6 +239,10 @@ sysprof_recording_template_set_property (GObject *object, self->memory_allocations = g_value_get_boolean (value); break; + case PROP_MEMORY_USAGE: + self->memory_usage = g_value_get_boolean (value); + break; + case PROP_NATIVE_STACKS: self->native_stacks = g_value_get_boolean (value); break; @@ -382,6 +390,7 @@ sysprof_recording_template_init (SysprofRecordingTemplate *self) self->native_stacks = TRUE; self->network_usage = TRUE; self->system_log = TRUE; + self->command_line = g_strdup (""); } SysprofRecordingTemplate *