From 9bba24e71908f619d2d867c6e5d2726199bb75de Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 15 Dec 2023 10:00:27 +0600 Subject: [PATCH 1/6] Compression field sensitivity fix --- source/ubl-settings-logging.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/ubl-settings-logging.c b/source/ubl-settings-logging.c index 6ec2246..ac6fdfa 100644 --- a/source/ubl-settings-logging.c +++ b/source/ubl-settings-logging.c @@ -2209,6 +2209,7 @@ journald_window *yon_journald_open(GtkWidget *self, main_window *widgets){ g_signal_connect(G_OBJECT(window->LogFreeSpaceCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->LogFreeSpaceSpin); g_signal_connect(G_OBJECT(window->LogFreeSpaceCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->LogFreeSpaceCombo); + g_signal_connect(G_OBJECT(window->LogCompressionCombo),"changed",G_CALLBACK(yon_combo_compress_check),window); g_signal_connect(G_OBJECT(window->RedirectCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box_inversed),window->RedirectTTYEntry); int size=0; config_str settings = yon_config_get_all_by_key("JOURNALD",&size); @@ -2264,7 +2265,6 @@ journald_window *yon_journald_open(GtkWidget *self, main_window *widgets){ } } - g_signal_connect(G_OBJECT(window->LogCompressionCombo),"changed",G_CALLBACK(yon_combo_compress_check),window); return window; } @@ -2867,8 +2867,6 @@ void config_init(){ main_config.lock_load_global=0; main_config.lock_save_global=0; main_config.lock_save_local=0; - main_config.logrotate_list = gtk_list_store_new(3,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING); - main_config.logrotate_apps_list = gtk_list_store_new(3,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING); main_config.remove_thread=-1; main_config.load_mode=1; @@ -3176,6 +3174,8 @@ int main(int argc, char *argv[], char **envp){ } gtk_init(&argc,&argv); + main_config.logrotate_list = gtk_list_store_new(3,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING); + main_config.logrotate_apps_list = gtk_list_store_new(3,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING); main_window *widgets = setup_window(); yon_ubl_header_setup_resource(widgets->HeadOverlay,widgets->HeadBox,widgets->HeadImage,banner_path); From 9e0e99c34227b98c09d4b8e966e86aae265682c3 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 15 Dec 2023 10:02:15 +0600 Subject: [PATCH 2/6] Fixed journald window crash --- source/ubl-settings-logging.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ubl-settings-logging.c b/source/ubl-settings-logging.c index ac6fdfa..d1210bd 100644 --- a/source/ubl-settings-logging.c +++ b/source/ubl-settings-logging.c @@ -2133,7 +2133,7 @@ void on_journald_save(GtkWidget *self, journald_window *window){ yon_config_register(JOURNALD("TTYPath"),"logging",TTY); } else { yon_config_remove_by_key(JOURNALD("ForwardToConsole")); - yon_config_register(JOURNALD("TTYPath"),"logging",TTY); + yon_config_remove_by_key(JOURNALD("TTYPath")); } if (forwardempty!=0) yon_config_register(JOURNALD("MaxLevelConsole"),"logging",yon_char_from_int(forwardempty-1)); From 7e1b80e7dd02833123e9c8de9773350aa0887b3c Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 15 Dec 2023 10:40:56 +0600 Subject: [PATCH 3/6] Fixed saving status messages --- source/ubl-settings-logging.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/ubl-settings-logging.c b/source/ubl-settings-logging.c index d1210bd..91ce2f5 100644 --- a/source/ubl-settings-logging.c +++ b/source/ubl-settings-logging.c @@ -80,6 +80,12 @@ void on_save_parameters(GtkWidget *self, saving_window *window){ free(final_command); } } + if (window->type == YON_CONFIG_GLOBAL) + yon_ubl_status_box_render(GLOBAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); + else if (window->type == YON_CONFIG_LOCAL) + yon_ubl_status_box_render(LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); + else if (window->type == YON_CONFIG_BOTH) + yon_ubl_status_box_render(GLOBAL_LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); on_close_subwindow(self,"SavingWindow"); } @@ -422,19 +428,16 @@ void on_load_local(){ void on_save_global_local(){ yon_save_proceed(NULL,YON_CONFIG_BOTH,"logging", "JOURNALD[*] LOGROTATE[*]",NULL); - yon_ubl_status_box_render(GLOBAL_LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); } void on_save_global(){ yon_save_proceed("global",YON_CONFIG_GLOBAL,"logging", "JOURNALD[*] LOGROTATE[*]",NULL); - yon_ubl_status_box_render(LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); } void on_save_local(){ yon_save_proceed("system",YON_CONFIG_LOCAL,"logging", "JOURNALD[*] LOGROTATE[*]",NULL); - yon_ubl_status_box_render(GLOBAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); } From bac507aa2aed3f27a32c9a2975b2c0cada6d9edf Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 15 Dec 2023 10:45:32 +0600 Subject: [PATCH 4/6] Localisation updates --- source/ubl-strings.h | 5 ++++- ubl-settings-logging.pot | 12 ++++++++++++ ubl-settings-logging_ru.po | 14 +++++++++++++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 60c6e7b..1b5610a 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -219,4 +219,7 @@ #define VALUE_LABEL _("Value:") //ubl-settings-logging-terminal.glade -#define PATH_NOT_FOUND_LABEL _(": no such file(s)") \ No newline at end of file +#define PATH_NOT_FOUND_LABEL _(": no such file(s)") +#define PARAMETER_LABEL _("Parameter") +#define OLD_VALUE_LABEL _("Old value") +#define NEW_VALUE_LABEL _("New value") \ No newline at end of file diff --git a/ubl-settings-logging.pot b/ubl-settings-logging.pot index 173a020..f28a73b 100644 --- a/ubl-settings-logging.pot +++ b/ubl-settings-logging.pot @@ -834,3 +834,15 @@ msgstr "" #: source/ubl-strings.h:222 msgid ": no such file(s)" msgstr "" + +#: source/ubl-strings.h:223 +msgid "Parameter" +msgstr "" + +#: source/ubl-strings.h:224 +msgid "Old value" +msgstr "" + +#: source/ubl-strings.h:225 +msgid "New value" +msgstr "" diff --git a/ubl-settings-logging_ru.po b/ubl-settings-logging_ru.po index b26e531..00946f7 100644 --- a/ubl-settings-logging_ru.po +++ b/ubl-settings-logging_ru.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ubl-settings-logging 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-11 17:41+0600\n" +"POT-Creation-Date: 2023-05-22 16:12+0600\n" "PO-Revision-Date: 2023-01-01 00:00+0600\n" "Last-Translator: UBLinux Team \n" "Language-Team: Russian - UBLinux Team \n" @@ -850,6 +850,18 @@ msgstr "Значение:" msgid ": no such file(s)" msgstr ": файл(ы) не найден(ы)" +#: source/ubl-strings.h:223 +msgid "Parameter" +msgstr "Параметр" + +#: source/ubl-strings.h:224 +msgid "Old value" +msgstr "Старое значение" + +#: source/ubl-strings.h:225 +msgid "New value" +msgstr "Новое значение" + msgid "System event log rotation service" msgstr "Служба ротации системных журналов событий" From 2017f62240446667e1845870bf645dfa9c2b9541 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 15 Dec 2023 11:08:11 +0600 Subject: [PATCH 5/6] Status messages for same config saving --- source/ubl-settings-logging.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/ubl-settings-logging.c b/source/ubl-settings-logging.c index 91ce2f5..a60d1e9 100644 --- a/source/ubl-settings-logging.c +++ b/source/ubl-settings-logging.c @@ -92,6 +92,12 @@ void on_save_parameters(GtkWidget *self, saving_window *window){ saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){ if (((type==YON_CONFIG_LOCAL&& main_config.load_mode==1)||(type==YON_CONFIG_GLOBAL&& main_config.load_mode==0))){ yon_config_save_registered(path); + if (type == YON_CONFIG_GLOBAL) + yon_ubl_status_box_render(GLOBAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); + else if (type == YON_CONFIG_LOCAL) + yon_ubl_status_box_render(LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); + else if (type == YON_CONFIG_BOTH) + yon_ubl_status_box_render(GLOBAL_LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); return NULL; } else { char *config_to_save = NULL; From 64c6b5dfbbc4eb566dc893833fb1753c08955d4d Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 15 Dec 2023 11:27:29 +0600 Subject: [PATCH 6/6] Added position and size saving for saving window --- source/ubl-settings-logging.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/ubl-settings-logging.c b/source/ubl-settings-logging.c index a60d1e9..a1f9451 100644 --- a/source/ubl-settings-logging.c +++ b/source/ubl-settings-logging.c @@ -86,6 +86,8 @@ void on_save_parameters(GtkWidget *self, saving_window *window){ yon_ubl_status_box_render(LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); else if (window->type == YON_CONFIG_BOTH) yon_ubl_status_box_render(GLOBAL_LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); + + yon_window_config_custom_window_set(GTK_WINDOW(window->Window),"SaveWindow"); on_close_subwindow(self,"SavingWindow"); } @@ -163,6 +165,8 @@ saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){ window->ToggleCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"ToggleCell")); window->list = GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore1")); window->type=type; + yon_window_config_custom_window_setup(GTK_WINDOW(window->Window),"SaveWindow"); + yon_window_config_custom_window_get(GTK_WINDOW(window->Window),"SaveWindow"); gtk_window_set_title(GTK_WINDOW(window->Window),TITLE_LABEL); g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_close_subwindow),NULL); g_signal_connect(G_OBJECT(window->SaveButton),"clicked", G_CALLBACK(on_save_parameters),window);