From faf1a957f96739747dc64fe0844e574d62664335 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 13 Nov 2024 17:51:18 +0600 Subject: [PATCH] Added postsave function --- source/ubl-settings-kernel.c | 24 ++++++++++++++++++++++++ source/ubl-settings-kernel.h | 2 ++ 2 files changed, 26 insertions(+) diff --git a/source/ubl-settings-kernel.c b/source/ubl-settings-kernel.c index 2415058..f8d0321 100644 --- a/source/ubl-settings-kernel.c +++ b/source/ubl-settings-kernel.c @@ -4,6 +4,29 @@ 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,""); + if (final_output){ + printf("%s\n",final_output); + free(final_output); + } + yon_char_parsed_free(output,size); + textdomain(template_ui_LocaleName); + switch (main_config.save_config){ + case 0: + yon_ubl_status_box_render(GLOBAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); + break; + case 1: + yon_ubl_status_box_render(LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); + break; + case 2: + yon_ubl_status_box_render(GLOBAL_LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); + break; + } + textdomain(LocaleName); + +} + void yon_load_proceed(YON_CONFIG_TYPE type){ yon_config_clean(); if (!yon_char_is_empty(config_get_default_command)) @@ -917,6 +940,7 @@ void yon_main_window_complete(main_window *widgets){ gtk_overlay_add_overlay(GTK_OVERLAY(widgets->TerminalOverlay),widgets->MainRevealer); yon_interface_update(widgets); + yon_save_window_set_postsave_function(on_save_done,widgets); } yon_load_proceed(YON_CONFIG_LOCAL); } diff --git a/source/ubl-settings-kernel.h b/source/ubl-settings-kernel.h index 710a72b..1c077a4 100644 --- a/source/ubl-settings-kernel.h +++ b/source/ubl-settings-kernel.h @@ -196,6 +196,8 @@ typedef struct { } dialog_window; +void on_save_done(main_window *widgets, config_str output, int size); + void *yon_interface_update(main_window *widgets);