From bc93d82ec7033882ec042bf503d4773f63433729 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 19 Nov 2025 16:37:20 +0600 Subject: [PATCH] Template update --- source/ubl-settings-update.c | 29 ++++++++++++++--------------- source/ubl-settings-update.h | 2 +- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/source/ubl-settings-update.c b/source/ubl-settings-update.c index d56107f..379b7e2 100644 --- a/source/ubl-settings-update.c +++ b/source/ubl-settings-update.c @@ -5,7 +5,7 @@ config main_config; //functions void on_save_done(main_window *, config_str output, int size){ - char *final_output = yon_char_parsed_to_string(output,size,""); + char *final_output = yon_char_parsed_to_string(output,size,"\n"); if (final_output){ printf("%s\n",final_output); free(final_output); @@ -24,7 +24,7 @@ void on_save_done(main_window *, config_str output, int size){ break; } textdomain(LocaleName); - yon_config_set_ignore(REPOSITORY_parameter); + // yon_config_set_ignore(REPOSITORY_parameter); } @@ -570,27 +570,26 @@ void on_web_user_check(GtkToggleButton *self, web_publication_add_window *window } void on_config_save(GtkWidget *, main_window *){ - main_config.save_config=2; - template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_BOTH,config_get_command("global"),NULL); - if (window){}; + main_config.save_config=YON_CONFIG_BOTH; + yon_save_proceed(NULL,YON_CONFIG_BOTH,config_get_command("global"),NULL); } -void on_config_global_save(GtkWidget *, main_window *){ - main_config.save_config=0; - template_saving_window *window = yon_save_proceed("global",YON_CONFIG_GLOBAL,config_get_command("global"),NULL); - if (window){}; +void on_config_local_save(GtkWidget *, main_window *){ + main_config.save_config=YON_CONFIG_LOCAL; + yon_save_proceed("system",YON_CONFIG_LOCAL,config_get_command("system"),NULL); + } -void on_config_local_save(GtkWidget *, main_window *){ - main_config.save_config=1; - template_saving_window *window = yon_save_proceed("system",YON_CONFIG_LOCAL,config_get_command("system"),NULL); - if (window){}; +void on_config_global_save(GtkWidget *, main_window *){ + main_config.save_config=YON_CONFIG_GLOBAL; + yon_save_proceed("global",YON_CONFIG_GLOBAL,config_get_command("global"),NULL); + } void on_config_custom_save(GtkWidget *, main_window *){ - main_config.save_config=1; + main_config.save_config=YON_CONFIG_LOCAL; template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_CUSTOM,config_get_command("system"),NULL); - if (window){}; + if (window){}; } diff --git a/source/ubl-settings-update.h b/source/ubl-settings-update.h index 4958bc2..581925e 100644 --- a/source/ubl-settings-update.h +++ b/source/ubl-settings-update.h @@ -46,7 +46,7 @@ #define sha256_encrypt_command(target) yon_char_unite("echo -n \"",target,"\" | sha256sum | cut -f 1 -d ' '",NULL) #define sha512_encrypt_command(target) yon_char_unite("echo -n \"",target,"\" | sha512sum | cut -f 1 -d ' '",NULL) -#define config_get_command(target) yon_char_unite("ubconfig --source ",target," get [update] REPOPUBLIC_NET REPOPUBLIC_WEB REPOSITORY REPOSITORY[*] REPOPUBLIC_WEB REPOPUBLIC_WEB[*] REPOPUBLIC_CACHE REPOPUBLIC_CACHE[*] AUTOUPDATE AUTOUPDATE[mode] AUTOUPDATE[interval] AUTOUPDATE[repos] AUTOUPDATE[timestamp]",NULL) +#define config_get_command(target) yon_char_unite("ubconfig --source ",target," -ea get [update] REPOPUBLIC_NET REPOPUBLIC_WEB REPOSITORY REPOSITORY[*] REPOPUBLIC_WEB REPOPUBLIC_WEB[*] REPOPUBLIC_CACHE REPOPUBLIC_CACHE[*] AUTOUPDATE AUTOUPDATE[mode] AUTOUPDATE[interval] AUTOUPDATE[repos] AUTOUPDATE[timestamp]",NULL) #define config_get_default_command "ubconfig --source default get [update] AUTOUPDATE[repos] AUTOUPDATE[interval] AUTOUPDATE[mode] AUTOUPDATE REPOSITORY REPOSITORY[*]" #define config_get_global_only_parameters ""