|
|
|
@ -444,7 +444,7 @@ void on_exit_accepted(main_window *){
|
|
|
|
|
|
|
|
|
|
|
|
gboolean on_yon_exit(GtkWidget *,GdkEvent*, main_window *widgets){
|
|
|
|
gboolean on_yon_exit(GtkWidget *,GdkEvent*, main_window *widgets){
|
|
|
|
if (!main_config.exit_accepted||(main_config.save_done&&main_config.install_complete)){
|
|
|
|
if (!main_config.exit_accepted||(main_config.save_done&&main_config.install_complete)){
|
|
|
|
if (!main_config.install_complete&&!main_config.save_configured){
|
|
|
|
if (!main_config.install_complete||!main_config.save_configured){
|
|
|
|
dialog_confirmation_data *data = yon_confirmation_dialog_data_new();
|
|
|
|
dialog_confirmation_data *data = yon_confirmation_dialog_data_new();
|
|
|
|
data->action_text=INTERRUPT_TEXT_LABEL;
|
|
|
|
data->action_text=INTERRUPT_TEXT_LABEL;
|
|
|
|
data->title=WARNING_TITLE_LABEL;
|
|
|
|
data->title=WARNING_TITLE_LABEL;
|
|
|
|
@ -504,20 +504,41 @@ void on_installer_language_changed(GtkWidget *self,GtkTreePath*,GtkTreeViewColum
|
|
|
|
char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL);
|
|
|
|
char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL);
|
|
|
|
g_signal_handlers_block_by_func(G_OBJECT(widgets->MainWindow),G_CALLBACK(on_yon_exit),widgets);
|
|
|
|
g_signal_handlers_block_by_func(G_OBJECT(widgets->MainWindow),G_CALLBACK(on_yon_exit),widgets);
|
|
|
|
if (!system(command)){};
|
|
|
|
if (!system(command)){};
|
|
|
|
|
|
|
|
yon_main_window_update_locale(widgets);
|
|
|
|
|
|
|
|
g_signal_handlers_block_by_func(G_OBJECT(self),G_CALLBACK(on_locale_changed),widgets);
|
|
|
|
|
|
|
|
model = GTK_TREE_MODEL(widgets->InstallerLanguageList);
|
|
|
|
|
|
|
|
gtk_tree_model_get_iter_from_string(model,&iter,active_lang_id);
|
|
|
|
|
|
|
|
g_signal_handlers_unblock_by_func(G_OBJECT(self),G_CALLBACK(on_locale_changed),widgets);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void yon_main_window_update_locale(main_window *widgets){
|
|
|
|
|
|
|
|
int size;
|
|
|
|
|
|
|
|
char *command = yon_config_parameter_prepare_command(get_localisation_command,main_config.config_load_path,NULL,NULL);
|
|
|
|
|
|
|
|
config_str locale_output = yon_config_load(command,&size);
|
|
|
|
|
|
|
|
char *locale = NULL;
|
|
|
|
|
|
|
|
if (size&&strcmp(locale_output[0],"(null)\n")){
|
|
|
|
|
|
|
|
yon_char_remove_last_symbol(locale_output[0],'\n');
|
|
|
|
|
|
|
|
free(yon_char_divide_search(locale_output[0],"=",-1));
|
|
|
|
|
|
|
|
yon_char_remove_brackets(locale_output[0]);
|
|
|
|
|
|
|
|
locale = locale_output[0];
|
|
|
|
|
|
|
|
} else if (size>1&&strcmp(locale_output[1],"(null)\n")){
|
|
|
|
|
|
|
|
yon_char_remove_last_symbol(locale_output[1],'\n');
|
|
|
|
|
|
|
|
free(yon_char_divide_search(locale_output[1],"=",-1));
|
|
|
|
|
|
|
|
yon_char_remove_brackets(locale_output[1]);
|
|
|
|
|
|
|
|
locale = locale_output[1];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
locale = setlocale(LC_ALL,locale);
|
|
|
|
|
|
|
|
yon_char_parsed_free(locale_output,size);
|
|
|
|
|
|
|
|
|
|
|
|
gtk_widget_destroy(widgets->MainWindow);
|
|
|
|
gtk_widget_destroy(widgets->MainWindow);
|
|
|
|
setlocale(LC_ALL, window_language);
|
|
|
|
|
|
|
|
textdomain(LocaleName);
|
|
|
|
textdomain(LocaleName);
|
|
|
|
g_setenv("LANGUAGE",window_language,1);
|
|
|
|
g_setenv("LANGUAGE",locale,1);
|
|
|
|
|
|
|
|
|
|
|
|
yon_main_window_create(widgets);
|
|
|
|
yon_main_window_create(widgets);
|
|
|
|
char *path = yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL);
|
|
|
|
char *path = yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL);
|
|
|
|
yon_window_config_setup(GTK_WINDOW(widgets->MainWindow));
|
|
|
|
yon_window_config_setup(GTK_WINDOW(widgets->MainWindow));
|
|
|
|
yon_window_config_load(path);
|
|
|
|
yon_window_config_load(path);
|
|
|
|
g_signal_handlers_block_by_func(G_OBJECT(self),G_CALLBACK(on_locale_changed),widgets);
|
|
|
|
|
|
|
|
model = GTK_TREE_MODEL(widgets->InstallerLanguageList);
|
|
|
|
|
|
|
|
gtk_tree_model_get_iter_from_string(model,&iter,active_lang_id);
|
|
|
|
|
|
|
|
g_signal_handlers_unblock_by_func(G_OBJECT(self),G_CALLBACK(on_locale_changed),widgets);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
typedef struct{
|
|
|
|
@ -581,13 +602,11 @@ void set_locales_list(main_window *widgets){
|
|
|
|
char *temp = strstr(config_code,".");
|
|
|
|
char *temp = strstr(config_code,".");
|
|
|
|
if (temp) temp[0]='\0';
|
|
|
|
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);
|
|
|
|
|
|
|
|
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);
|
|
|
|
gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(widgets->LanguagesTree),path,0,0,0,0);
|
|
|
|
gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(widgets->LanguagesTree),path,0,0,0,0);
|
|
|
|
gtk_tree_path_free(path);
|
|
|
|
gtk_tree_path_free(path);
|
|
|
|
gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->LanguagesTree)),&iter);
|
|
|
|
gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->LanguagesTree)),&iter);
|
|
|
|
on_locale_changed(NULL,widgets);
|
|
|
|
on_locale_changed(NULL,widgets);
|
|
|
|
g_signal_handlers_unblock_by_func(G_OBJECT(widgets->CountryLanguagesTree),G_CALLBACK(on_installer_language_changed),widgets);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
textdomain(LocaleName);
|
|
|
|
textdomain(LocaleName);
|
|
|
|
@ -1239,6 +1258,7 @@ int main(int argc, char *argv[]){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
gtk_init(&argc,&argv);
|
|
|
|
gtk_init(&argc,&argv);
|
|
|
|
|
|
|
|
bind_textdomain_codeset(LocaleName,"UTF-8");
|
|
|
|
main_window *widgets = NULL;
|
|
|
|
main_window *widgets = NULL;
|
|
|
|
if (widgets){};
|
|
|
|
if (widgets){};
|
|
|
|
int fullscreen = 0;
|
|
|
|
int fullscreen = 0;
|
|
|
|
|