diff --git a/source/ubl-settings-resourcequota.c b/source/ubl-settings-resourcequota.c index 2024274..ccf6176 100644 --- a/source/ubl-settings-resourcequota.c +++ b/source/ubl-settings-resourcequota.c @@ -130,8 +130,11 @@ main_window *setup_window(){ widgets->tvc6 = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(builder,"tvc6")); widgets->tvc7 = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(builder,"tvc7")); - + widgets->btnMainShowAllEmpty = yon_gtk_builder_get_widget(builder,"btnMainShowAllEmpty"); + widgets->btnMainShowCoreStream = yon_gtk_builder_get_widget(builder,"btnMainShowCoreStream"); + widgets->vteDispatcher = yon_gtk_builder_get_widget(builder,"vteDispatcher"); + widgets->vteProcesses = yon_gtk_builder_get_widget(builder,"vteProcesses"); widgets->spinUpdateDispatcher = yon_gtk_builder_get_widget(builder,"spinUpdateDispatcher"); widgets->btnUpdateDispatcher = yon_gtk_builder_get_widget(builder,"btnUpdateDispatcher"); widgets->btnSaveCfg = yon_gtk_builder_get_widget(builder,"btnSaveCfg"); @@ -195,7 +198,25 @@ void main_update_dispatcher() { yon_terminal_integrated_launch(widgets->vteDispatcher, cmd, NULL, NULL); free(str_second); free(cmd); - +} + +void main_update_processes() { + char* cmd = NULL; + gboolean active_all_empty = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->btnMainShowAllEmpty)); + gboolean active_core_stream = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->btnMainShowCoreStream)); + if (active_core_stream == 1) { + cmd = "systemd-cgls --no-page --all"; + } + else if (active_all_empty == 1) { + cmd = "systemd-cgls --no-page -k"; + } + else if (active_all_empty == 1 && active_core_stream == 1) { + cmd = "systemd-cgls --no-page --all -k"; + } + else { + cmd = "systemd-cgls --no-page"; + } + yon_terminal_integrated_launch(widgets->vteProcesses, cmd, NULL, NULL); } void main_visible_columns(GtkWidget *self) { @@ -230,6 +251,9 @@ void main_event(main_window *widgets) { g_signal_connect(G_OBJECT(widgets->btnEdit),"clicked",G_CALLBACK(edit_show), glade_path); g_signal_connect(G_OBJECT(widgets->btnInfo),"clicked",G_CALLBACK(info_show), glade_path); g_signal_connect(G_OBJECT(widgets->btnUpdateDispatcher),"clicked",G_CALLBACK(main_update_dispatcher), NULL); + g_signal_connect(G_OBJECT(widgets->btnMainShowAllEmpty), "toggled", G_CALLBACK(main_update_processes), NULL); + g_signal_connect(G_OBJECT(widgets->btnMainShowCoreStream), "toggled", G_CALLBACK(main_update_processes), NULL); + /* g_signal_connect(G_OBJECT(widgets->LoadGlobalMenuItem),"activate",G_CALLBACK(),NULL); g_signal_connect(G_OBJECT(widgets->LoadLocalMenuItem),"activate",G_CALLBACK(),NULL); diff --git a/source/ubl-settings-resourcequota.h b/source/ubl-settings-resourcequota.h index 9ba1ecd..25b9a3d 100644 --- a/source/ubl-settings-resourcequota.h +++ b/source/ubl-settings-resourcequota.h @@ -65,6 +65,9 @@ typedef struct { GtkTreeViewColumn *tvc6; GtkTreeViewColumn *tvc7; + GtkWidget *vteProcesses; + GtkWidget *btnMainShowCoreStream; + GtkWidget *btnMainShowAllEmpty; GtkWidget *vteDispatcher; GtkWidget *spinUpdateDispatcher; GtkWidget *btnUpdateDispatcher; @@ -118,10 +121,10 @@ typedef struct { main_window *setup_window(); +void main_update_processes(); void config_init(); -void event_all(); -void main_event(main_window *widgets); void event_all(main_window *widgets); +void main_event(main_window *widgets); void info_show(GtkWidget *self); void main_localization(main_window *widgets); void main_visible_columns(); diff --git a/ubl-settings-resourcequota.glade b/ubl-settings-resourcequota.glade index ef384da..a6834bc 100644 --- a/ubl-settings-resourcequota.glade +++ b/ubl-settings-resourcequota.glade @@ -179,6 +179,16 @@ 1 10 + + 100 + 1 + 10 + + + 100 + 1 + 10 + True False @@ -1137,6 +1147,7 @@ limit True False + reload @@ -1154,27 +1165,39 @@ limit - + True - True - in + False - + + True + False + True + natural + adjustment3 + natural + UTF-8 + True + False + + + True + True + 0 + + + + True False - - - True - False - True - natural - natural - UTF-8 - True - False - - + vertical + adjustment3 + + False + True + 1 + @@ -1209,7 +1232,7 @@ limit True False - + All groups including empty True True @@ -1229,7 +1252,7 @@ limit - + Core streams True True @@ -1256,27 +1279,39 @@ limit - + True - True - in + False - + + True + False + True + natural + adjustment2 + natural + UTF-8 + True + False + + + True + True + 0 + + + + True False - - - True - False - True - natural - natural - UTF-8 - True - False - - + vertical + adjustment2 + + False + True + 1 + @@ -1370,27 +1405,39 @@ limit - + True - True - in + False - + + True + False + True + natural + adjustment3 + natural + UTF-8 + True + False + + + True + True + 0 + + + + True False - - - True - False - True - natural - natural - UTF-8 - True - False - - + vertical + adjustment3 + + False + True + 1 +