From 567b7d2241a8d31f01f189c36ec5bbe58a17c152 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 2 Nov 2023 16:06:06 +0600 Subject: [PATCH] Groups lists are imprelented at logrotate window --- source/ubl-settings-logging.c | 10 ++++++++++ source/ubl-settings-logging.h | 6 ++++++ ubl-settings-logging-journald.glade | 1 + 3 files changed, 17 insertions(+) diff --git a/source/ubl-settings-logging.c b/source/ubl-settings-logging.c index eb6d19f..a144697 100644 --- a/source/ubl-settings-logging.c +++ b/source/ubl-settings-logging.c @@ -962,6 +962,11 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind yon_gtk_combo_box_fill(window->CreateLogUserCombo,users,usize); yon_gtk_combo_box_fill(window->RotationAtUserCombo,users,usize); + for (int i=0;iRotationAtGroupCombo),main_config.groups[i]); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(window->CreateGroupCombo),main_config.groups[i]); + } + if (paths){ int size; GtkTreeIter iter; @@ -1993,6 +1998,11 @@ main_window *setup_window(){ yon_window_config_add_listener(g_list_nth_data(list,i),yon_char_append("servicecolumn",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT); // yon_gtk_column_minimal_fixed_size_set((GtkTreeViewColumn*)g_list_nth_data(list,i)); } + + main_config.groups = yon_file_open(group_list_path,&main_config.groups_size); + for (int i=0;iHeadInfoLabel,"head-text","label",YON_TYPE_STRING); diff --git a/source/ubl-settings-logging.h b/source/ubl-settings-logging.h index 47d6096..cb08dd8 100644 --- a/source/ubl-settings-logging.h +++ b/source/ubl-settings-logging.h @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include "../compile/ubl-cmake.h" #ifdef WEBKIT_FOUND #include @@ -53,6 +55,8 @@ #define get_journal_all_units_command "clear;systemd-analyze blame --no-pager" #define get_journal_init_tree_command "clear;systemd-analyze critical-chain" +#define group_list_path "/etc/group" + #define start_icon_name "com.ublinux.ubl-settings-logging.play-symbolic" #define stop_icon_name "com.ublinux.ubl-settings-logging.stop-symbolic" #define enable_icon_name "com.ublinux.ubl-settings-logging.check-symbolic" @@ -84,6 +88,8 @@ typedef struct { GtkListStore *logrotate_list; GtkListStore *logrotate_apps_list; + config_str groups; + int groups_size; } config; typedef struct { diff --git a/ubl-settings-logging-journald.glade b/ubl-settings-logging-journald.glade index de96c25..589b71a 100644 --- a/ubl-settings-logging-journald.glade +++ b/ubl-settings-logging-journald.glade @@ -83,6 +83,7 @@ 800 600 False + True True