From b213f7bbe4d8c50cdb234b113f7cd5935de40727 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Sat, 18 May 2019 13:36:30 -0700 Subject: [PATCH] libsysprof-ui: setup environment editor --- src/libsysprof-ui/sysprof-environ-editor.c | 1 + .../sysprof-profiler-assistant.c | 14 ++-- .../ui/sysprof-environ-editor-row.ui | 65 ++++++++++++++----- .../ui/sysprof-profiler-assistant.ui | 3 +- 4 files changed, 60 insertions(+), 23 deletions(-) diff --git a/src/libsysprof-ui/sysprof-environ-editor.c b/src/libsysprof-ui/sysprof-environ-editor.c index a8538de1..8fe28828 100644 --- a/src/libsysprof-ui/sysprof-environ-editor.c +++ b/src/libsysprof-ui/sysprof-environ-editor.c @@ -68,6 +68,7 @@ sysprof_environ_editor_create_dummy_row (SysprofEnvironEditor *self) label = g_object_new (GTK_TYPE_LABEL, "label", _("New variable…"), + "margin", 6, "visible", TRUE, "xalign", 0.0f, NULL); diff --git a/src/libsysprof-ui/sysprof-profiler-assistant.c b/src/libsysprof-ui/sysprof-profiler-assistant.c index 5558b246..34ee3506 100644 --- a/src/libsysprof-ui/sysprof-profiler-assistant.c +++ b/src/libsysprof-ui/sysprof-profiler-assistant.c @@ -30,12 +30,13 @@ struct _SysprofProfilerAssistant { - GtkBin parent_instance; + GtkBin parent_instance; /* Template Objects */ - GtkEntry *command_line; - GtkRevealer *process_revealer; - GtkListBox *process_list_box; + GtkEntry *command_line; + GtkRevealer *process_revealer; + GtkListBox *process_list_box; + SysprofEnvironEditor *environ_editor; }; G_DEFINE_TYPE (SysprofProfilerAssistant, sysprof_profiler_assistant, GTK_TYPE_BIN) @@ -128,6 +129,7 @@ sysprof_profiler_assistant_class_init (SysprofProfilerAssistantClass *klass) gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/ui/sysprof-profiler-assistant.ui"); gtk_widget_class_bind_template_child (widget_class, SysprofProfilerAssistant, command_line); + gtk_widget_class_bind_template_child (widget_class, SysprofProfilerAssistant, environ_editor); gtk_widget_class_bind_template_child (widget_class, SysprofProfilerAssistant, process_list_box); gtk_widget_class_bind_template_child (widget_class, SysprofProfilerAssistant, process_revealer); @@ -137,6 +139,8 @@ sysprof_profiler_assistant_class_init (SysprofProfilerAssistantClass *klass) static void sysprof_profiler_assistant_init (SysprofProfilerAssistant *self) { + g_autoptr(SysprofEnviron) environ = sysprof_environ_new (); + gtk_widget_init_template (GTK_WIDGET (self)); g_signal_connect_object (self->command_line, @@ -156,4 +160,6 @@ sysprof_profiler_assistant_init (SysprofProfilerAssistant *self) G_CALLBACK (sysprof_profiler_assistant_notify_reveal_child_cb), self, G_CONNECT_SWAPPED); + + sysprof_environ_editor_set_environ (self->environ_editor, environ); } diff --git a/src/libsysprof-ui/ui/sysprof-environ-editor-row.ui b/src/libsysprof-ui/ui/sysprof-environ-editor-row.ui index 56b176a2..4467a44f 100644 --- a/src/libsysprof-ui/ui/sysprof-environ-editor-row.ui +++ b/src/libsysprof-ui/ui/sysprof-environ-editor-row.ui @@ -1,47 +1,78 @@ + + -