|
|
|
@ -7,10 +7,6 @@ void yon_config_save_proceed(char *path, YON_CONFIG_TYPE type){
|
|
|
|
void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
if (type!=YON_CONFIG_CUSTOM){
|
|
|
|
if (type!=YON_CONFIG_CUSTOM){
|
|
|
|
yon_config_clean();
|
|
|
|
yon_config_clean();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(config_get_default_command)){
|
|
|
|
|
|
|
|
yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (main_config.config_load_path){
|
|
|
|
if (main_config.config_load_path){
|
|
|
|
if (main_config.startup_config){
|
|
|
|
if (main_config.startup_config){
|
|
|
|
yon_config_restore(NULL);
|
|
|
|
yon_config_restore(NULL);
|
|
|
|
@ -19,6 +15,10 @@ void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
main_config.startup_config = NULL;
|
|
|
|
main_config.startup_config = NULL;
|
|
|
|
yon_config_custom_load_config(&main_config.startup_config,config_get_command(main_config.config_load_path),NULL);
|
|
|
|
yon_config_custom_load_config(&main_config.startup_config,config_get_command(main_config.config_load_path),NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(config_get_default_command)){
|
|
|
|
|
|
|
|
yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL);
|
|
|
|
|
|
|
|
}
|
|
|
|
switch (type){
|
|
|
|
switch (type){
|
|
|
|
case YON_CONFIG_LOCAL:
|
|
|
|
case YON_CONFIG_LOCAL:
|
|
|
|
main_config.config_load_path = yon_char_new("system");
|
|
|
|
main_config.config_load_path = yon_char_new("system");
|
|
|
|
@ -30,6 +30,14 @@ void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
char *path = NULL;
|
|
|
|
char *path = NULL;
|
|
|
|
path=yon_custom_config_init(GTK_FILE_CHOOSER_ACTION_OPEN);
|
|
|
|
path=yon_custom_config_init(GTK_FILE_CHOOSER_ACTION_OPEN);
|
|
|
|
if (!yon_char_is_empty(path)){
|
|
|
|
if (!yon_char_is_empty(path)){
|
|
|
|
|
|
|
|
if (main_config.config_load_path){
|
|
|
|
|
|
|
|
if (main_config.startup_config){
|
|
|
|
|
|
|
|
yon_config_restore(NULL);
|
|
|
|
|
|
|
|
yon_config_custom_clean(main_config.startup_config);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
main_config.startup_config = NULL;
|
|
|
|
|
|
|
|
yon_config_custom_load_config(&main_config.startup_config,config_get_command(main_config.config_load_path),NULL);
|
|
|
|
|
|
|
|
}
|
|
|
|
main_config.config_load_path = yon_char_new(path);
|
|
|
|
main_config.config_load_path = yon_char_new(path);
|
|
|
|
main_config.config_save_path = main_config.config_load_path;
|
|
|
|
main_config.config_save_path = main_config.config_load_path;
|
|
|
|
yon_config_clean();
|
|
|
|
yon_config_clean();
|
|
|
|
|