Fixed loading

pull/59/head
parent 6ab4ddb611
commit d7cebab383

@ -60,10 +60,16 @@ add_custom_target(
) )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \
-O2 -pipe -fno-plt -fexceptions \ -O2 -pipe -fno-plt -fexceptions \
-Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \ -Wformat -Werror=format-security \
-fstack-clash-protection -fcf-protection") -fstack-clash-protection -fcf-protection")
string(FIND "${CMAKE_CXX_FLAGS}" "-D_FORTIFY_SOURCE" FORTIFY_FOUND)
if(FORTIFY_FOUND EQUAL -1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wp,-D_FORTIFY_SOURCE=2")
endif()
set(SOURCE_FILES set(SOURCE_FILES
ubl-settings-system.c ubl-settings-system.c

@ -1 +0,0 @@
#cmakedefine WEBKIT_FOUND

@ -4,6 +4,32 @@ config main_config;
//functions //functions
void on_save_done(main_window *widgets, 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;
case 3:
yon_ubl_status_box_render(SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
}
textdomain(LocaleName);
}
int yon_load_proceed(YON_CONFIG_TYPE type){ int yon_load_proceed(YON_CONFIG_TYPE type){
if (type!=YON_CONFIG_CUSTOM){ if (type!=YON_CONFIG_CUSTOM){
yon_config_clean(); yon_config_clean();
@ -194,6 +220,7 @@ void yon_config_global_load(GtkWidget *self, main_window *widgets){
} }
void yon_config_global_local_save(){ void yon_config_global_local_save(){
main_config.save_config=2;
int changed = yon_config_get_status(id_parameter)==1; int changed = yon_config_get_status(id_parameter)==1;
template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_BOTH,config_get_command("global"),NULL); template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_BOTH,config_get_command("global"),NULL);
if (window){ if (window){
@ -280,6 +307,7 @@ void yon_config_custom_load(GtkWidget *self, main_window *widgets){
} }
void yon_config_local_save(){ void yon_config_local_save(){
main_config.save_config=1;
int changed = yon_config_get_status(id_parameter)==1; int changed = yon_config_get_status(id_parameter)==1;
template_saving_window *window = yon_save_proceed("system",YON_CONFIG_LOCAL,config_get_command("system"),NULL); template_saving_window *window = yon_save_proceed("system",YON_CONFIG_LOCAL,config_get_command("system"),NULL);
if (window){ if (window){
@ -291,6 +319,7 @@ void yon_config_local_save(){
} }
void yon_config_global_save(){ void yon_config_global_save(){
main_config.save_config=0;
int changed = yon_config_get_status(id_parameter)==1; int changed = yon_config_get_status(id_parameter)==1;
template_saving_window *window = yon_save_proceed("global",YON_CONFIG_GLOBAL,config_get_command("global"),NULL); template_saving_window *window = yon_save_proceed("global",YON_CONFIG_GLOBAL,config_get_command("global"),NULL);
if (window){ if (window){
@ -303,6 +332,7 @@ void yon_config_global_save(){
} }
void yon_config_custom_save(){ void yon_config_custom_save(){
main_config.save_config=3;
template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_CUSTOM,config_get_command("system"),NULL); template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_CUSTOM,config_get_command("system"),NULL);
} }
@ -714,6 +744,7 @@ void config_init(){
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.domain_connected=0; main_config.domain_connected=0;
main_config.save_config=0;
} }
void on_check_domain_connected(GtkWidget *self, main_window *widgets){ void on_check_domain_connected(GtkWidget *self, main_window *widgets){
@ -852,6 +883,7 @@ main_window *yon_main_window_complete(main_window *widgets){
char *domain = yon_config_get_by_key(DOMAIN); char *domain = yon_config_get_by_key(DOMAIN);
if (!yon_char_is_empty(domain)) if (!yon_char_is_empty(domain))
gtk_entry_set_text(GTK_ENTRY(widgets->DomainEntry),domain); gtk_entry_set_text(GTK_ENTRY(widgets->DomainEntry),domain);
yon_save_window_set_postsave_function(on_save_done,widgets);
return widgets; return widgets;
} }

@ -98,6 +98,7 @@ char *local;
typedef struct { typedef struct {
template_config_fields template_config_fields
GtkListStore *localeslist; GtkListStore *localeslist;
int save_config;
int domain_connected; int domain_connected;
} config; } config;

Loading…
Cancel
Save