Merge pull request 'master' (#89) from YanTheKaller/ubl-settings-logging:master into master

Reviewed-on: #89
pull/139/head v2.2
Dmitry Razumov 2 years ago
commit 982c46c128

@ -80,12 +80,26 @@ void on_save_parameters(GtkWidget *self, saving_window *window){
free(final_command); 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);
yon_window_config_custom_window_set(GTK_WINDOW(window->Window),"SaveWindow");
on_close_subwindow(self,"SavingWindow"); on_close_subwindow(self,"SavingWindow");
} }
saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){ 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))){ if (((type==YON_CONFIG_LOCAL&& main_config.load_mode==1)||(type==YON_CONFIG_GLOBAL&& main_config.load_mode==0))){
yon_config_save_registered(path); 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; return NULL;
} else { } else {
char *config_to_save = NULL; char *config_to_save = NULL;
@ -151,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->ToggleCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"ToggleCell"));
window->list = GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore1")); window->list = GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore1"));
window->type=type; 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); 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->CancelButton),"clicked",G_CALLBACK(on_close_subwindow),NULL);
g_signal_connect(G_OBJECT(window->SaveButton),"clicked", G_CALLBACK(on_save_parameters),window); g_signal_connect(G_OBJECT(window->SaveButton),"clicked", G_CALLBACK(on_save_parameters),window);
@ -422,19 +438,16 @@ void on_load_local(){
void on_save_global_local(){ void on_save_global_local(){
yon_save_proceed(NULL,YON_CONFIG_BOTH,"logging", "JOURNALD[*] LOGROTATE[*]",NULL); 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(){ void on_save_global(){
yon_save_proceed("global",YON_CONFIG_GLOBAL,"logging", "JOURNALD[*] LOGROTATE[*]",NULL); 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(){ void on_save_local(){
yon_save_proceed("system",YON_CONFIG_LOCAL,"logging", "JOURNALD[*] LOGROTATE[*]",NULL); yon_save_proceed("system",YON_CONFIG_LOCAL,"logging", "JOURNALD[*] LOGROTATE[*]",NULL);
yon_ubl_status_box_render(GLOBAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
} }
@ -2133,7 +2146,7 @@ void on_journald_save(GtkWidget *self, journald_window *window){
yon_config_register(JOURNALD("TTYPath"),"logging",TTY); yon_config_register(JOURNALD("TTYPath"),"logging",TTY);
} else { } else {
yon_config_remove_by_key(JOURNALD("ForwardToConsole")); yon_config_remove_by_key(JOURNALD("ForwardToConsole"));
yon_config_register(JOURNALD("TTYPath"),"logging",TTY); yon_config_remove_by_key(JOURNALD("TTYPath"));
} }
if (forwardempty!=0) if (forwardempty!=0)
yon_config_register(JOURNALD("MaxLevelConsole"),"logging",yon_char_from_int(forwardempty-1)); yon_config_register(JOURNALD("MaxLevelConsole"),"logging",yon_char_from_int(forwardempty-1));
@ -2209,6 +2222,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->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->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); g_signal_connect(G_OBJECT(window->RedirectCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box_inversed),window->RedirectTTYEntry);
int size=0; int size=0;
config_str settings = yon_config_get_all_by_key("JOURNALD",&size); config_str settings = yon_config_get_all_by_key("JOURNALD",&size);
@ -2264,7 +2278,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; return window;
} }
@ -2867,8 +2880,6 @@ void config_init(){
main_config.lock_load_global=0; main_config.lock_load_global=0;
main_config.lock_save_global=0; main_config.lock_save_global=0;
main_config.lock_save_local=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.remove_thread=-1;
main_config.load_mode=1; main_config.load_mode=1;
@ -3176,6 +3187,8 @@ int main(int argc, char *argv[], char **envp){
} }
gtk_init(&argc,&argv); 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(); main_window *widgets = setup_window();
yon_ubl_header_setup_resource(widgets->HeadOverlay,widgets->HeadBox,widgets->HeadImage,banner_path); yon_ubl_header_setup_resource(widgets->HeadOverlay,widgets->HeadBox,widgets->HeadImage,banner_path);

@ -219,4 +219,7 @@
#define VALUE_LABEL _("Value:") #define VALUE_LABEL _("Value:")
//ubl-settings-logging-terminal.glade //ubl-settings-logging-terminal.glade
#define PATH_NOT_FOUND_LABEL _(": no such file(s)") #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")

@ -834,3 +834,15 @@ msgstr ""
#: source/ubl-strings.h:222 #: source/ubl-strings.h:222
msgid ": no such file(s)" msgid ": no such file(s)"
msgstr "" 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 ""

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: ubl-settings-logging 1.0\n" "Project-Id-Version: ubl-settings-logging 1.0\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: 2023-01-01 00:00+0600\n"
"Last-Translator: UBLinux Team <info@ublinux.com>\n" "Last-Translator: UBLinux Team <info@ublinux.com>\n"
"Language-Team: Russian - UBLinux Team <info@ublinux.com>\n" "Language-Team: Russian - UBLinux Team <info@ublinux.com>\n"
@ -850,6 +850,18 @@ msgstr "Значение:"
msgid ": no such file(s)" msgid ": no such file(s)"
msgstr ": файл(ы) не найден(ы)" 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" msgid "System event log rotation service"
msgstr "Служба ротации системных журналов событий" msgstr "Служба ротации системных журналов событий"

Loading…
Cancel
Save