|
|
|
@ -631,10 +631,7 @@ void on_locale_changed(GtkWidget *,main_window *widgets){
|
|
|
|
gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->InstallerCountryFilter));
|
|
|
|
gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->InstallerCountryFilter));
|
|
|
|
char *config_code = config(installer_lang_parameter);
|
|
|
|
char *config_code = config(installer_lang_parameter);
|
|
|
|
if (yon_char_is_empty(config_code)){
|
|
|
|
if (yon_char_is_empty(config_code)){
|
|
|
|
config_code = yon_char_new(setlocale(LC_ALL,NULL));
|
|
|
|
config_code = setlocale(LC_ALL,NULL);
|
|
|
|
if (strstr(config_code,".")){
|
|
|
|
|
|
|
|
yon_char_divide_search_self(config_code,".",-1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GtkTreeIter itar;
|
|
|
|
GtkTreeIter itar;
|
|
|
|
for_iter(widgets->InstallerCountryFilter,&iter){
|
|
|
|
for_iter(widgets->InstallerCountryFilter,&iter){
|
|
|
|
@ -653,13 +650,15 @@ void on_locale_changed(GtkWidget *,main_window *widgets){
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_installer_language_changed(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_installer_language_changed(GtkWidget *self,GtkTreePath*,GtkTreeViewColumn*, main_window *widgets){
|
|
|
|
char *window_language;
|
|
|
|
char *window_language;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreeModel *model;
|
|
|
|
GtkTreeModel *model;
|
|
|
|
if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->CountryLanguagesTree)),&model,&iter)) return;
|
|
|
|
if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->CountryLanguagesTree)),&model,&iter)) return;
|
|
|
|
gtk_tree_model_get(model,&iter,2,&window_language,-1);
|
|
|
|
gtk_tree_model_get(model,&iter,2,&window_language,-1);
|
|
|
|
if (!yon_char_is_empty(window_language)){
|
|
|
|
if (!yon_char_is_empty(window_language)){
|
|
|
|
|
|
|
|
char *prev_lang = config(installer_lang_parameter);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(prev_lang)&&!strcmp(prev_lang,window_language)) return;
|
|
|
|
yon_config_register(installer_lang_parameter,installer_lang_parameter_command,(char*)window_language);
|
|
|
|
yon_config_register(installer_lang_parameter,installer_lang_parameter_command,(char*)window_language);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
char *active_lang_id = gtk_tree_model_get_string_from_iter(model,&iter);
|
|
|
|
char *active_lang_id = gtk_tree_model_get_string_from_iter(model,&iter);
|
|
|
|
@ -703,7 +702,7 @@ void set_locales_list(main_window *widgets){
|
|
|
|
gtk_list_store_clear(widgets->InstallerLanguageList);
|
|
|
|
gtk_list_store_clear(widgets->InstallerLanguageList);
|
|
|
|
gtk_list_store_clear(widgets->InstallerCountryList);
|
|
|
|
gtk_list_store_clear(widgets->InstallerCountryList);
|
|
|
|
|
|
|
|
|
|
|
|
char *config_code = config(installer_lang_parameter);
|
|
|
|
char *config_code = yon_char_new(config(installer_lang_parameter));
|
|
|
|
int size;
|
|
|
|
int size;
|
|
|
|
config_str locales = yon_locale_get_all_codes(&size);
|
|
|
|
config_str locales = yon_locale_get_all_codes(&size);
|
|
|
|
qsort(locales,size,sizeof(char*),yon_char_parsed_compare);
|
|
|
|
qsort(locales,size,sizeof(char*),yon_char_parsed_compare);
|
|
|
|
@ -712,6 +711,7 @@ void set_locales_list(main_window *widgets){
|
|
|
|
textdomain(LOCALES_DOMAIN_NAME);
|
|
|
|
textdomain(LOCALES_DOMAIN_NAME);
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
char *lang_ab = yon_locale_get_parameter(locales[i],YON_LOCALE_LANG_AB);
|
|
|
|
char *lang_ab = yon_locale_get_parameter(locales[i],YON_LOCALE_LANG_AB);
|
|
|
|
|
|
|
|
char *code = yon_locale_get_parameter(locales[i],YON_LOCALE_CODE);
|
|
|
|
char *language = yon_locale_get_parameter(locales[i],YON_LOCALE_LANGUAGE);
|
|
|
|
char *language = yon_locale_get_parameter(locales[i],YON_LOCALE_LANGUAGE);
|
|
|
|
char *lang_name = yon_locale_get_parameter(locales[i],YON_LOCALE_LANG_NAME);
|
|
|
|
char *lang_name = yon_locale_get_parameter(locales[i],YON_LOCALE_LANG_NAME);
|
|
|
|
char *territory = yon_locale_get_parameter(locales[i],YON_LOCALE_TERRITORY);
|
|
|
|
char *territory = yon_locale_get_parameter(locales[i],YON_LOCALE_TERRITORY);
|
|
|
|
@ -736,14 +736,14 @@ void set_locales_list(main_window *widgets){
|
|
|
|
gtk_list_store_set(widgets->InstallerCountryList,&itar,
|
|
|
|
gtk_list_store_set(widgets->InstallerCountryList,&itar,
|
|
|
|
0,lang_ab,
|
|
|
|
0,lang_ab,
|
|
|
|
1,_(country),
|
|
|
|
1,_(country),
|
|
|
|
2,locales[i],
|
|
|
|
2,code,
|
|
|
|
3,title,
|
|
|
|
3,title,
|
|
|
|
-1);
|
|
|
|
-1);
|
|
|
|
if (yon_char_is_empty(config_code)){
|
|
|
|
if (yon_char_is_empty(config_code)){
|
|
|
|
config_code=setlocale(LC_ALL,NULL);
|
|
|
|
config_code=yon_char_new(setlocale(LC_ALL,NULL));
|
|
|
|
char *temp = strstr(config_code,".");
|
|
|
|
|
|
|
|
if (temp) temp[0]='\0';
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
char *temp = strstr(config_code,".");
|
|
|
|
|
|
|
|
if (temp) temp[0]='\0';
|
|
|
|
if (!strcmp(config_code,locales[i])){
|
|
|
|
if (!strcmp(config_code,locales[i])){
|
|
|
|
g_signal_handlers_block_by_func(G_OBJECT(widgets->CountryLanguagesTree),G_CALLBACK(on_installer_language_changed),widgets);
|
|
|
|
g_signal_handlers_block_by_func(G_OBJECT(widgets->CountryLanguagesTree),G_CALLBACK(on_installer_language_changed),widgets);
|
|
|
|
GtkTreePath *path = gtk_tree_model_get_path(GTK_TREE_MODEL(widgets->InstallerLanguageList),&iter);
|
|
|
|
GtkTreePath *path = gtk_tree_model_get_path(GTK_TREE_MODEL(widgets->InstallerLanguageList),&iter);
|
|
|
|
@ -1108,7 +1108,7 @@ void yon_main_window_create(main_window *widgets){
|
|
|
|
gtk_tree_model_filter_set_visible_column(GTK_TREE_MODEL_FILTER(widgets->LayoutsFilter),3);
|
|
|
|
gtk_tree_model_filter_set_visible_column(GTK_TREE_MODEL_FILTER(widgets->LayoutsFilter),3);
|
|
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->LanguagesTree),"cursor-changed",G_CALLBACK(on_locale_changed),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->LanguagesTree),"cursor-changed",G_CALLBACK(on_locale_changed),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->CountryLanguagesTree),"cursor-changed",G_CALLBACK(on_installer_language_changed),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->CountryLanguagesTree),"row-activated",G_CALLBACK(on_installer_language_changed),widgets);
|
|
|
|
// g_signal_connect(G_OBJECT(widgets->LanguageCombo),"changed",G_CALLBACK(on_locale_changed),widgets);
|
|
|
|
// g_signal_connect(G_OBJECT(widgets->LanguageCombo),"changed",G_CALLBACK(on_locale_changed),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->AdditionalSoftwareCell),"toggled",G_CALLBACK(on_additional_software_toggled),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->AdditionalSoftwareCell),"toggled",G_CALLBACK(on_additional_software_toggled),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->StartupChosenCell),"toggled",G_CALLBACK(on_srartup_services_toggled),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->StartupChosenCell),"toggled",G_CALLBACK(on_srartup_services_toggled),widgets);
|
|
|
|
@ -1272,7 +1272,7 @@ main_window *yon_main_window_complete(){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[]){
|
|
|
|
int main(int argc, char *argv[]){
|
|
|
|
setlocale(LC_ALL, "");
|
|
|
|
__attribute__((unused)) char *locale = setlocale(LC_ALL, "");
|
|
|
|
textdomain (LocaleName);
|
|
|
|
textdomain (LocaleName);
|
|
|
|
config_init();
|
|
|
|
config_init();
|
|
|
|
config_str unfound = NULL;
|
|
|
|
config_str unfound = NULL;
|
|
|
|
|