diff --git a/libublsettingsui-gtk3-settings.glade b/libublsettingsui-gtk3-settings.glade
new file mode 100644
index 0000000..e295603
--- /dev/null
+++ b/libublsettingsui-gtk3-settings.glade
@@ -0,0 +1,98 @@
+
+
+
+
+
+
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index 8fdee64..d87dbcd 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -76,6 +76,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissin
add_library(${PROJECT_NAME} SHARED
libublsettingsui-gtk3.c
+ libublsettingsui-gtk3-save.c
libublsettingsui-gtk3.h
${CMAKE_CURRENT_BINARY_DIR}/${GRESOURCE_C})
diff --git a/source/libublsettingsui-gtk3-save.c b/source/libublsettingsui-gtk3-save.c
new file mode 100644
index 0000000..f187763
--- /dev/null
+++ b/source/libublsettingsui-gtk3-save.c
@@ -0,0 +1,527 @@
+#include "libublsettingsui-gtk3.h"
+
+struct loaded_config {
+ dictionary_fields(loaded_config);
+ char *section;
+};
+
+template_saving_window *yon_saving_window_new();
+
+struct loaded_config *yon_config_convert_parameter(config_str parsed, int size);
+
+/**function and argument, which called after successful config saving.
+ * Example:
+ * void on_save_done(main_window *widgets, config_str output, int size)
+*/
+void (*save_success_function)(void*,config_str,int)=NULL;
+void *save_success_argument=NULL;
+void (*save_failure_function)(void*,config_str,int)=NULL;
+void *save_failure_argument=NULL;
+
+void yon_save_window_set_postsave_function(void *function, void *data){
+ save_success_function=function;
+ save_success_argument=data;
+}
+
+void yon_save_window_set_postsave_failure_function(void *function, void *data){
+ save_failure_function=function;
+ save_failure_argument=data;
+}
+
+void on_save_window_parameter_switched(GtkCellRendererToggle *self, gchar *path, template_saving_window *window){
+ GtkTreeIter iter,itar;
+ if (path){
+ if (gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(window->list),&itar,path)){
+ gboolean is_active;
+ gtk_tree_model_get(GTK_TREE_MODEL(window->list),&itar,0,&is_active,-1);
+ gtk_list_store_set(window->list,&itar,0,!is_active,-1);
+ }
+ }
+ int once_active=0;
+ int valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&iter);
+ for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&iter)){
+ int is_active;
+ gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,0,&is_active,-1);
+ if (is_active){
+ once_active=1;
+ break;
+ }
+ }
+ if (!once_active) gtk_widget_set_sensitive(window->SaveButton,0);
+ else gtk_widget_set_sensitive(window->SaveButton,1);
+
+}
+
+template_debug_window *template_debugger_window_new(){
+ template_debug_window *window = malloc(sizeof(template_debug_window));
+ GtkBuilder *builder = gtk_builder_new_from_resource(ui_glade_path_debug);
+ window->Window=yon_gtk_builder_get_widget(builder,"Window");
+ window->HeaderTopic=yon_gtk_builder_get_widget(builder,"HeaderTopic");
+ window->HeaderImage=yon_gtk_builder_get_widget(builder,"HeaderImage");
+ window->StatusBox=yon_gtk_builder_get_widget(builder,"StatusBox");
+ window->Vte=yon_gtk_builder_get_widget(builder,"DebuggerTerminal");
+ gtk_window_set_title(GTK_WINDOW(window->Window),template_app_information.app_title);
+ gtk_label_set_text(GTK_LABEL(window->HeaderTopic),template_app_information.app_title);
+ gtk_window_set_icon_name(GTK_WINDOW(window->Window),yon_char_append("com.ublinux.",template_app_information.app_tech_name));
+ gtk_image_set_from_pixbuf(GTK_IMAGE(window->HeaderImage),gtk_icon_theme_load_icon_for_scale(gtk_icon_theme_get_default(),yon_char_append("com.ublinux.",template_app_information.app_tech_name),32,1,GTK_ICON_LOOKUP_FORCE_SIZE,NULL));
+
+ yon_window_config_custom_window_setup(GTK_WINDOW(window->Window),"DebugWindow");
+ return window;
+}
+
+struct save_return {
+ void *save_success_argument;
+ config_str file_return;
+ int file_save;
+};
+
+gboolean _yon_postsave_function_start(struct save_return *data){
+ save_success_function(data->save_success_argument,data->file_return,data->file_save);
+ return G_SOURCE_REMOVE;
+}
+
+gboolean _yon_postsave_failure_function_start(struct save_return *data){
+ save_failure_function(data->save_success_argument,data->file_return,data->file_save);
+ return G_SOURCE_REMOVE;
+}
+
+void _yon_saving_threaded(char *final_command){
+ FILE *file = popen(final_command,"r");
+ int file_save;
+ config_str file_return = yon_config_load_file(file,&file_save);
+ fclose(file);
+ file_return = yon_char_parsed_append(file_return,&file_save,final_command);
+ if (save_success_function)
+ {
+ struct save_return *data = malloc(sizeof(struct save_return));
+ data->save_success_argument = save_success_argument;
+ data->file_return = file_return;
+ data->file_save = file_save;
+ gdk_threads_add_idle((GSourceFunc)_yon_postsave_function_start,data);
+ }
+}
+
+struct loaded_config *yon_save_window_get_saved_parameters(template_saving_window *window){
+ int saved_size = 0;
+ GtkTreeIter iter;
+ GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(window->ParametersTree));
+ int valid = gtk_tree_model_get_iter_first(model,&iter);
+ config_str saved_parameters=NULL;
+ for (;valid;valid = gtk_tree_model_iter_next(model,&iter)){
+ char *parameter, *value;
+ int is_active;
+ gtk_tree_model_get(model,&iter,0,&is_active,1,¶meter,3,&value,-1);
+ if (is_active){
+ char *final_string = yon_char_unite(parameter,"=",value,NULL);
+ yon_char_parsed_add_or_create_if_exists(saved_parameters,&saved_size,final_string);
+ free(final_string);
+ }
+
+ }
+ struct loaded_config *final = yon_config_convert_parameter(saved_parameters,saved_size);
+ struct loaded_config *current = NULL;
+
+ for_iter(model,&iter){
+ char *target, *section;
+ gtk_tree_model_get(model,&iter,1,&target,7,§ion,-1);
+ struct loaded_config *found = (struct loaded_config*)yon_dictionary_get((dictionary**)&final,target);
+ if (found){
+ found->section=section;
+ }
+ }
+ return final;
+}
+
+config_str yon_loaded_config_convert_to_save_command(struct loaded_config *target, int *size,char *path){
+ (*size)=0;
+ dictionary *sections = NULL;
+ {
+ struct loaded_config *current;
+ for_dictionaries(current,target){
+ dictionary *cur_section=NULL;
+ if (sections&&(cur_section=yon_dictionary_get(§ions,current->section))){
+ char *temp = yon_char_unite((char*)cur_section->data," ", current->key,"=\'",(char*)current->data,"\'",NULL);
+ free(current->data);
+ cur_section->data = temp;
+ } else {
+ char *parameters = yon_char_unite(current->key,"=\'",(char*)current->data,"\'",NULL);
+ yon_dictionary_add_or_create_if_exists_with_data(sections,current->section,parameters);
+
+ }
+ }
+ }
+ config_str commands = NULL;
+ {
+ dictionary *current;
+ for_dictionaries(current,sections){
+ char *dull_command = ubconfig_set_command_full(path,current->key,(char*)current->data);
+ char *command = yon_config_parameter_prepare_command(dull_command,NULL,current->key,NULL);
+ yon_char_parsed_add_or_create_if_exists(commands,size,command);
+ free(command);
+ }
+ }
+ return commands;
+}
+
+int yon_config_parameter_prepare_elements(struct loaded_config *target){
+ int success = 0;
+ struct loaded_config *current = NULL;
+ for_dictionaries(current,target){
+ char *parameter = current->key;
+ if (strstr(parameter,"[")){
+ char *param = yon_char_divide_search(parameter,"[",-1);
+ char *param_key = yon_char_divide_search(parameter,"]",-1);
+ free(parameter);
+ parameter = yon_char_unite(param,"[\"",param_key,"\"]",NULL);
+ current->key = parameter;
+ success=1;
+ }
+ }
+ return success;
+}
+
+void on_save_parameters(GtkWidget *self, template_saving_window *window){
+ textdomain(template_ui_LocaleName);
+ yon_ubl_status_box_render(SAVE_PROCESS_LABEL,BACKGROUND_IMAGE_INFO_TYPE);
+ textdomain(template_app_information.app_locale);
+
+ int saved_size;
+ struct loaded_config *saved_parameters = yon_save_window_get_saved_parameters(window);
+ yon_config_parameter_prepare_elements(saved_parameters);
+
+ int size=0;
+ config_str commands = yon_loaded_config_convert_to_save_command(saved_parameters,&size,window->type!=YON_CONFIG_CUSTOM? yon_config_get_type_path(window->type):window->custom_save_path);
+
+ char *final_command = yon_char_parsed_to_string(commands,size,";");
+ pthread_t thread_id;
+ pthread_create(&thread_id, NULL, (void *)_yon_saving_threaded,final_command);
+
+ yon_window_config_custom_window_set(GTK_WINDOW(window->Window),"SaveWindow");
+ on_subwindow_close(self);
+}
+
+struct loaded_config *yon_config_convert_parameter(config_str parsed, int size){
+ struct loaded_config *loaded=NULL;
+ for (int i=0;ikey=key;
+ loaded->first=loaded;
+ loaded->next=NULL;
+ loaded->prev=NULL;
+ loaded->section=NULL;
+ loaded->data=value;
+ } else {
+ loaded->next = (struct loaded_config*)malloc(sizeof(struct loaded_config));
+ struct loaded_config *next=loaded->next;
+ next->first=loaded->first;
+ next->prev=loaded;
+ next->key=key;
+ next->first=loaded->first;
+ next->next=NULL;
+ next->section=NULL;
+ next->data=value;
+ loaded=next;
+ }
+ }
+ return loaded;
+}
+
+char *yon_command_get_section(char *command){
+ int size=0;
+
+ config_str parsed = yon_char_parse(command,&size," ");
+ int get_pos = yon_char_parsed_check_exist(parsed,size,"get");
+ if (get_pos==-1) return NULL;
+ char *final = yon_char_new(parsed[get_pos+1]);
+ yon_char_parsed_free(parsed,size);
+ return final;
+}
+
+config_str yon_command_get_parameters(char *command,int *parameters_size){
+ int size=0;
+ config_str parameters = NULL;
+
+ config_str parsed = yon_char_parse(command,&size," ");
+ int get_pos = yon_char_parsed_check_exist(parsed,size,"get");
+ if (get_pos==-1) return NULL;
+ for (int i=get_pos+2;idata)[i+1]!=NULL;i++){
+ if (strstr(((config_str)dict->data)[i],"[*]")){
+ char *search = yon_char_new(((config_str)dict->data)[i]);
+ char *tmp = yon_char_divide_search(search,"[",-1);
+ free(search);
+ search = tmp;
+ if (strstr(current->key,search)){
+ current->section = dict->key;
+ }
+ } else {
+ if (!strcmp(((config_str)dict->data)[i],current->key)){
+ current->section = dict->key;
+ }
+ }
+ }
+ }
+ }
+}
+
+struct loaded_config *yon_config_get_compared(char *command){
+ if (command){
+ int size;
+ config_str config = yon_config_load(command,&size);
+ config_str temporary = NULL;
+ int temp_size=0;
+ if (config&&size>0){
+ for (int i=0;ikey)){
+ dictionary *dict = yon_dictionary_get((dictionary**)&config_compare,current->key); // get old parameter value
+ gboolean status=0;
+ status = yon_config_get_status(current->key);
+ if (dict&&!yon_char_is_empty((char*)dict->data)&&status!=-2){
+ if (strcmp((char*)dict->data,(char*)current->data)){
+ GtkTreeIter iter;
+ if (status==0||status==-2) status = 0;
+ else status=1;
+ char *compare_string = yon_char_unite("",(char*)dict->data,"\n",(char*)current->data,NULL);
+ gtk_list_store_append(window->list,&iter);
+ gtk_list_store_set(window->list,&iter,0,status,1,current->key,2,(char*)dict->data,3,(char*)current->data,4,compare_string,6,1,7,yon_config_get_section_for_key(current->key),-1);
+ free(compare_string);
+ }
+ } else if ((strcmp((char*)current->data,""))&&status!=-2){
+ GtkTreeIter iter;
+ if (status==0||status==-2) status = 0;
+ else status=1;
+ char *compare_string = yon_char_unite("\n",(char*)current->data,NULL);
+ gtk_list_store_append(window->list,&iter);
+ gtk_list_store_set(window->list,&iter,0,status,1,current->key,3,(char*)current->data,4,compare_string,6,1,7,yon_config_get_section_for_key(current->key),-1);
+ free(compare_string);
+ }
+ }
+ }
+ }
+}
+
+void yon_save_window_compared_config_init_unfound(template_saving_window *window, struct loaded_config *current_loaded, struct loaded_config *config_compare){
+ if (config_compare){
+ struct loaded_config *current = NULL;
+ for_dictionaries(current,config_compare){
+ if (!yon_config_check_ignore(current->key)){
+ GtkTreeIter iter;
+ dictionary *dict = yon_dictionary_get((dictionary**)¤t_loaded,current->key);
+ if (!dict){
+ GdkRGBA rgba;
+ rgba.alpha=0.8;
+ rgba.red=1;
+ rgba.blue=0.3;
+ rgba.green=0.65;
+ char *rgba_string = gdk_rgba_to_string(&rgba);
+ int status=0;
+ char *compare_string = yon_char_unite((char*)current->data,"\n",NULL);
+ gtk_list_store_append(window->list,&iter);
+ gtk_list_store_set(window->list,&iter,0,0,1,current->key,2,(char*)current->data,4,compare_string,5,rgba_string,6,1,7,current->section,-1);
+ free(compare_string);
+ }
+ }
+ }
+ }
+}
+
+gboolean yon_save_window_destroy_if_empty(template_saving_window *window){
+ GtkTreeIter iter;
+ if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&iter)){
+ gtk_widget_destroy(window->Window);
+ textdomain(template_ui_LocaleName);
+ yon_ubl_status_box_render(NOTHING_TO_SAVE_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
+ textdomain(template_app_information.app_locale);
+ if (save_failure_function){
+
+ struct save_return *data = malloc(sizeof(struct save_return));
+ data->save_success_argument = save_failure_argument;
+ data->file_return = NULL;
+ data->file_save = 0;
+ gdk_threads_add_idle((GSourceFunc)_yon_postsave_failure_function_start,data);
+ }
+ return 0;
+ }
+ return 1;
+}
+
+void yon_save_window_set_status(template_saving_window *window,char *path,YON_CONFIG_TYPE type){
+ textdomain(template_ui_LocaleName);
+ window->type=type;
+ window->custom_save_path=path;
+ if (type==YON_CONFIG_BOTH){
+ yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),"savingTarget",SAVING_GLOBAL_LOCAL_STATE_LABEL,BACKGROUND_IMAGE_INFO_TYPE);
+ } else if (type==YON_CONFIG_GLOBAL){
+ yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),"savingTarget",SAVING_GLOBAL_STATE_LABEL,BACKGROUND_IMAGE_INFO_TYPE);
+
+ } else if (type==YON_CONFIG_LOCAL){
+ yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),"savingTarget",SAVING_LOCAL_STATE_LABEL,BACKGROUND_IMAGE_INFO_TYPE);
+ } else if (type==YON_CONFIG_CUSTOM){
+ yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),"savingTarget",SAVING_CUSTOM_STATE_LABEL(path),BACKGROUND_IMAGE_INFO_TYPE);
+ }
+ textdomain(template_app_information.app_locale);
+}
+
+template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){
+ template_app_information = yon_ubl_get_app_info();
+ char *config_to_save = NULL;
+ config_to_save = yon_config_get_type_path(type);
+
+ if (!path&&type == YON_CONFIG_CUSTOM){
+ path = yon_custom_config_init();
+ }
+
+ va_list args;
+ struct loaded_config *config_compare=NULL;
+
+ va_start(args,type);
+ char *compare_command = yon_get_compare_config_command(args,path,type);
+ config_compare = yon_config_get_compared(compare_command); // get compare config
+
+ template_saving_window *window = yon_saving_window_new();
+ yon_save_window_set_status(window,path,type);
+
+ int current_size=0;
+ config_str current_config = yon_config_get_all(¤t_size); // get INTERNAL config
+
+ struct loaded_config *current_loaded = yon_config_convert_parameter(current_config,current_size); // convert INTERNAL config into struct
+
+ yon_save_window_loaded_config_init(window,current_loaded,config_compare);
+ yon_save_window_compared_config_init_unfound(window,current_loaded,config_compare);
+
+ if (!yon_save_window_destroy_if_empty(window))
+ return NULL;
+
+ gtk_tree_view_set_model(GTK_TREE_VIEW(window->ParametersTree),GTK_TREE_MODEL(window->list));
+ gtk_widget_show(window->Window);
+ on_save_window_parameter_switched(NULL,NULL,window);
+ return window;
+}
+
+template_saving_window *yon_saving_window_new(){
+ GtkBuilder *builder = gtk_builder_new_from_resource(ui_glade_path_saving);
+ template_saving_window *window = malloc(sizeof(template_saving_window));
+ window->Window = yon_gtk_builder_get_widget(builder,"Window");
+ window->HeaderImage = yon_gtk_builder_get_widget(builder,"HeaderImage");
+ window->HeaderTopic = yon_gtk_builder_get_widget(builder,"HeaderTopic");
+ window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox");
+ window->ParametersTree = yon_gtk_builder_get_widget(builder,"ParametersTree");
+ window->SaveButton = yon_gtk_builder_get_widget(builder,"SaveButton");
+ window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
+ window->ToggleCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"ToggleCell"));
+ window->list = GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore1"));
+ window->OldValueColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(builder,"OldValueColumn"));
+ window->OldValueCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"OldValueCell"));
+ window->NewValueColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(builder,"NewValueColumn"));
+ window->NewValueCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"NewValueCell"));
+ window->filteredModel = GTK_TREE_MODEL(gtk_builder_get_object(builder,"listfilter1"));
+ yon_window_config_custom_window_setup(GTK_WINDOW(window->Window),"SaveWindow");
+ char *icon_name = yon_char_append("com.ublinux.",template_app_information.app_tech_name);
+ gtk_window_set_icon_name(GTK_WINDOW(window->Window),icon_name);
+ gtk_window_set_title(GTK_WINDOW(window->Window),template_app_information.app_title);
+ gtk_label_set_text(GTK_LABEL(window->HeaderTopic),template_app_information.app_title);
+ gtk_image_set_from_pixbuf(GTK_IMAGE(window->HeaderImage),gtk_icon_theme_load_icon_for_scale(gtk_icon_theme_get_default(),yon_char_append("com.ublinux.",template_app_information.app_tech_name),32,1,GTK_ICON_LOOKUP_FORCE_SIZE,NULL));
+ g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
+ g_signal_connect(G_OBJECT(window->SaveButton),"clicked", G_CALLBACK(on_save_parameters),window);
+ g_signal_connect(G_OBJECT(window->ToggleCell),"toggled", G_CALLBACK(on_save_window_parameter_switched),window);
+ return window;
+}
\ No newline at end of file
diff --git a/source/libublsettingsui-gtk3.c b/source/libublsettingsui-gtk3.c
index 2f56656..90dcbc4 100644
--- a/source/libublsettingsui-gtk3.c
+++ b/source/libublsettingsui-gtk3.c
@@ -1,5 +1,4 @@
#include "libublsettingsui-gtk3.h"
-// #include "ubl-window-settings.h"
static char *__yon_config_mode=NULL;
@@ -114,339 +113,7 @@ void on_about(GtkWidget *self, char *version_application){
//functions
-/**function and argument, which called after successful config saving.
- * Example:
- * void on_save_done(main_window *widgets, config_str output, int size)
-*/
-void (*save_success_function)(void*,config_str,int)=NULL;
-void *save_success_argument=NULL;
-
-void yon_save_window_set_postsave_function(void *function, void *data){
- save_success_function=function;
- save_success_argument=data;
-}
-
-void on_save_window_parameter_switched(GtkCellRendererToggle *self, gchar *path, template_saving_window *window){
- GtkTreeIter iter,itar;
- if (path){
- if (gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(window->list),&itar,path)){
- gboolean is_active;
- gtk_tree_model_get(GTK_TREE_MODEL(window->list),&itar,0,&is_active,-1);
- gtk_list_store_set(window->list,&itar,0,!is_active,-1);
- }
- }
- int once_active=0;
- int valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&iter);
- for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&iter)){
- int is_active;
- gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,0,&is_active,-1);
- if (is_active){
- once_active=1;
- break;
- }
- }
- if (!once_active) gtk_widget_set_sensitive(window->SaveButton,0);
- else gtk_widget_set_sensitive(window->SaveButton,1);
-
-}
-
-template_debug_window *template_debugger_window_new(){
- template_debug_window *window = malloc(sizeof(template_debug_window));
- GtkBuilder *builder = gtk_builder_new_from_resource(ui_glade_path_debug);
- window->Window=yon_gtk_builder_get_widget(builder,"Window");
- window->HeaderTopic=yon_gtk_builder_get_widget(builder,"HeaderTopic");
- window->HeaderImage=yon_gtk_builder_get_widget(builder,"HeaderImage");
- window->StatusBox=yon_gtk_builder_get_widget(builder,"StatusBox");
- window->Vte=yon_gtk_builder_get_widget(builder,"DebuggerTerminal");
- gtk_window_set_title(GTK_WINDOW(window->Window),template_app_information.app_title);
- gtk_label_set_text(GTK_LABEL(window->HeaderTopic),template_app_information.app_title);
- gtk_window_set_icon_name(GTK_WINDOW(window->Window),yon_char_append("com.ublinux.",template_app_information.app_tech_name));
- gtk_image_set_from_pixbuf(GTK_IMAGE(window->HeaderImage),gtk_icon_theme_load_icon_for_scale(gtk_icon_theme_get_default(),yon_char_append("com.ublinux.",template_app_information.app_tech_name),32,1,GTK_ICON_LOOKUP_FORCE_SIZE,NULL));
-
- yon_window_config_custom_window_setup(GTK_WINDOW(window->Window),"DebugWindow");
- return window;
-}
-
-struct save_return {
- void *save_success_argument;
- config_str file_return;
- int file_save;
-};
-
-gboolean _yon_postsave_function_start(struct save_return *data){
- save_success_function(data->save_success_argument,data->file_return,data->file_save);
- return G_SOURCE_REMOVE;
-}
-
-void _yon_saving_threaded(char *final_command){
- FILE *file = popen(final_command,"r");
- int file_save;
- config_str file_return = yon_config_load_file(file,&file_save);
- fclose(file);
- file_return = yon_char_parsed_append(file_return,&file_save,final_command);
- if (save_success_function)
- {
- struct save_return *data = malloc(sizeof(struct save_return));
- data->save_success_argument = save_success_argument;
- data->file_return = file_return;
- data->file_save = file_save;
- gdk_threads_add_idle((GSourceFunc)_yon_postsave_function_start,data);
- }
-}
-
-void on_save_parameters(GtkWidget *self, template_saving_window *window){
- textdomain(template_ui_LocaleName);
- yon_ubl_status_box_render(SAVE_PROCESS_LABEL,BACKGROUND_IMAGE_INFO_TYPE);
- textdomain(template_app_information.app_locale);
- GtkTreeIter iter;
- GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(window->ParametersTree));
- int valid = gtk_tree_model_get_iter_first(model,&iter);
- int saved_size=0;
- config_str saved_parameters=NULL;
- for (;valid;valid = gtk_tree_model_iter_next(model,&iter)){
- char *parameter;
- int is_active;
- gtk_tree_model_get(model,&iter,0,&is_active,1,¶meter,-1);
- if (is_active){
- yon_char_parsed_add_or_create_if_exists(saved_parameters,&saved_size,parameter);
- }
-
- }
- int size=0;
- config_str commands = yon_config_get_save_parameters_by_list(&size,saved_parameters,saved_size);
- char *target = yon_config_get_type_path(window->type);
- if (target){
- if (yon_char_is_empty(target)){
- yon_char_parsed_prepend_strings(commands,size,ubconfig_dull_command);
- }
- else {
- yon_char_parsed_prepend_strings(commands,size,ubconfig_set_command(target));
- }
- } else {
- yon_char_parsed_prepend_strings(commands,size,ubconfig_set_command(window->custom_save_path));
- }
- char *final_command = yon_char_parsed_to_string(commands,size,";");
- pthread_t thread_id;
- pthread_create(&thread_id, NULL, (void *)_yon_saving_threaded,final_command);
-
- yon_window_config_custom_window_set(GTK_WINDOW(window->Window),"SaveWindow");
- on_subwindow_close(self);
-}
-
-struct loaded_config {
- dictionary_fields(loaded_config);
- char *section;
-};
-
-struct loaded_config *yon_config_convert_parameter(config_str parsed, int size){
- struct loaded_config *loaded=NULL;
- for (int i=0;ikey=key;
- loaded->first=loaded;
- loaded->next=NULL;
- loaded->prev=NULL;
- loaded->section=NULL;
- loaded->data=value;
- } else {
- loaded->next = (struct loaded_config*)malloc(sizeof(struct loaded_config));
- struct loaded_config *next=loaded->next;
- next->first=loaded->first;
- next->prev=loaded;
- next->key=key;
- next->first=loaded->first;
- next->next=NULL;
- next->section=NULL;
- next->data=value;
- loaded=next;
- }
- }
- return loaded;
-}
-
-struct loaded_config *yon_config_get_compared(char *command, int *final_size){
- if (command){
- *final_size=0;
- int size;
- config_str config = yon_config_load(command,&size);
- config_str temporary = NULL;
- int temp_size=0;
- if (config&&size>0){
- for (int i=0;iWindow = yon_gtk_builder_get_widget(builder,"Window");
- window->HeaderImage = yon_gtk_builder_get_widget(builder,"HeaderImage");
- window->HeaderTopic = yon_gtk_builder_get_widget(builder,"HeaderTopic");
- window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox");
- window->ParametersTree = yon_gtk_builder_get_widget(builder,"ParametersTree");
- window->SaveButton = yon_gtk_builder_get_widget(builder,"SaveButton");
- window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
- window->ToggleCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"ToggleCell"));
- window->list = GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore1"));
- window->OldValueColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(builder,"OldValueColumn"));
- window->OldValueCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"OldValueCell"));
- window->NewValueColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(builder,"NewValueColumn"));
- window->NewValueCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"NewValueCell"));
- window->type=type;
- window->filteredModel = GTK_TREE_MODEL(gtk_builder_get_object(builder,"listfilter1"));
- window->custom_save_path=path;
- yon_window_config_custom_window_setup(GTK_WINDOW(window->Window),"SaveWindow");
- gtk_window_set_icon_name(GTK_WINDOW(window->Window),yon_char_append("com.ublinux.",template_app_information.app_tech_name));
- gtk_window_set_title(GTK_WINDOW(window->Window),template_app_information.app_title);
- gtk_label_set_text(GTK_LABEL(window->HeaderTopic),template_app_information.app_title);
- gtk_image_set_from_pixbuf(GTK_IMAGE(window->HeaderImage),gtk_icon_theme_load_icon_for_scale(gtk_icon_theme_get_default(),yon_char_append("com.ublinux.",template_app_information.app_tech_name),32,1,GTK_ICON_LOOKUP_FORCE_SIZE,NULL));
- g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
- g_signal_connect(G_OBJECT(window->SaveButton),"clicked", G_CALLBACK(on_save_parameters),window);
- g_signal_connect(G_OBJECT(window->ToggleCell),"toggled", G_CALLBACK(on_save_window_parameter_switched),window);
- textdomain(template_ui_LocaleName);
- if (type==YON_CONFIG_BOTH){
- yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),"savingTarget",SAVING_GLOBAL_LOCAL_STATE_LABEL,BACKGROUND_IMAGE_INFO_TYPE);
- } else if (type==YON_CONFIG_GLOBAL){
- yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),"savingTarget",SAVING_GLOBAL_STATE_LABEL,BACKGROUND_IMAGE_INFO_TYPE);
-
- } else if (type==YON_CONFIG_LOCAL){
- yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),"savingTarget",SAVING_LOCAL_STATE_LABEL,BACKGROUND_IMAGE_INFO_TYPE);
- } else if (type==YON_CONFIG_CUSTOM){
- yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),"savingTarget",SAVING_CUSTOM_STATE_LABEL(path),BACKGROUND_IMAGE_INFO_TYPE);
- }
- textdomain(template_app_information.app_locale);
-
- int current_size=0;
- config_str current_config = yon_config_get_all(¤t_size);
-
- struct loaded_config *current_loaded = yon_config_convert_parameter(current_config,current_size);
-
- struct loaded_config *current = NULL;
- if (current_loaded){
- for_dictionaries(current,current_loaded){
- if (!yon_config_check_ignore(current->key)){
- dictionary *dict = yon_dictionary_get((dictionary**)&config_compare,current->key);
- gboolean status=0;
- status = yon_config_get_status(current->key);
- if (dict&&!yon_char_is_empty((char*)dict->data)&&status!=-2){
- if (strcmp((char*)dict->data,(char*)current->data)){
- GtkTreeIter iter;
- if (status==0||status==-2) status = 0;
- else status=1;
- char *compare_string = yon_char_unite("",(char*)dict->data,"\n",(char*)current->data,NULL);
- gtk_list_store_append(window->list,&iter);
- gtk_list_store_set(window->list,&iter,0,status,1,current->key,2,(char*)dict->data,3,(char*)current->data,4,compare_string,6,1,-1);
- free(compare_string);
- }
- } else if ((strcmp((char*)current->data,""))&&status!=-2){
- GtkTreeIter iter;
- if (status==0||status==-2) status = 0;
- else status=1;
- char *compare_string = yon_char_unite("\n",(char*)current->data,NULL);
- gtk_list_store_append(window->list,&iter);
- gtk_list_store_set(window->list,&iter,0,status,1,current->key,3,(char*)current->data,4,compare_string,6,1,-1);
- free(compare_string);
- }
- }
- }
- if (config_compare){
- for_dictionaries(current,config_compare){
- if (!yon_config_check_ignore(current->key)){
- GtkTreeIter iter;
- dictionary *dict = yon_dictionary_get((dictionary**)¤t_loaded,current->key);
- if (!dict){
- GdkRGBA rgba;
- rgba.alpha=0.8;
- rgba.red=1;
- rgba.blue=0.3;
- rgba.green=0.65;
- char *rgba_string = gdk_rgba_to_string(&rgba);
- int status=0;
- char *compare_string = yon_char_unite((char*)current->data,"\n",NULL);
- gtk_list_store_append(window->list,&iter);
- gtk_list_store_set(window->list,&iter,0,0,1,current->key,2,(char*)current->data,4,compare_string,5,rgba_string,6,1,-1);
- free(compare_string);
- }
- }
- }
- }
- }
- GtkTreeIter iter;
- if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&iter)){
- gtk_widget_destroy(window->Window);
- textdomain(template_ui_LocaleName);
- yon_ubl_status_box_render(NOTHING_TO_SAVE_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
- textdomain(template_app_information.app_locale);
- return NULL;
- }
- gtk_tree_view_set_model(GTK_TREE_VIEW(window->ParametersTree),GTK_TREE_MODEL(window->list));
- gtk_widget_show(window->Window);
- on_save_window_parameter_switched(NULL,NULL,window);
- return window;
-}
int yon_confirmation_dialog_call(GtkWidget *self,dialog_confirmation_data *data){
textdomain(template_ui_LocaleName);
@@ -488,7 +155,7 @@ int yon_confirmation_dialog_call(GtkWidget *self,dialog_confirmation_data *data)
gtk_widget_show(label);
gtk_label_set_line_wrap_mode(GTK_LABEL(label),PANGO_WRAP_WORD);
gtk_label_set_line_wrap(GTK_LABEL(label),1);
- gtk_label_set_text(GTK_LABEL(label),data->action_text);
+ gtk_label_set_markup(GTK_LABEL(label),data->action_text);
GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,5);
gtk_widget_show(box);
@@ -650,6 +317,10 @@ void yon_gtk_scrolled_window_set_horizontal_at_desired_size(GtkWidget *window, G
g_signal_connect(G_OBJECT(window),"check-resize",G_CALLBACK(__yon_on_size_changed),target);
}
+template_app_info yon_ubl_get_app_info(){
+ return template_app_information;
+}
+
int yon_ubl_window_init(char *app_title, char *app_description, char *locale, char *css, char *tech_name, char *version, char *wiki){
template_app_information.app_title=app_title;
template_app_information.css_path=css;
diff --git a/source/libublsettingsui-gtk3.h b/source/libublsettingsui-gtk3.h
index 39d9c4b..65acbd2 100644
--- a/source/libublsettingsui-gtk3.h
+++ b/source/libublsettingsui-gtk3.h
@@ -30,76 +30,6 @@
#define remove_config_dir_command yon_char_unite("rm -rfd ", yon_ubl_user_get_home_directory(),"/.config/",template_app_information.app_tech_name,"/",NULL)
-#ifndef UBL_UI
- #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\t--help, -h\t\t\t",_("Show this help"),"\n\t--version, -V\t\t\t",_("Show package version"),"\n\t--lock-help\t\t\t",_("Lock this help menu"),"\n\t--lock-save\t\t\t",_("Lock configuration saving"),"\n\t--lock-save-local\t\t",_("Lock local configration saving"),"\n\t--lock-save-global\t\t",_("Lock global configration saving"),"\n\t--lock-load-global\t\t",_("Lock global configration loading"),"\n\t--clear-config\t\t\t",_("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 SUCCESS_LABEL _("Operation succeeded")
- #define ROOT_WARNING_LABEL _("Warning! Application was launched without root - root-dependent actions are locked")
-
- #define ABOUT_LABEL _("About")
- #define DOCUMENTATION_LABEL _("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 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 CANCEL_LABEL _("Cancel")
- #define ACCEPT_LABEL _("Accept")
- #define OPEN_LABEL _("Open")
-
- #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 - 2023, 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 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 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 _("Upgrade to root")
- #define SETTINGS_TITLE_LABEL _("Settings")
-#endif
#define dull_parameter_get_command "ubconfig --source global get users PARAMETER"
@@ -135,6 +65,7 @@ typedef struct {
gboolean always_open_documentation;
} template_app_info;
+
static template_app_info template_app_information;
@@ -158,6 +89,7 @@ static template_app_info template_app_information;
typedef struct {
template_config_fields
} _template_config;
+[[maybe_unused]]
static _template_config *template_config;
#define template_window_fields\
@@ -206,25 +138,6 @@ typedef struct {
GtkWidget *AcceptButton;
} template_documentation_confirmation_window;
-typedef struct {
- GtkWidget *Window;
- GtkWidget *HeaderTopic;
- GtkWidget *HeaderImage;
- GtkWidget *StatusBox;
- GtkWidget *ParametersTree;
- GtkCellRenderer *ToggleCell;
- GtkWidget *CancelButton;
- GtkWidget *SaveButton;
- GtkListStore *list;
- GtkTreeModel *filteredModel;
- GtkTreeViewColumn *OldValueColumn;
- GtkCellRenderer *OldValueCell;
- GtkTreeViewColumn *NewValueColumn;
- GtkCellRenderer *NewValueCell;
- YON_CONFIG_TYPE type;
- char *custom_save_path;
-} template_saving_window;
-
typedef struct {
GtkWidget *Window;
GtkWidget *HeaderTopic;
@@ -241,10 +154,6 @@ typedef struct {
int yon_confirmation_dialog_call(GtkWidget *self,dialog_confirmation_data *data);
-void yon_save_window_set_postsave_function(void *function, void *data);
-
-template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...);
-
/**yon_open_browser(GtkWidget *self, char *link)
* [EN]
* Opens browser with [link] link.
@@ -308,4 +217,103 @@ void on_open_documentation_confirmation(GtkWidget *self, char *link);
int yon_ubl_setup_arguments(int argc, char *argv[],config_str *unfound_arguments, int *arguments_size, char *additional_options_output);
void yon_gtk_scrolled_window_set_horizontal_at_desired_size(GtkWidget *window, GtkScrolledWindow *target);
+
+template_app_info yon_ubl_get_app_info();
+
+
+typedef struct {
+ GtkWidget *Window;
+ GtkWidget *HeaderTopic;
+ GtkWidget *HeaderImage;
+ GtkWidget *StatusBox;
+ GtkWidget *ParametersTree;
+ GtkCellRenderer *ToggleCell;
+ GtkWidget *CancelButton;
+ GtkWidget *SaveButton;
+ GtkListStore *list;
+ GtkTreeModel *filteredModel;
+ GtkTreeViewColumn *OldValueColumn;
+ GtkCellRenderer *OldValueCell;
+ GtkTreeViewColumn *NewValueColumn;
+ GtkCellRenderer *NewValueCell;
+ YON_CONFIG_TYPE type;
+ char *custom_save_path;
+} template_saving_window;
+
+
+void yon_save_window_set_postsave_function(void *function, void *data);
+
+void yon_save_window_set_postsave_failure_function(void *function, void *data);
+
+template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...);
+
+
+ #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\t--help, -h\t\t\t",_("Show this help"),"\n\t--version, -V\t\t\t",_("Show package version"),"\n\t--lock-help\t\t\t",_("Lock this help menu"),"\n\t--lock-save\t\t\t",_("Lock configuration saving"),"\n\t--lock-save-local\t\t",_("Lock local configration saving"),"\n\t--lock-save-global\t\t",_("Lock global configration saving"),"\n\t--lock-load-global\t\t",_("Lock global configration loading"),"\n\t--clear-config\t\t\t",_("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 SUCCESS_LABEL _("Operation succeeded")
+ #define ROOT_WARNING_LABEL _("Warning! Application was launched without root - root-dependent actions are locked")
+
+ #define ABOUT_LABEL _("About")
+ #define DOCUMENTATION_LABEL _("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 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 CANCEL_LABEL _("Cancel")
+ #define ACCEPT_LABEL _("Accept")
+ #define OPEN_LABEL _("Open")
+
+ #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 - 2023, 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 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 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 _("Upgrade to root")
+ #define SETTINGS_TITLE_LABEL _("Settings")
#endif
\ No newline at end of file