|
|
|
@ -4,8 +4,36 @@ 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){
|
|
|
|
yon_config_clean();
|
|
|
|
if (type!=YON_CONFIG_CUSTOM){
|
|
|
|
|
|
|
|
yon_config_clean();
|
|
|
|
|
|
|
|
}
|
|
|
|
if (!yon_char_is_empty(config_get_default_command))
|
|
|
|
if (!yon_char_is_empty(config_get_default_command))
|
|
|
|
yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL);
|
|
|
|
yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL);
|
|
|
|
if (type==YON_CONFIG_GLOBAL){
|
|
|
|
if (type==YON_CONFIG_GLOBAL){
|
|
|
|
@ -31,12 +59,13 @@ int yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
path=yon_char_unite("'",file,"'",NULL);
|
|
|
|
path=yon_char_unite("'",file,"'",NULL);
|
|
|
|
main_config.custom_load_path = path;
|
|
|
|
main_config.custom_load_path = path;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
yon_config_clean();
|
|
|
|
|
|
|
|
yon_config_load_config(type,config_get_command(path),NULL);
|
|
|
|
gtk_widget_destroy(dialog);
|
|
|
|
gtk_widget_destroy(dialog);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
gtk_widget_destroy(dialog);
|
|
|
|
gtk_widget_destroy(dialog);
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yon_config_load_config(type,config_get_command(path),NULL);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
|
|
@ -191,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){
|
|
|
|
@ -277,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){
|
|
|
|
@ -288,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){
|
|
|
|
@ -296,10 +328,10 @@ 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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -366,6 +398,9 @@ void on_locale_open(GtkWidget *self, main_window *widgets){
|
|
|
|
g_signal_connect(G_OBJECT(window->CloseButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(window->CloseButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_locale_accept),dict);
|
|
|
|
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_locale_accept),dict);
|
|
|
|
g_signal_connect(G_OBJECT(window->MainTree),"row-activated",G_CALLBACK(on_locale_toggle),window);
|
|
|
|
g_signal_connect(G_OBJECT(window->MainTree),"row-activated",G_CALLBACK(on_locale_toggle),window);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),TITLE_LABEL,main_icon,"LocalesWindow");
|
|
|
|
|
|
|
|
|
|
|
|
gtk_dialog_run(GTK_DIALOG(window->Window));
|
|
|
|
gtk_dialog_run(GTK_DIALOG(window->Window));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -597,6 +632,8 @@ connection_window *yon_connection_window_new(){
|
|
|
|
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(window->StatusEntry),"clicked",G_CALLBACK(on_status_clicked),window);
|
|
|
|
g_signal_connect(G_OBJECT(window->StatusEntry),"clicked",G_CALLBACK(on_status_clicked),window);
|
|
|
|
g_signal_connect(G_OBJECT(window->CheckButton),"clicked",G_CALLBACK(yon_update_thread),window);
|
|
|
|
g_signal_connect(G_OBJECT(window->CheckButton),"clicked",G_CALLBACK(yon_update_thread),window);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(window->PasswordEntry));
|
|
|
|
return window;
|
|
|
|
return window;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -709,6 +746,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){
|
|
|
|
@ -847,6 +885,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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|