mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
libsysprof-ui: setup environment editor
This commit is contained in:
@ -68,6 +68,7 @@ sysprof_environ_editor_create_dummy_row (SysprofEnvironEditor *self)
|
|||||||
|
|
||||||
label = g_object_new (GTK_TYPE_LABEL,
|
label = g_object_new (GTK_TYPE_LABEL,
|
||||||
"label", _("New variable…"),
|
"label", _("New variable…"),
|
||||||
|
"margin", 6,
|
||||||
"visible", TRUE,
|
"visible", TRUE,
|
||||||
"xalign", 0.0f,
|
"xalign", 0.0f,
|
||||||
NULL);
|
NULL);
|
||||||
|
|||||||
@ -30,12 +30,13 @@
|
|||||||
|
|
||||||
struct _SysprofProfilerAssistant
|
struct _SysprofProfilerAssistant
|
||||||
{
|
{
|
||||||
GtkBin parent_instance;
|
GtkBin parent_instance;
|
||||||
|
|
||||||
/* Template Objects */
|
/* Template Objects */
|
||||||
GtkEntry *command_line;
|
GtkEntry *command_line;
|
||||||
GtkRevealer *process_revealer;
|
GtkRevealer *process_revealer;
|
||||||
GtkListBox *process_list_box;
|
GtkListBox *process_list_box;
|
||||||
|
SysprofEnvironEditor *environ_editor;
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE (SysprofProfilerAssistant, sysprof_profiler_assistant, GTK_TYPE_BIN)
|
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_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, 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_list_box);
|
||||||
gtk_widget_class_bind_template_child (widget_class, SysprofProfilerAssistant, process_revealer);
|
gtk_widget_class_bind_template_child (widget_class, SysprofProfilerAssistant, process_revealer);
|
||||||
|
|
||||||
@ -137,6 +139,8 @@ sysprof_profiler_assistant_class_init (SysprofProfilerAssistantClass *klass)
|
|||||||
static void
|
static void
|
||||||
sysprof_profiler_assistant_init (SysprofProfilerAssistant *self)
|
sysprof_profiler_assistant_init (SysprofProfilerAssistant *self)
|
||||||
{
|
{
|
||||||
|
g_autoptr(SysprofEnviron) environ = sysprof_environ_new ();
|
||||||
|
|
||||||
gtk_widget_init_template (GTK_WIDGET (self));
|
gtk_widget_init_template (GTK_WIDGET (self));
|
||||||
|
|
||||||
g_signal_connect_object (self->command_line,
|
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),
|
G_CALLBACK (sysprof_profiler_assistant_notify_reveal_child_cb),
|
||||||
self,
|
self,
|
||||||
G_CONNECT_SWAPPED);
|
G_CONNECT_SWAPPED);
|
||||||
|
|
||||||
|
sysprof_environ_editor_set_environ (self->environ_editor, environ);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,47 +1,78 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Generated with glade 3.22.0 -->
|
||||||
<interface>
|
<interface>
|
||||||
<template class="IdeEnvironmentEditorRow" parent="GtkListBoxRow">
|
<requires lib="gtk+" version="3.10"/>
|
||||||
|
<template class="SysprofEnvironEditorRow" parent="GtkListBoxRow">
|
||||||
|
<property name="can_focus">False</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="GtkBox">
|
||||||
<property name="orientation">horizontal</property>
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
<property name="spacing">12</property>
|
<property name="spacing">12</property>
|
||||||
<property name="visible">true</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkEntry" id="key_entry">
|
<object class="GtkEntry" id="key_entry">
|
||||||
<property name="has-frame">false</property>
|
<property name="visible">True</property>
|
||||||
<property name="visible">true</property>
|
<property name="can_focus">True</property>
|
||||||
|
<property name="margin_start">3</property>
|
||||||
|
<property name="has_frame">False</property>
|
||||||
</object>
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="eq_label">
|
<object class="GtkLabel" id="eq_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
<property name="label">=</property>
|
<property name="label">=</property>
|
||||||
<property name="visible">true</property>
|
|
||||||
<style>
|
<style>
|
||||||
<class name="dim-label"/>
|
<class name="dim-label"/>
|
||||||
</style>
|
</style>
|
||||||
</object>
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkEntry" id="value_entry">
|
<object class="GtkEntry" id="value_entry">
|
||||||
<property name="hexpand">true</property>
|
<property name="visible">True</property>
|
||||||
<property name="has-frame">false</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="visible">true</property>
|
<property name="hexpand">True</property>
|
||||||
|
<property name="has_frame">False</property>
|
||||||
</object>
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="delete_button">
|
<object class="GtkButton" id="delete_button">
|
||||||
<property name="visible">true</property>
|
<property name="visible">True</property>
|
||||||
<property name="tooltip-text" translatable="yes">Remove environment variable</property>
|
<property name="can_focus">False</property>
|
||||||
|
<property name="receives_default">False</property>
|
||||||
|
<property name="tooltip_text" translatable="yes">Remove environment variable</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="icon_name">list-remove-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
<style>
|
<style>
|
||||||
<class name="image-button"/>
|
<class name="image-button"/>
|
||||||
<class name="flat"/>
|
<class name="flat"/>
|
||||||
</style>
|
</style>
|
||||||
<child>
|
|
||||||
<object class="GtkImage">
|
|
||||||
<property name="icon-name">list-remove-symbolic</property>
|
|
||||||
<property name="visible">true</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">3</property>
|
||||||
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|||||||
@ -205,9 +205,8 @@
|
|||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkScrolledWindow">
|
<object class="GtkFrame">
|
||||||
<property name="shadow-type">in</property>
|
<property name="shadow-type">in</property>
|
||||||
<property name="propagate-natural-height">true</property>
|
|
||||||
<property name="visible">true</property>
|
<property name="visible">true</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="SysprofEnvironEditor" id="environ_editor">
|
<object class="SysprofEnvironEditor" id="environ_editor">
|
||||||
|
|||||||
Reference in New Issue
Block a user