|
|
|
@ -4,7 +4,7 @@ config main_config;
|
|
|
|
|
|
|
|
|
|
|
|
//functions
|
|
|
|
//functions
|
|
|
|
|
|
|
|
|
|
|
|
void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
int yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
yon_config_clean();
|
|
|
|
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);
|
|
|
|
@ -15,8 +15,12 @@ void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
yon_config_load_config(type,config_get_command("system"),NULL);
|
|
|
|
yon_config_load_config(type,config_get_command("system"),NULL);
|
|
|
|
} else if (type==YON_CONFIG_CUSTOM){
|
|
|
|
} else if (type==YON_CONFIG_CUSTOM){
|
|
|
|
char *path;
|
|
|
|
char *path;
|
|
|
|
|
|
|
|
textdomain(template_ui_LocaleName);
|
|
|
|
GtkWidget *dialog = gtk_file_chooser_dialog_new(template_app_information.app_title,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,CANCEL_LABEL,GTK_RESPONSE_CANCEL,OPEN_LABEL,GTK_RESPONSE_ACCEPT,NULL);
|
|
|
|
GtkWidget *dialog = gtk_file_chooser_dialog_new(template_app_information.app_title,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,CANCEL_LABEL,GTK_RESPONSE_CANCEL,OPEN_LABEL,GTK_RESPONSE_ACCEPT,NULL);
|
|
|
|
|
|
|
|
textdomain(LocaleName);
|
|
|
|
|
|
|
|
yon_gtk_window_setup(GTK_WINDOW(dialog),NULL,TITLE_LABEL,main_icon,"LoadWindow");
|
|
|
|
GtkFileFilter *filter = gtk_file_filter_new();
|
|
|
|
GtkFileFilter *filter = gtk_file_filter_new();
|
|
|
|
|
|
|
|
gtk_file_filter_set_name(filter,"*.ini");
|
|
|
|
gtk_file_filter_add_pattern(filter,"*.ini");
|
|
|
|
gtk_file_filter_add_pattern(filter,"*.ini");
|
|
|
|
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog),filter);
|
|
|
|
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog),filter);
|
|
|
|
gtk_widget_show(dialog);
|
|
|
|
gtk_widget_show(dialog);
|
|
|
|
@ -30,10 +34,11 @@ void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
gtk_widget_destroy(dialog);
|
|
|
|
gtk_widget_destroy(dialog);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
gtk_widget_destroy(dialog);
|
|
|
|
gtk_widget_destroy(dialog);
|
|
|
|
return;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yon_config_load_config(type,config_get_command(path),NULL);
|
|
|
|
yon_config_load_config(type,config_get_command(path),NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -197,6 +202,8 @@ void yon_config_global_local_save(){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void yon_config_custom_load(GtkWidget *self, main_window *widgets){
|
|
|
|
void yon_config_custom_load(GtkWidget *self, main_window *widgets){
|
|
|
|
|
|
|
|
if (!yon_load_proceed(YON_CONFIG_CUSTOM))
|
|
|
|
|
|
|
|
return;
|
|
|
|
g_signal_handlers_block_by_func(G_OBJECT(widgets->IDEntry),G_CALLBACK(on_id_changed),widgets);
|
|
|
|
g_signal_handlers_block_by_func(G_OBJECT(widgets->IDEntry),G_CALLBACK(on_id_changed),widgets);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->HostnameEntry),"");
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->HostnameEntry),"");
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->IDEntry),"");
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->IDEntry),"");
|
|
|
|
@ -208,7 +215,6 @@ void yon_config_custom_load(GtkWidget *self, main_window *widgets){
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->IDEntry),*rtn);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->IDEntry),*rtn);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->ConsoleFontCombo),0);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->ConsoleFontCombo),0);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->LanguageCombo),0);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->LanguageCombo),0);
|
|
|
|
yon_load_proceed(YON_CONFIG_CUSTOM);
|
|
|
|
|
|
|
|
char *hostname = yon_config_get_by_key(hostname_parameter);
|
|
|
|
char *hostname = yon_config_get_by_key(hostname_parameter);
|
|
|
|
if (!yon_char_is_empty(hostname)){
|
|
|
|
if (!yon_char_is_empty(hostname)){
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->HostnameEntry),hostname);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->HostnameEntry),hostname);
|
|
|
|
|