Added the process tree to the settings.
This commit is contained in:
committed by
Peter de Ridder
parent
2a81817868
commit
dbd10ae655
@@ -86,6 +86,7 @@ xtm_process_tree_view_init (XtmProcessTreeView *treeview)
|
||||
GtkCellRenderer *cell_text, *cell_right_aligned;
|
||||
GtkTreeViewColumn *column;
|
||||
gboolean visible;
|
||||
gboolean tree;
|
||||
|
||||
treeview->settings = xtm_settings_get_default ();
|
||||
g_signal_connect (treeview->settings, "notify", G_CALLBACK (settings_changed), treeview);
|
||||
@@ -94,7 +95,7 @@ xtm_process_tree_view_init (XtmProcessTreeView *treeview)
|
||||
gchar *uid_name;
|
||||
get_owner_uid (&treeview->owner_uid, &uid_name);
|
||||
g_free (uid_name);
|
||||
g_object_get (treeview->settings, "show-all-processes", &treeview->show_all_processes_cached, NULL);
|
||||
g_object_get (treeview->settings, "show-all-processes", &treeview->show_all_processes_cached, "process-tree", &tree, NULL);
|
||||
}
|
||||
|
||||
/* Create tree view model */
|
||||
@@ -111,7 +112,7 @@ xtm_process_tree_view_init (XtmProcessTreeView *treeview)
|
||||
|
||||
treeview->model_tree = xtm_process_tree_model_new (GTK_TREE_MODEL (treeview->model_filter));
|
||||
|
||||
g_object_set (treeview, "search-column", XTM_PTV_COLUMN_COMMAND, "model", treeview->model_tree, NULL);
|
||||
g_object_set (treeview, "search-column", XTM_PTV_COLUMN_COMMAND, "model", tree ? treeview->model_tree : treeview->model_filter, NULL);
|
||||
|
||||
treeview->cmd_filter = NULL;
|
||||
|
||||
@@ -701,6 +702,12 @@ settings_changed (GObject *object, GParamSpec *pspec, XtmProcessTreeView *treevi
|
||||
g_object_get (object, pspec->name, &treeview->show_all_processes_cached, NULL);
|
||||
gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (treeview->model_filter));
|
||||
}
|
||||
else if (!g_strcmp0 (pspec->name, "process-tree"))
|
||||
{
|
||||
gboolean tree;
|
||||
g_object_get (object, pspec->name, &tree, NULL);
|
||||
gtk_tree_view_set_model (GTK_TREE_VIEW (treeview), tree ? treeview->model_tree : treeview->model_filter);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -108,6 +108,7 @@ xtm_settings_dialog_init (XtmSettingsDialog *dialog)
|
||||
builder_bind_toggle_button (builder, "button-monitor-paint-box", dialog->settings, "monitor-paint-box");
|
||||
builder_bind_toggle_button (builder, "button-prompt-terminate-task", dialog->settings, "prompt-terminate-task");
|
||||
builder_bind_toggle_button (builder, "button-show-status-icon", dialog->settings, "show-status-icon");
|
||||
builder_bind_toggle_button (builder, "button-process-tree", dialog->settings, "process-tree");
|
||||
|
||||
{
|
||||
guint n;
|
||||
|
||||
@@ -100,6 +100,20 @@
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="button-process-tree">
|
||||
<property name="label" translatable="yes">Show processes as tree</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox-toolbar-style">
|
||||
<property name="visible">True</property>
|
||||
@@ -122,7 +136,7 @@
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">4</property>
|
||||
<property name="position">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
@@ -54,6 +54,7 @@ enum
|
||||
PROP_SORT_TYPE,
|
||||
PROP_WINDOW_WIDTH,
|
||||
PROP_WINDOW_HEIGHT,
|
||||
PROP_PROCESS_TREE,
|
||||
N_PROPS,
|
||||
};
|
||||
typedef struct _XtmSettingsClass XtmSettingsClass;
|
||||
@@ -129,6 +130,8 @@ xtm_settings_class_init (XtmSettingsClass *klass)
|
||||
g_param_spec_int ("window-width", "WindowWidth", "Window width", -1, G_MAXINT, -1, G_PARAM_READWRITE));
|
||||
g_object_class_install_property (class, PROP_WINDOW_HEIGHT,
|
||||
g_param_spec_int ("window-height", "WindowHeight", "Window height", -1, G_MAXINT, -1, G_PARAM_READWRITE));
|
||||
g_object_class_install_property (class, PROP_PROCESS_TREE,
|
||||
g_param_spec_boolean ("process-tree", "ProcessTreeView", "Process tree", FALSE, G_PARAM_READWRITE));
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user