|
|
|
@ -193,7 +193,7 @@ gboolean yon_user_set_locales(GtkWidget *target){
|
|
|
|
char *languages_string = config(LOCALE_parameter);
|
|
|
|
char *languages_string = config(LOCALE_parameter);
|
|
|
|
int languages_size;
|
|
|
|
int languages_size;
|
|
|
|
config_str languages = yon_char_parse(languages_string,&languages_size,",");
|
|
|
|
config_str languages = yon_char_parse(languages_string,&languages_size,",");
|
|
|
|
GHashTable *hash = g_object_get_data(G_OBJECT(target),"hash");
|
|
|
|
GHashTable *hash = main_config.locales_hash;
|
|
|
|
char *config_lang = g_object_get_data(G_OBJECT(target),"value");
|
|
|
|
char *config_lang = g_object_get_data(G_OBJECT(target),"value");
|
|
|
|
for (int i=0;i<languages_size;i++){
|
|
|
|
for (int i=0;i<languages_size;i++){
|
|
|
|
char *locale_str = g_hash_table_lookup(hash,languages[i]);
|
|
|
|
char *locale_str = g_hash_table_lookup(hash,languages[i]);
|
|
|
|
@ -206,22 +206,18 @@ gboolean yon_user_set_locales(GtkWidget *target){
|
|
|
|
if (!yon_char_is_empty(config_lang)){
|
|
|
|
if (!yon_char_is_empty(config_lang)){
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(target),config_lang);
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(target),config_lang);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
gtk_widget_set_sensitive(target,1);
|
|
|
|
|
|
|
|
return G_SOURCE_REMOVE;
|
|
|
|
return G_SOURCE_REMOVE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void *yon_load_languages(void *target){
|
|
|
|
void *yon_load_languages(void *){
|
|
|
|
int size;
|
|
|
|
int size;
|
|
|
|
config_str locales = yon_config_load(languages_command,&size);
|
|
|
|
config_str locales = yon_config_load(languages_command,&size);
|
|
|
|
GHashTable *hash = g_hash_table_new(g_str_hash,g_str_equal);
|
|
|
|
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
yon_char_remove_last_symbol(locales[i],'\n');
|
|
|
|
yon_char_remove_last_symbol(locales[i],'\n');
|
|
|
|
int parsed_size;
|
|
|
|
int parsed_size;
|
|
|
|
config_str parsed = yon_char_parse(locales[i],&parsed_size,"|");
|
|
|
|
config_str parsed = yon_char_parse(locales[i],&parsed_size,"|");
|
|
|
|
g_hash_table_insert(hash,yon_char_new(parsed[0]),yon_char_new(locales[i]));
|
|
|
|
g_hash_table_insert(main_config.locales_hash,yon_char_new(parsed[0]),yon_char_new(locales[i]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
g_object_set_data(G_OBJECT(target),"hash",hash);
|
|
|
|
|
|
|
|
g_idle_add((GSourceFunc)yon_user_set_locales,target);
|
|
|
|
|
|
|
|
g_thread_exit(NULL);
|
|
|
|
g_thread_exit(NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -275,7 +271,6 @@ ubl_settings_usergroups_user_window *yon_ubl_settings_usergroups_user_new(){
|
|
|
|
window->MainNotebook=yon_gtk_builder_get_widget(builder,"MainNotebook");
|
|
|
|
window->MainNotebook=yon_gtk_builder_get_widget(builder,"MainNotebook");
|
|
|
|
window->expiration_unix=NULL;
|
|
|
|
window->expiration_unix=NULL;
|
|
|
|
window->last_uid=NULL;
|
|
|
|
window->last_uid=NULL;
|
|
|
|
window->locale_thread=NULL;
|
|
|
|
|
|
|
|
yon_gtk_entry_block_symbols(GTK_ENTRY(window->userUserNameEntry),"'\":\n");
|
|
|
|
yon_gtk_entry_block_symbols(GTK_ENTRY(window->userUserNameEntry),"'\":\n");
|
|
|
|
yon_gtk_entry_block_symbols(GTK_ENTRY(window->userLoginEntry),"'\"=:\n");
|
|
|
|
yon_gtk_entry_block_symbols(GTK_ENTRY(window->userLoginEntry),"'\"=:\n");
|
|
|
|
|
|
|
|
|
|
|
|
@ -298,7 +293,6 @@ ubl_settings_usergroups_user_window *yon_ubl_settings_usergroups_user_new(){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(window->userShellCombo),"Set",SET_LABEL);
|
|
|
|
gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(window->userShellCombo),"Set",SET_LABEL);
|
|
|
|
yon_char_parsed_free(shells,shell_size);
|
|
|
|
yon_char_parsed_free(shells,shell_size);
|
|
|
|
window->locale_thread=g_thread_new("locales",(GThreadFunc)yon_load_languages,window->LanguageCombo);
|
|
|
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->userShellCombo),0);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->userShellCombo),0);
|
|
|
|
window->old_password=NULL;
|
|
|
|
window->old_password=NULL;
|
|
|
|
window->old_username=NULL;
|
|
|
|
window->old_username=NULL;
|
|
|
|
@ -416,7 +410,6 @@ void on_user_login_update(GtkWidget *, ubl_settings_usergroups_user_window *wind
|
|
|
|
void on_user_save(GtkWidget *self, dictionary *dict){
|
|
|
|
void on_user_save(GtkWidget *self, dictionary *dict){
|
|
|
|
main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
|
|
|
|
main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
|
|
|
|
ubl_settings_usergroups_user_window *window = yon_dictionary_get_data(dict->first->next,ubl_settings_usergroups_user_window*);
|
|
|
|
ubl_settings_usergroups_user_window *window = yon_dictionary_get_data(dict->first->next,ubl_settings_usergroups_user_window*);
|
|
|
|
g_thread_join(window->locale_thread);
|
|
|
|
|
|
|
|
yon_ubl_status_box_despawn(GTK_CONTAINER(window->StatusBox));
|
|
|
|
yon_ubl_status_box_despawn(GTK_CONTAINER(window->StatusBox));
|
|
|
|
char *final_user="";
|
|
|
|
char *final_user="";
|
|
|
|
char *uid_string = NULL;
|
|
|
|
char *uid_string = NULL;
|
|
|
|
|