@ -117,25 +117,6 @@ void _yon_saving_threaded(char *final_command){
free ( result ) ;
}
char * yon_save_command_prepare ( char * command , char * target ) {
int size ;
config_str parsed = yon_char_parse ( command , & size , " " ) ;
free ( parsed [ 2 ] ) ;
parsed [ 2 ] = yon_char_new ( target ) ;
free ( parsed [ 3 ] ) ;
parsed [ 3 ] = yon_char_new ( " set " ) ;
for ( int i = 5 ; i < size ; i + + ) {
char * cur = yon_config_get_by_key ( parsed [ i ] ) ;
char * full_value = yon_char_unite ( parsed [ i ] , " =' " , cur , " ' " , NULL ) ;
free ( parsed [ i ] ) ;
parsed [ i ] = full_value ;
}
char * final = yon_char_parsed_to_string ( parsed , size , " " ) ;
yon_char_parsed_free ( parsed , size ) ;
return final ;
}
void yon_save_proceed ( char * path , YON_CONFIG_TYPE type ) ;
void yon_save_proceed ( char * path , YON_CONFIG_TYPE type ) {
yon_debug_output ( " %s \n " , yon_config_save_simple ( type , path ) ) ;
@ -449,21 +430,31 @@ void yon_interface_update(main_window *widgets){
gtk_entry_set_text ( GTK_ENTRY ( widgets - > UserNameEntry ) , " " ) ;
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( widgets - > UsernameSensitiveCheck ) , 0 ) ;
}
if ( ! yon_char_is_empty ( user_password ) ) {
gtk_entry_set_text ( GTK_ENTRY ( widgets - > PasswordEntry ) , user_password ) ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( widgets - > PasswordCombo ) , 1 ) ;
} else {
int def_size ;
config_str default_password = NULL ;
if ( ! getuid ( ) ) {
default_password = yon_config_load ( get_default_password_command , & def_size ) ;
if ( def_size ) {
yon_char_remove_last_symbol ( default_password [ 0 ] , ' \n ' ) ;
}
}
if ( ( def_size & & ! strcmp ( default_password [ 0 ] , user_password ) ) | | yon_char_is_empty ( user_password ) ) {
gtk_combo_box_set_active ( GTK_COMBO_BOX ( widgets - > PasswordCombo ) , 0 ) ;
gtk_entry_set_text ( GTK_ENTRY ( widgets - > PasswordEntry ) , " " ) ;
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( widgets - > PasswordSensitiveCheck ) , 0 ) ;
} else if ( ! yon_char_is_empty ( user_password ) ) {
gtk_entry_set_text ( GTK_ENTRY ( widgets - > PasswordEntry ) , user_password ) ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( widgets - > PasswordCombo ) , 1 ) ;
}
if ( ! yon_char_is_empty ( root_password ) ) {
gtk_entry_set_text ( GTK_ENTRY ( widgets - > AdminPasswordEntry ) , root_password ) ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( widgets - > AdminPasswordCombo ) , 1 ) ;
} else {
if ( ( def_size & & ! strcmp ( default_password [ 0 ] , user_password ) ) | | yon_char_is_empty ( user_password ) ) {
gtk_combo_box_set_active ( GTK_COMBO_BOX ( widgets - > AdminPasswordCombo ) , 0 ) ;
gtk_entry_set_text ( GTK_ENTRY ( widgets - > AdminPasswordEntry ) , " " ) ;
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( widgets - > RootPasswordSensitiveCheck ) , 0 ) ;
} else if ( ! yon_char_is_empty ( root_password ) ) {
gtk_entry_set_text ( GTK_ENTRY ( widgets - > AdminPasswordEntry ) , root_password ) ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( widgets - > AdminPasswordCombo ) , 1 ) ;
}
if ( ! yon_char_is_empty ( autologin ) ) {
if ( ! strcmp ( autologin , " yes " ) )