@ -4,7 +4,9 @@
# include <gtk/gtkx.h>
# include <libublsettings.h>
# include <libublsettings-gtk3.h>
# ifdef VTE_INCLUDE
# include <vte/vte.h>
# endif
# include <locale.h>
# include <stdio.h>
# include <unistd.h>
@ -282,7 +284,11 @@ void yon_file_chooser_remove_accept_function(filechooser_window *window);
dialog_confirmation_data * yon_confirmation_dialog_data_new ( ) ;
int yon_confirmation_dialog_call ( GtkWidget * self , dialog_confirmation_data * data ) ;
/// @brief Call a confirmation dialog with specific data
/// @param parent_window parent window or any widget contained by parent window. The argument can be NULL.
/// @param data Data structure with label strings and accept function;
/// @return GTK_RESPONCE_ACCEPT, or 0 if canceled
int yon_confirmation_dialog_call ( GtkWidget * parent_window , dialog_confirmation_data * data ) ;
/**yon_open_browser(GtkWidget *self, char *link)
* [ EN ]
@ -361,6 +367,11 @@ template_app_info yon_ubl_get_app_info();
void yon_ubl_settings_window_set_standard_callbacks ( template_main_window * widgets , char * get_global_command , char * get_local_command , char * get_custom_command , char * get_default_command , char * get_global_only_command , char * get_local_only_command ) ;
/// @brief Set an interface update function for common loading callbacks
/// @param target_func function to connect
/// @param func_data data for passing into function
void yon_ubl_settings_set_interface_update_function ( void * target_func , gpointer func_data ) ;
void yon_window_remove_exit_config_check ( template_main_window * widgets ) ;
void yon_window_set_exit_config_check ( template_main_window * widgets , GCallback data_callback_function ) ;
@ -556,7 +567,11 @@ typedef struct {
GtkWidget * PasswordBox ;
GtkWidget * HashBox ;
GtkWidget * PasswordStrengthProgress ;
void * strength_func ;
const char * old_password ;
} yon_password_window ;
@ -570,6 +585,7 @@ GtkWidget *yon_config_save_window_new();
void yon_password_hash_list_set ( yon_password_window * window , config_str hashes , config_str get_hash_commands , int size ) ;
yon_password_window * yon_password_open ( GtkEntry * target ) ;
void yon_password_function_set ( yon_password_window * window , double * password_func ) ;
typedef struct {
GtkWidget * Window ;
@ -581,124 +597,124 @@ typedef struct {
/// @return A newly allocated empty window;
yon_window * yon_window_new ( ) ;
# define VERSION_LABEL yon_char_unite( _("Version:")," ",!yon_char_is_empty(template_app_information.app_version)?template_app_information.app_version:"","\n",NULL)
# define HELP_LABEL(rest) yon_char_unite(template_app_information.app_tech_name, _(" version:")," ", !yon_char_is_empty(template_app_information.app_version)?template_app_information.app_version:"","\n",\
template_app_information . app_title , " \n " , _( " Usage: " ) , " " , template_app_information . app_tech_name , " " , _( " [OPTIONS] " ) , " \n " , \
_( " Options: " ) , " \n " , \
" --help, -h " , _( " Show this help " ) , " \n " , \
" --version, -V " , _( " Show package version " ) , " \n " , \
" --lock-help " , _( " Lock this help menu " ) , " \n " , \
" --lock-save " , _( " Lock configuration saving " ) , " \n " , \
" --lock-save-local " , _( " Lock local configration saving " ) , " \n " , \
" --lock-save-global " , _( " Lock global configration saving " ) , " \n " , \
" --lock-load-global " , _( " Lock global configration loading " ) , " \n " , \
" --clear-config, -c " , _( " Reset application settings " ) , " \n " , \
# define VERSION_LABEL yon_char_unite( yon _char_get_localised_from_lib ("Version:")," ",!yon_char_is_empty(template_app_information.app_version)?template_app_information.app_version:"","\n",NULL)
# define HELP_LABEL(rest) yon_char_unite(template_app_information.app_tech_name, yon _char_get_localised_from_lib (" version:")," ", !yon_char_is_empty(template_app_information.app_version)?template_app_information.app_version:"","\n",\
template_app_information . app_title , " \n " , yon _char_get_localised_from_lib ( " Usage: " ) , " " , template_app_information . app_tech_name , " " , yon _char_get_localised_from_lib ( " [OPTIONS] " ) , " \n " , \
yon _char_get_localised_from_lib ( " Options: " ) , " \n " , \
" --help, -h " , yon _char_get_localised_from_lib ( " Show this help " ) , " \n " , \
" --version, -V " , yon _char_get_localised_from_lib ( " Show package version " ) , " \n " , \
" --lock-help " , yon _char_get_localised_from_lib ( " Lock this help menu " ) , " \n " , \
" --lock-save " , yon _char_get_localised_from_lib ( " Lock configuration saving " ) , " \n " , \
" --lock-save-local " , yon _char_get_localised_from_lib ( " Lock local configration saving " ) , " \n " , \
" --lock-save-global " , yon _char_get_localised_from_lib ( " Lock global configration saving " ) , " \n " , \
" --lock-load-global " , yon _char_get_localised_from_lib ( " Lock global configration loading " ) , " \n " , \
" --clear-config, -c " , yon _char_get_localised_from_lib ( " Reset application settings " ) , " \n " , \
! yon_char_is_empty ( rest ) ? rest : NULL , NULL )
# define template_ui_LocalePath " / usr / share / locale"
# define template_ui_LocaleName "libublsettingsui-gtk3"
# define about_label(target) yon_char_unite(yon_char_get_localised_from_lib( _("About"))," ",target,NULL)
# define about_label(target) yon_char_unite(yon_char_get_localised_from_lib( yon _char_get_localised_from_lib ("About"))," ",target,NULL)
# define SUCCESS_LABEL _("Operation succeeded")
# define FAIL_LABEL _("Operation failed")
# define ROOT_WARNING_LABEL _("Warning! Application was launched without root - root-dependent actions are locked")
# define SUCCESS_LABEL yon _char_get_localised_from_lib ("Operation succeeded")
# define FAIL_LABEL yon _char_get_localised_from_lib ("Operation failed")
# define ROOT_WARNING_LABEL yon _char_get_localised_from_lib ("Warning! Application was launched without root - root-dependent actions are locked")
# define DEFAULT_LABEL _("Default")
# define DEFAULT_CUSTOM_LABEL(target) yon_char_unite( _("Default"),!yon_char_is_empty(target)?" (":NULL,target,")",NULL)
# define ABOUT_LABEL _("About")
# define DOCUMENTATION_LABEL _("Documentation")
# define DEFAULT_LABEL yon _char_get_localised_from_lib ("Default")
# define DEFAULT_CUSTOM_LABEL(target) yon_char_unite( yon _char_get_localised_from_lib ("Default"),!yon_char_is_empty(target)?" (":NULL,target,")",NULL)
# define ABOUT_LABEL yon _char_get_localised_from_lib ("About")
# define DOCUMENTATION_LABEL yon _char_get_localised_from_lib ("Documentation")
# define SAVE_CUSTOM_LABEL _("Save to specific file")
# define SAVE_LOCAL_LABEL _("Save to local configuration")
# define SAVE_GLOBAL_LABEL _("Save to global configuration")
# define SAVE_CONFIGURATION_LABEL _("Save configuration")
# define SAVE_LABEL _("Save")
# define SAVE_PROCESS_LABEL _("Saving...")
# define SAVE_CUSTOM_LABEL yon _char_get_localised_from_lib ("Save to specific file")
# define SAVE_LOCAL_LABEL yon _char_get_localised_from_lib ("Save to local configuration")
# define SAVE_GLOBAL_LABEL yon _char_get_localised_from_lib ("Save to global configuration")
# define SAVE_CONFIGURATION_LABEL yon _char_get_localised_from_lib ("Save configuration")
# define SAVE_LABEL yon _char_get_localised_from_lib ("Save")
# define SAVE_PROCESS_LABEL yon _char_get_localised_from_lib ("Saving...")
# define LOAD_CUSTOM_LABEL _("Load from specific file")
# define LOAD_LOCAL_LABEL _("Load local configuration")
# define LOAD_GLOBAL_LABEL _("Load global configuration")
# define LOAD_LABEL _("Load")
# define LOAD_CONFIG_LABEL _("Load file")
# define LOAD_CUSTOM_LABEL yon _char_get_localised_from_lib ("Load from specific file")
# define LOAD_LOCAL_LABEL yon _char_get_localised_from_lib ("Load local configuration")
# define LOAD_GLOBAL_LABEL yon _char_get_localised_from_lib ("Load global configuration")
# define LOAD_LABEL yon _char_get_localised_from_lib ("Load")
# define LOAD_CONFIG_LABEL yon _char_get_localised_from_lib ("Load file")
# define CANCEL_LABEL _("Cancel")
# define CANCEL_LABEL yon _char_get_localised_from_lib ("Cancel")
# define ACCEPT_LABEL yon_char_get_localised_from_lib("Ok")
# define OPEN_LABEL _("Open")
# define CREATE_FOLDER_LABEL _("Create directory")
# define SELECT_FOLDER_LABEL _("Select directory")
# define HELP_TITLE_LABEL _("Would you like to read documentation in the Web?")
# define HELP_INFO_LABEL _("You will be redirected to documentation website where documentation is\ntranslated and supported by community.")
# define HELP_ALWAYS_OPEN_LABEL _("Always redirect to online documentation")
# define OPEN_HELP_LABEL _("Open documentation")
# define PROJECT_HOME_LABEL _("Project Home Page")
# define NOTHING_CHOSEN_LABEL _("Nothing were chosen")
# define AUTHORS_LABEL _(L"Copyright © 2022 - 2025, UBSoft LLC")
# define GLOBAL_LOAD_SUCCESS_LABEL _("Global configuration loading succeeded.")
# define LOCAL_LOAD_SUCCESS_LABEL _("Local configuration loading succeeded.")
# define LOAD_FAILED_LABEL _("Config loading failed")
# define GLOBAL_LOCAL_SAVE_SUCCESS_LABEL _("Local and global configuration saving succeeded.")
# define GLOBAL_SAVE_SUCCESS_LABEL _("Global configuration saving succeeded.")
# define LOCAL_SAVE_SUCCESS_LABEL _("Local configuration saving succeeded.")
# define SAVE_SUCCESS_LABEL _("Configuration saving succeeded.")
# define PARAMETER_LABEL _("Parameter")
# define OLD_VALUE_LABEL _("Old value")
# define NEW_VALUE_LABEL _("New value")
# define COMPARE_VALUE_LABEL _("Value\n(Old/ New)")
# define NOTHING_TO_SAVE_LABEL _("Nothing to save")
# define SAVING_LOCAL_STATE_LABEL _("Saving into local configuration")
# define SAVING_GLOBAL_STATE_LABEL _("Saving into global configuration")
# define SAVING_GLOBAL_LOCAL_STATE_LABEL _("Saving into global and local configuration")
# define SAVING_CUSTOM_STATE_LABEL(target_path) yon_char_unite( _("Saving into custom configuration at")," ",target_path,NULL)
# define OPEN_LABEL yon _char_get_localised_from_lib ("Open")
# define CREATE_FOLDER_LABEL yon _char_get_localised_from_lib ("Create directory")
# define SELECT_FOLDER_LABEL yon _char_get_localised_from_lib ("Select directory")
# define HELP_TITLE_LABEL yon _char_get_localised_from_lib ("Would you like to read documentation in the Web?")
# define HELP_INFO_LABEL yon _char_get_localised_from_lib ("You will be redirected to documentation website where documentation is\ntranslated and supported by community.")
# define HELP_ALWAYS_OPEN_LABEL yon _char_get_localised_from_lib ("Always redirect to online documentation")
# define OPEN_HELP_LABEL yon _char_get_localised_from_lib ("Open documentation")
# define PROJECT_HOME_LABEL yon _char_get_localised_from_lib ("Project Home Page")
# define NOTHING_CHOSEN_LABEL yon _char_get_localised_from_lib ("Nothing were chosen")
# define AUTHORS_LABEL yon _char_get_localised_from_lib (L"Copyright © 2022 - 2025, UBSoft LLC")
# define GLOBAL_LOAD_SUCCESS_LABEL yon _char_get_localised_from_lib ("Global configuration loading succeeded.")
# define LOCAL_LOAD_SUCCESS_LABEL yon _char_get_localised_from_lib ("Local configuration loading succeeded.")
# define LOAD_FAILED_LABEL yon _char_get_localised_from_lib ("Config loading failed")
# define GLOBAL_LOCAL_SAVE_SUCCESS_LABEL yon _char_get_localised_from_lib ("Local and global configuration saving succeeded.")
# define GLOBAL_SAVE_SUCCESS_LABEL yon _char_get_localised_from_lib ("Global configuration saving succeeded.")
# define LOCAL_SAVE_SUCCESS_LABEL yon _char_get_localised_from_lib ("Local configuration saving succeeded.")
# define SAVE_SUCCESS_LABEL yon _char_get_localised_from_lib ("Configuration saving succeeded.")
# define PARAMETER_LABEL yon _char_get_localised_from_lib ("Parameter")
# define OLD_VALUE_LABEL yon _char_get_localised_from_lib ("Old value")
# define NEW_VALUE_LABEL yon _char_get_localised_from_lib ("New value")
# define COMPARE_VALUE_LABEL yon _char_get_localised_from_lib ("Value\n(Old/ New)")
# define NOTHING_TO_SAVE_LABEL yon _char_get_localised_from_lib ("Nothing to save")
# define SAVING_LOCAL_STATE_LABEL yon _char_get_localised_from_lib ("Saving into local configuration")
# define SAVING_GLOBAL_STATE_LABEL yon _char_get_localised_from_lib ("Saving into global configuration")
# define SAVING_GLOBAL_LOCAL_STATE_LABEL yon _char_get_localised_from_lib ("Saving into global and local configuration")
# define SAVING_CUSTOM_STATE_LABEL(target_path) yon_char_unite( yon _char_get_localised_from_lib ("Saving into custom configuration at")," ",target_path,NULL)
# define SYSTEMBOOT_STATEMODE "SYSTEMBOOT_STATEMODE"
# define SYSTEMBOOT_STATEMODE_SECTION "[system]"
# define SAVE_MODE_FULL_LABEL _("Full saving mode")
# define SAVE_MODE_MODULE_LABEL _("Saving into module")
# define SAVE_MODE_SANDBOX_LABEL _("Sandbox mode")
# define SAVE_MODE_RAM_HOME_LABEL _("Sandbox with profile saving")
# define SAVE_MODE_HDD_LABEL _("HDD sandbox")
# define SAVE_MODE_HDD_HOME_LABEL _("HDD sandbox with profile saving")
# define CUSTOM_CONFIG_CREATION_ERROR_LABEL _("New configuration file creation failed")
# define ROOT_CHECK_LABEL _("Grant root access")
# define SAVE_MODE_FULL_LABEL yon _char_get_localised_from_lib ("Full saving mode")
# define SAVE_MODE_MODULE_LABEL yon _char_get_localised_from_lib ("Saving into module")
# define SAVE_MODE_SANDBOX_LABEL yon _char_get_localised_from_lib ("Sandbox mode")
# define SAVE_MODE_RAM_HOME_LABEL yon _char_get_localised_from_lib ("Sandbox with profile saving")
# define SAVE_MODE_HDD_LABEL yon _char_get_localised_from_lib ("HDD sandbox")
# define SAVE_MODE_HDD_HOME_LABEL yon _char_get_localised_from_lib ("HDD sandbox with profile saving")
# define CUSTOM_CONFIG_CREATION_ERROR_LABEL yon _char_get_localised_from_lib ("New configuration file creation failed")
# define ROOT_CHECK_LABEL yon _char_get_localised_from_lib ("Grant root access")
# define SETTINGS_TITLE_LABEL yon_char_get_localised_from_lib("Settings")
# define CONFIG_WINDOW_MENU_LABEL _("Settigs")
# define CONFIG_WINDOW_MENU_LABEL yon _char_get_localised_from_lib ("Settigs")
# define EMAIL_INVALID_LABEL _("Invalid email address")
# define PATH_INVALID_LABEL _("Invalid path")
# define EMAIL_INVALID_LABEL yon _char_get_localised_from_lib ("Invalid email address")
# define PATH_INVALID_LABEL yon _char_get_localised_from_lib ("Invalid path")
# define CHOOSE_FILE_LABEL _("Choose path")
# define CHOOSE_APP_LABEL _("Choose application")
# define CHOOSE_FILE_LABEL yon _char_get_localised_from_lib ("Choose path")
# define CHOOSE_APP_LABEL yon _char_get_localised_from_lib ("Choose application")
# define FILE_CHOOSER_CHOOSE_FILDER_LABEL _("Choose directory instead of file")
# define FILE_CHOOSER_CHOOSE_FILDER_LABEL yon _char_get_localised_from_lib ("Choose directory instead of file")
# define _SERVICE_ENABLE_LABEL _("Enabled")
# define _SERVICE_DISABLE_LABEL _("Disabled")
# define _SERVICE_ACTIVE_LABEL _("Active")
# define _SERVICE_INACTIVE_LABEL _("Inactive")
# define _SERVICE_ENABLE_LABEL yon _char_get_localised_from_lib ("Enabled")
# define _SERVICE_DISABLE_LABEL yon _char_get_localised_from_lib ("Disabled")
# define _SERVICE_ACTIVE_LABEL yon _char_get_localised_from_lib ("Active")
# define _SERVICE_INACTIVE_LABEL yon _char_get_localised_from_lib ("Inactive")
# define _SERVICE_ACTIVE_TEXT_LABEL _("Active:")
# define _SERVICE_ENABLED_TEXT_LABEL _("Enabled:")
# define _SERVICE_START_BUTTON_LABEL _("Start")
# define _SERVICE_STOP_BUTTON_LABEL _("Stop")
# define _SERVICE_RESTART_BUTTON_LABEL _("Restart")
# define _SERVICE_ACTIVE_TEXT_LABEL yon _char_get_localised_from_lib ("Active:")
# define _SERVICE_ENABLED_TEXT_LABEL yon _char_get_localised_from_lib ("Enabled:")
# define _SERVICE_START_BUTTON_LABEL yon _char_get_localised_from_lib ("Start")
# define _SERVICE_STOP_BUTTON_LABEL yon _char_get_localised_from_lib ("Stop")
# define _SERVICE_RESTART_BUTTON_LABEL yon _char_get_localised_from_lib ("Restart")
# define _SERVICE_ENABLE_BUTTON_LABEL _("Enable autolaunch")
# define _SERVICE_DISABLE_BUTTON_LABEL _("Disable autolaunch")
# define _SERVICE_ENABLE_BUTTON_LABEL yon _char_get_localised_from_lib ("Enable autolaunch")
# define _SERVICE_DISABLE_BUTTON_LABEL yon _char_get_localised_from_lib ("Disable autolaunch")
# define _SERVICE_HEAD_LABEL(target) g_strdup_printf(yon_char_get_localised_from_lib( _("\"%s\" service configuration")), target)
# define _SERVICE_TITLE_LABEL(target) g_strdup_printf(yon_char_get_localised_from_lib( _("\"%s\" service:")), target)
# define _SERVICE_ACTIVE_STATUS_LABEL(target) yon_char_unite("\"",target,"\" ", yon_char_get_localised_from_lib( _("service is active")),NULL)
# define _SERVICE_INACTIVE_STATUS_LABEL(target) yon_char_unite("\"",target,"\" ",yon_char_get_localised_from_lib( _("service is inactive")),NULL)
# define _SERVICE_HEAD_LABEL(target) g_strdup_printf(yon_char_get_localised_from_lib( yon _char_get_localised_from_lib ("\"%s\" service configuration")), target)
# define _SERVICE_TITLE_LABEL(target) g_strdup_printf(yon_char_get_localised_from_lib( yon _char_get_localised_from_lib ("\"%s\" service:")), target)
# define _SERVICE_ACTIVE_STATUS_LABEL(target) yon_char_unite("\"",target,"\" ", yon_char_get_localised_from_lib( yon _char_get_localised_from_lib ("service is active")),NULL)
# define _SERVICE_INACTIVE_STATUS_LABEL(target) yon_char_unite("\"",target,"\" ",yon_char_get_localised_from_lib( yon _char_get_localised_from_lib ("service is inactive")),NULL)
# define _PASSWORD_TITLE_LABEL yon_char_get_localised_from_lib("Password")
@ -712,12 +728,30 @@ yon_window *yon_window_new();
# define _ENCRYPTION_DEFAULT_LABEL yon_char_get_localised_from_lib("Default (None)")
# define ACCESS_DENIED_LABEL(target) yon_char_unite(yon_char_get_localised_from_lib("Access to file denied"),": ", target,NULL)
# define CONFIG_INVALID_LABEL yon_char_get_localised_from_lib("The configuration file contains incorrect parameters.")
# define DATE_FORMAT_SETTINGS_LABEL _("Date format:")
# define YEAR_FORMAT_LABEL _("YYYY")
# define MONTH_FORMAT_LABEL _("MM")
# define DAY_FORMAT_LABEL _("DD")
# define DMY_FORMAT_LABEL _("DD.MM.YYYY")
# define DMY_MINUS_FORMAT_LABEL _("DD-MM-YYYY")
# define DMY_SLASH_FORMAT_LABEL _("DD / MM / YYYY")
# define MDY_FORMAT_LABEL _("MM-DD-YYYY")
# define DATE_FORMAT_SETTINGS_LABEL yon_char_get_localised_from_lib("Date format:")
# define YEAR_FORMAT_LABEL yon_char_get_localised_from_lib("YYYY")
# define MONTH_FORMAT_LABEL yon_char_get_localised_from_lib("MM")
# define DAY_FORMAT_LABEL yon_char_get_localised_from_lib("DD")
# define DMY_FORMAT_LABEL yon_char_get_localised_from_lib("DD.MM.YYYY")
# define DMY_MINUS_FORMAT_LABEL yon_char_get_localised_from_lib("DD-MM-YYYY")
# define DMY_SLASH_FORMAT_LABEL yon_char_get_localised_from_lib("DD / MM / YYYY")
# define MDY_FORMAT_LABEL yon_char_get_localised_from_lib("MM-DD-YYYY")
# define _WEAK_PASSWORD_LABEL yon_char_get_localised_from_lib("The password does not meet the password policy requirements")
# define _WARNING_LABEL yon_char_get_localised_from_lib("Warning")
# define _CREATE_CONFIG_DIALOG_LABEL yon_char_get_localised_from_lib("Configuration file does not exist. Create new configuration file?")
# define _CREATE_CONFIG_DIALOG_HOMEDIR_LABEL yon_char_get_localised_from_lib("Configuration file does not exist. Create new configuration file? New configuration file will be created at your user's home directory")
# define _CHOOSEN_LABEL yon_char_get_localised_from_lib("Chosen")
# define _ID_LABEL yon_char_get_localised_from_lib("ID")
# define _GROUP_LABEL yon_char_get_localised_from_lib("Group")
# define _USER_LABEL yon_char_get_localised_from_lib("User")
# define _CHOOSE_GROUPS_LABEL yon_char_get_localised_from_lib("Choose groups")
# define _CHOOSE_GROUP_LABEL yon_char_get_localised_from_lib("Choose group")
# define _CHOOSE_USERS_LABEL yon_char_get_localised_from_lib("Choose users")
# define _CHOOSE_USER_LABEL yon_char_get_localised_from_lib("Choose user")
# endif