WIP language translation changes

pull/207/head
parent 6f814853a5
commit 45e38176db

@ -64,7 +64,6 @@ void on_configuration_exit(GtkWidget *,configuration_window *window){
GList *box = gtk_container_get_children(GTK_CONTAINER(widgets->ConfigurationModeMenuItem));
GList *children = gtk_container_get_children(GTK_CONTAINER(box->data));
GtkWidget *Check = GTK_WIDGET(g_list_nth_data(children,1));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Check),0);
g_list_free(box);
@ -82,7 +81,7 @@ void on_configuration_mode_switch(GtkWidget *self,main_window *widgets){
GtkWidget *Check = GTK_WIDGET(g_list_nth_data(children,1));
int active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(Check));
if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(Check))){
if (!active){
GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_configuration_mode);
configuration_window *window = malloc(sizeof(configuration_window));
window->Window = yon_gtk_builder_get_widget(builder,"MainWindow");

@ -52,18 +52,18 @@ void on_config_global_load(GtkWidget *,main_window *widgets){
main_config.config_load_path = yon_char_new("global");
yon_load_proceed(YON_CONFIG_GLOBAL);
main_config.load_mode=YON_CONFIG_GLOBAL;
yon_main_window_update_locale(widgets);
// yon_main_window_update_locale(widgets);
yon_page_init(widgets,gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->Notebook)));
}
void on_config_custom_load(GtkWidget *,main_window *widgets){
void on_config_custom_load(GtkWidget *,main_window *){
yon_load_proceed(YON_CONFIG_CUSTOM);
// yon_page_init(widgets,gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->Notebook)));
main_config.load_mode=YON_CONFIG_CUSTOM;
yon_main_window_update_locale(widgets);
// yon_main_window_update_locale(widgets);
}
void on_config_custom_load_last(GtkWidget *,main_window *widgets){
void on_config_custom_load_last(GtkWidget *,main_window *){
yon_config_clean();
if (!yon_char_is_empty(config_get_default_command))
yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL);
@ -71,7 +71,7 @@ void on_config_custom_load_last(GtkWidget *,main_window *widgets){
yon_config_load_config(YON_CONFIG_CUSTOM,command,NULL);
// yon_page_init(widgets,gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->Notebook)));
main_config.load_mode=YON_CONFIG_CUSTOM;
yon_main_window_update_locale(widgets);
// yon_main_window_update_locale(widgets);
}
void on_config_global_local_save(GtkWidget *,main_window *widgets){

@ -4,6 +4,11 @@ void on_locale_changed(GtkWidget *,main_window *widgets){
GtkTreeIter iter;
GtkTreeModel *model;
if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->LanguagesTree)),&model,&iter)) return;
{
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_path_free(path);
}
gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->InstallerCountryFilter));
char *config_code = config(installer_locale_parameter);
if (yon_char_is_empty(config_code)){
@ -69,12 +74,17 @@ void yon_startup_language_init(){
if (size>1&&!yon_char_is_empty(parsed[1])&&strcmp(parsed[1],"(null)\n")){
yon_char_remove_last_symbol(parsed[1],'\n');
free(yon_char_divide_search(parsed[1],"=",-1));
yon_config_register(lang_parameter,lang_parameter_command,parsed[1]);
yon_char_remove_brackets(parsed[1]);
yon_config_register(installer_locale_parameter,installer_locale_parameter_command,parsed[1]);
}
if (size>2&&!yon_char_is_empty(parsed[2])&&strcmp(parsed[2],"(null)\n")){
yon_char_remove_last_symbol(parsed[2],'\n');
free(yon_char_divide_search(parsed[2],"=",-1));
yon_config_register(SYSTEM_LANG_parameter,SYSTEM_LANG_parameter_command,parsed[2]);
yon_char_remove_brackets(parsed[2]);
yon_config_register(installer_locale_parameter,installer_locale_parameter_command,parsed[2]);
} else {
yon_config_register(installer_locale_parameter,installer_locale_parameter_command,setlocale(LC_ALL,""));
}
}
}
@ -95,14 +105,15 @@ void yon_main_window_update_locale(main_window *widgets){
}
locale = setlocale(LC_ALL,locale);
gtk_widget_destroy(widgets->MainWindow);
// gtk_widget_destroy(widgets->MainWindow);
textdomain(LocaleName);
g_setenv("LANGUAGE",locale,1);
yon_main_window_create(widgets);
yon_update_translation(widgets->builder);
// yon_main_window_create(widgets);
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_load(path);
}
typedef struct{
@ -172,9 +183,7 @@ void set_locales_list(main_window *widgets){
2,code,
3,_(title),
-1);
if (yon_char_is_empty(config_code)){
config_code=yon_char_new(setlocale(LC_ALL,NULL));
}
if (!yon_char_is_empty(config_code)){
char *temp = strstr(config_code,".");
if (temp) temp[0]='\0';
if (!strcmp(config_code,locales[i])){
@ -182,8 +191,8 @@ void set_locales_list(main_window *widgets){
gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(widgets->LanguagesTree),path,0,0,0,0);
gtk_tree_path_free(path);
gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->LanguagesTree)),&iter);
on_locale_changed(NULL,widgets);
}
}
}
textdomain(LocaleName);
@ -210,4 +219,45 @@ gboolean on_country_filter(GtkTreeModel *self, GtkTreeIter *iter, main_window *w
}
return 0;
}
void yon_translation_init(GtkBuilder *builder){
GSList *list = gtk_builder_get_objects(builder);
GSList *iter;
for (iter = list; iter; iter = iter->next){
GtkWidget *cur_widget = NULL;
const char *widget_text = NULL;
if (GTK_IS_BUTTON(iter->data)){
cur_widget = GTK_WIDGET(iter->data);
widget_text = yon_char_new(gtk_button_get_label(GTK_BUTTON(cur_widget)));
} else if (GTK_IS_LABEL(iter->data)){
cur_widget = GTK_WIDGET(iter->data);
widget_text = yon_char_new(gtk_label_get_text(GTK_LABEL(cur_widget)));
} else continue;
g_object_set_data(G_OBJECT(cur_widget),"original_label",(void*)widget_text);
}
}
void yon_update_translation(GtkBuilder *builder){
GSList *list = gtk_builder_get_objects(builder);
GSList *iter;
for (iter = list; iter; iter = iter->next){
if (GTK_IS_BUTTON(iter->data)){
GtkWidget *cur_button = GTK_WIDGET(iter->data);
char *source_label = g_object_get_data(G_OBJECT(cur_button),"original_label");
if (!yon_char_is_empty(source_label)){
gtk_button_set_label(GTK_BUTTON(cur_button),_(source_label));
}
} else if (GTK_IS_LABEL(iter->data)){
GtkWidget *cur_label = GTK_WIDGET(iter->data);
char *source_label = g_object_get_data(G_OBJECT(cur_label),"original_label");
if (!yon_char_is_empty(source_label)){
gtk_label_set_text(GTK_LABEL(cur_label),_(source_label));
}
}
}
}

@ -401,7 +401,9 @@ gboolean on_yon_exit(GtkWidget *,GdkEvent*, main_window *widgets){
void yon_main_window_create(main_window *widgets){
__attribute__((unused)) char *locale = setlocale(LC_ALL, "en_US.UTF-8");
GtkBuilder *builder = gtk_builder_new_from_resource(glade_path);
yon_translation_init(builder);
gtk_builder_add_callback_symbol(builder,"yon_gtk_widget_set_sensitive_from_toggle_button",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button));
gtk_builder_add_callback_symbol(builder,"on_toggle_button_switch_on",G_CALLBACK(on_toggle_button_switch_on));
// Custom widgets configuration
@ -713,164 +715,167 @@ void yon_main_window_create(main_window *widgets){
gtk_menu_shell_append(GTK_MENU_SHELL(menu),widgets->DocumentationMenuItem);
gtk_menu_shell_append(GTK_MENU_SHELL(menu),widgets->AboutMenuItem);
g_signal_connect(G_OBJECT(widgets->LicenseAgreeRadio),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->NextButton);
g_signal_connect(G_OBJECT(widgets->LoadGlobalConfigurationMenuItem),"activate",G_CALLBACK(on_config_global_load),widgets);
g_signal_connect(G_OBJECT(widgets->LoadLocalConfigurationMenuItem),"activate",G_CALLBACK(on_config_local_load),widgets);
g_signal_connect(G_OBJECT(widgets->LoadExternalConfigurationMenuItem),"activate",G_CALLBACK(on_config_custom_load),widgets);
g_signal_connect(G_OBJECT(widgets->ReadFullLogButton),"clicked",G_CALLBACK(on_process_log_view),widgets);
g_signal_connect(G_OBJECT(widgets->ReadShortLogButton),"clicked",G_CALLBACK(on_summary_log_view),widgets);
g_signal_connect(G_OBJECT(widgets->CommonGpartedButton),"clicked",G_CALLBACK(on_gparted_open),NULL);
g_signal_connect(G_OBJECT(widgets->SameGpartedButton),"clicked",G_CALLBACK(on_gparted_open),NULL);
g_signal_connect(G_OBJECT(widgets->NextInstallationGPartedButton),"clicked",G_CALLBACK(on_gparted_open),NULL);
g_signal_connect(G_OBJECT(widgets->UserdataGpartedButton),"clicked",G_CALLBACK(on_gparted_open),NULL);
g_signal_connect(G_OBJECT(widgets->GrubUpdateGpartedButton),"clicked",G_CALLBACK(on_gparted_open),NULL);
g_signal_connect(G_OBJECT(widgets->GrubInstallGpartedButton),"clicked",G_CALLBACK(on_gparted_open),NULL);
g_signal_connect(G_OBJECT(widgets->AdvancedGpartedButton),"clicked",G_CALLBACK(on_gparted_open),NULL);
g_signal_connect(G_OBJECT(widgets->CommonUpdateGpartedButton),"clicked",G_CALLBACK(on_gparted_update),widgets);
g_signal_connect(G_OBJECT(widgets->SameUpdateGpartedButton),"clicked",G_CALLBACK(on_gparted_update),widgets);
g_signal_connect(G_OBJECT(widgets->NextInstallationUpdateGPartedButton),"clicked",G_CALLBACK(on_gparted_update),widgets);
g_signal_connect(G_OBJECT(widgets->UserdataUpdateGpartedButton),"clicked",G_CALLBACK(on_gparted_update),widgets);
g_signal_connect(G_OBJECT(widgets->GrubUpdateUpdateGpartedButton),"clicked",G_CALLBACK(on_gparted_update),widgets);
g_signal_connect(G_OBJECT(widgets->GrubInstallUpdateGpartedButton),"clicked",G_CALLBACK(on_gparted_update),widgets);
g_signal_connect(G_OBJECT(widgets->AdvancedUpdateGpartedButton),"clicked",G_CALLBACK(on_gparted_update),widgets);
// g_signal_connect(G_OBJECT(widgets->MainWindow),"check-resize",G_CALLBACK(on_region_resized),widgets);
g_signal_connect(G_OBJECT(widgets->NextButton),"clicked",G_CALLBACK(on_page_next_clicked),widgets);
g_signal_connect(G_OBJECT(widgets->BackButton),"clicked",G_CALLBACK(on_page_prev_clicked),widgets);
g_signal_connect(G_OBJECT(widgets->LocaleAddButton),"clicked",G_CALLBACK(on_language_open),widgets);
g_signal_connect(G_OBJECT(widgets->LocaleRemoveButton),"clicked",G_CALLBACK(on_language_remove),widgets);
g_signal_connect(G_OBJECT(widgets->LocaleDefaultSwitch),"state-set",G_CALLBACK(on_language_default_toggled),widgets);
g_signal_connect(G_OBJECT(widgets->LocaleCell),"toggled",G_CALLBACK(on_locale_toggled),widgets);
g_signal_connect(G_OBJECT(widgets->CancelInstallButton),"clicked",G_CALLBACK(on_page_cancel_clicked),widgets);
#ifdef TIMEZONEMAP_INCLUDE
g_signal_connect(G_OBJECT(widgets->RegionCombo),"changed",G_CALLBACK(on_region_changed),widgets);
g_signal_connect(G_OBJECT(widgets->ZoneCombo),"changed",G_CALLBACK(on_zone_changed),widgets);
#endif
g_signal_connect(G_OBJECT(widgets->RegionSensitiveSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->RegionCombo);
g_signal_connect(G_OBJECT(widgets->RegionSensitiveSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->ZoneCombo);
g_signal_connect(G_OBJECT(widgets->RegionSensitiveSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->RegionMapBox);
g_signal_connect(G_OBJECT(widgets->KeyboardLayoutTree),"cursor-changed",G_CALLBACK(on_layout_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->KeyboardDefaultLayoutsSwitch),"state-set",G_CALLBACK(on_layout_default_toggled),widgets);
g_signal_connect(G_OBJECT(widgets->KeyboardDefaultLayoutsSwitch),"state-set",G_CALLBACK(on_layout_default_sensitive_toggled),widgets);
g_signal_connect(G_OBJECT(widgets->KeyboardLayoutMoveUpButton),"clicked",G_CALLBACK(on_layout_move_up),widgets);
g_signal_connect(G_OBJECT(widgets->KeyboardLayoutMoveDownButton),"clicked",G_CALLBACK(on_layout_move_down),widgets);
g_signal_connect(G_OBJECT(widgets->KeyboardLayoutAddButton),"clicked",G_CALLBACK(on_system_layouts_add),widgets);
g_signal_connect(G_OBJECT(widgets->KeyboardLayoutRemoveButton),"clicked",G_CALLBACK(on_system_layouts_remove),widgets);
g_signal_connect(G_OBJECT(widgets->KeyboardModelCombo),"changed",G_CALLBACK(on_model_changed),widgets);
g_signal_connect(G_OBJECT(widgets->GrubInstallDevicesTree),"cursor-changed",G_CALLBACK(on_device_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->GrubUpdateDevicesTree),"cursor-changed",G_CALLBACK(on_device_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->NextInstallationSysDevicesTree),"cursor-changed",G_CALLBACK(on_device_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->SamePlaceDeviceTree),"cursor-changed",G_CALLBACK(on_device_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->UserdataDevicesTree),"cursor-changed",G_CALLBACK(on_device_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->SamePlacePartTree),"cursor-changed",G_CALLBACK(on_partition_changed),widgets);
g_signal_connect(G_OBJECT(widgets->NextInstallationSysSectionTree),"cursor-changed",G_CALLBACK(on_partition_changed),widgets);
g_signal_connect(G_OBJECT(widgets->NextInstallationSizeTypeSpin),"changed",G_CALLBACK(on_partition_changed),widgets);
g_signal_connect(G_OBJECT(widgets->UserRootPasswordCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box),widgets->UserRootPasswordEntry);
g_signal_connect(G_OBJECT(widgets->UserRootPasswordCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box),widgets->UserRootPasswordButton);
g_signal_connect(G_OBJECT(widgets->UserAddButton),"clicked",G_CALLBACK(on_user_add),widgets);
g_signal_connect(G_OBJECT(widgets->UserRootPasswordButton),"clicked",G_CALLBACK(yon_password_root_new),widgets);
g_signal_connect(G_OBJECT(widgets->BootloadDefaulOSButton),"clicked",G_CALLBACK(yon_menu_window_open),widgets);
g_signal_connect(G_OBJECT(widgets->LanguagesTree),"cursor-changed",G_CALLBACK(on_locale_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->StartupServicesTree),"cursor-changed",G_CALLBACK(on_startup_services_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->StartupServicesAddButton),"clicked",G_CALLBACK(on_startup_service_add),widgets);
g_signal_connect(G_OBJECT(widgets->StartupServicesEditButton),"clicked",G_CALLBACK(on_startup_service_edit),widgets);
g_signal_connect(G_OBJECT(widgets->StartupServicesRemoveButton),"clicked",G_CALLBACK(on_startup_services_remove),widgets);
g_signal_connect(G_OBJECT(widgets->StartupChosenCell),"toggled",G_CALLBACK(on_srartup_services_toggled),widgets);
g_signal_connect(G_OBJECT(widgets->StartupAppsTree),"cursor-changed",G_CALLBACK(on_startup_apps_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->StartupAppsAddButton),"clicked",G_CALLBACK(on_startup_app_add),widgets);
g_signal_connect(G_OBJECT(widgets->StartupAppsEditButton),"clicked",G_CALLBACK(on_startup_app_edit),widgets);
g_signal_connect(G_OBJECT(widgets->StartupAppsRemoveButton),"clicked",G_CALLBACK(on_startup_apps_remove),widgets);
g_signal_connect(G_OBJECT(widgets->StartupAppsChosenCell),"toggled",G_CALLBACK(on_srartup_services_toggled),widgets);
g_signal_connect(G_OBJECT(widgets->AutoHostnameCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),widgets->HotnameEntry);
{
g_signal_connect(G_OBJECT(widgets->LicenseAgreeRadio),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->NextButton);
g_signal_connect(G_OBJECT(widgets->LoadGlobalConfigurationMenuItem),"activate",G_CALLBACK(on_config_global_load),widgets);
g_signal_connect(G_OBJECT(widgets->LoadLocalConfigurationMenuItem),"activate",G_CALLBACK(on_config_local_load),widgets);
g_signal_connect(G_OBJECT(widgets->LoadExternalConfigurationMenuItem),"activate",G_CALLBACK(on_config_custom_load),widgets);
g_signal_connect(G_OBJECT(widgets->ReadFullLogButton),"clicked",G_CALLBACK(on_process_log_view),widgets);
g_signal_connect(G_OBJECT(widgets->ReadShortLogButton),"clicked",G_CALLBACK(on_summary_log_view),widgets);
g_signal_connect(G_OBJECT(widgets->CommonGpartedButton),"clicked",G_CALLBACK(on_gparted_open),NULL);
g_signal_connect(G_OBJECT(widgets->SameGpartedButton),"clicked",G_CALLBACK(on_gparted_open),NULL);
g_signal_connect(G_OBJECT(widgets->NextInstallationGPartedButton),"clicked",G_CALLBACK(on_gparted_open),NULL);
g_signal_connect(G_OBJECT(widgets->UserdataGpartedButton),"clicked",G_CALLBACK(on_gparted_open),NULL);
g_signal_connect(G_OBJECT(widgets->GrubUpdateGpartedButton),"clicked",G_CALLBACK(on_gparted_open),NULL);
g_signal_connect(G_OBJECT(widgets->GrubInstallGpartedButton),"clicked",G_CALLBACK(on_gparted_open),NULL);
g_signal_connect(G_OBJECT(widgets->AdvancedGpartedButton),"clicked",G_CALLBACK(on_gparted_open),NULL);
g_signal_connect(G_OBJECT(widgets->CommonUpdateGpartedButton),"clicked",G_CALLBACK(on_gparted_update),widgets);
g_signal_connect(G_OBJECT(widgets->SameUpdateGpartedButton),"clicked",G_CALLBACK(on_gparted_update),widgets);
g_signal_connect(G_OBJECT(widgets->NextInstallationUpdateGPartedButton),"clicked",G_CALLBACK(on_gparted_update),widgets);
g_signal_connect(G_OBJECT(widgets->UserdataUpdateGpartedButton),"clicked",G_CALLBACK(on_gparted_update),widgets);
g_signal_connect(G_OBJECT(widgets->GrubUpdateUpdateGpartedButton),"clicked",G_CALLBACK(on_gparted_update),widgets);
g_signal_connect(G_OBJECT(widgets->GrubInstallUpdateGpartedButton),"clicked",G_CALLBACK(on_gparted_update),widgets);
g_signal_connect(G_OBJECT(widgets->AdvancedUpdateGpartedButton),"clicked",G_CALLBACK(on_gparted_update),widgets);
// g_signal_connect(G_OBJECT(widgets->MainWindow),"check-resize",G_CALLBACK(on_region_resized),widgets);
g_signal_connect(G_OBJECT(widgets->NextButton),"clicked",G_CALLBACK(on_page_next_clicked),widgets);
g_signal_connect(G_OBJECT(widgets->BackButton),"clicked",G_CALLBACK(on_page_prev_clicked),widgets);
g_signal_connect(G_OBJECT(widgets->LocaleAddButton),"clicked",G_CALLBACK(on_language_open),widgets);
g_signal_connect(G_OBJECT(widgets->LocaleRemoveButton),"clicked",G_CALLBACK(on_language_remove),widgets);
g_signal_connect(G_OBJECT(widgets->LocaleDefaultSwitch),"state-set",G_CALLBACK(on_language_default_toggled),widgets);
g_signal_connect(G_OBJECT(widgets->LocaleCell),"toggled",G_CALLBACK(on_locale_toggled),widgets);
g_signal_connect(G_OBJECT(widgets->CancelInstallButton),"clicked",G_CALLBACK(on_page_cancel_clicked),widgets);
g_signal_connect(G_OBJECT(widgets->RegionCombo),"changed",G_CALLBACK(on_region_changed),widgets);
#ifdef TIMEZONEMAP_INCLUDE
g_signal_connect(G_OBJECT(widgets->ZoneCombo),"changed",G_CALLBACK(on_zone_changed),widgets);
#endif
g_signal_connect(G_OBJECT(widgets->RegionSensitiveSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->RegionCombo);
g_signal_connect(G_OBJECT(widgets->RegionSensitiveSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->ZoneCombo);
g_signal_connect(G_OBJECT(widgets->RegionSensitiveSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->RegionMapBox);
g_signal_connect(G_OBJECT(widgets->KeyboardLayoutTree),"cursor-changed",G_CALLBACK(on_layout_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->KeyboardDefaultLayoutsSwitch),"state-set",G_CALLBACK(on_layout_default_toggled),widgets);
g_signal_connect(G_OBJECT(widgets->KeyboardDefaultLayoutsSwitch),"state-set",G_CALLBACK(on_layout_default_sensitive_toggled),widgets);
g_signal_connect(G_OBJECT(widgets->KeyboardLayoutMoveUpButton),"clicked",G_CALLBACK(on_layout_move_up),widgets);
g_signal_connect(G_OBJECT(widgets->KeyboardLayoutMoveDownButton),"clicked",G_CALLBACK(on_layout_move_down),widgets);
g_signal_connect(G_OBJECT(widgets->KeyboardLayoutAddButton),"clicked",G_CALLBACK(on_system_layouts_add),widgets);
g_signal_connect(G_OBJECT(widgets->KeyboardLayoutRemoveButton),"clicked",G_CALLBACK(on_system_layouts_remove),widgets);
g_signal_connect(G_OBJECT(widgets->KeyboardModelCombo),"changed",G_CALLBACK(on_model_changed),widgets);
g_signal_connect(G_OBJECT(widgets->GrubInstallDevicesTree),"cursor-changed",G_CALLBACK(on_device_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->GrubUpdateDevicesTree),"cursor-changed",G_CALLBACK(on_device_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->NextInstallationSysDevicesTree),"cursor-changed",G_CALLBACK(on_device_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->SamePlaceDeviceTree),"cursor-changed",G_CALLBACK(on_device_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->UserdataDevicesTree),"cursor-changed",G_CALLBACK(on_device_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->SamePlacePartTree),"cursor-changed",G_CALLBACK(on_partition_changed),widgets);
g_signal_connect(G_OBJECT(widgets->NextInstallationSysSectionTree),"cursor-changed",G_CALLBACK(on_partition_changed),widgets);
g_signal_connect(G_OBJECT(widgets->NextInstallationSizeTypeSpin),"changed",G_CALLBACK(on_partition_changed),widgets);
g_signal_connect(G_OBJECT(widgets->UserRootPasswordCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box),widgets->UserRootPasswordEntry);
g_signal_connect(G_OBJECT(widgets->UserRootPasswordCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box),widgets->UserRootPasswordButton);
g_signal_connect(G_OBJECT(widgets->UserAddButton),"clicked",G_CALLBACK(on_user_add),widgets);
g_signal_connect(G_OBJECT(widgets->UserRootPasswordButton),"clicked",G_CALLBACK(yon_password_root_new),widgets);
g_signal_connect(G_OBJECT(widgets->BootloadDefaulOSButton),"clicked",G_CALLBACK(yon_menu_window_open),widgets);
g_signal_connect(G_OBJECT(widgets->LanguagesTree),"cursor-changed",G_CALLBACK(on_locale_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->StartupServicesTree),"cursor-changed",G_CALLBACK(on_startup_services_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->StartupServicesAddButton),"clicked",G_CALLBACK(on_startup_service_add),widgets);
g_signal_connect(G_OBJECT(widgets->StartupServicesEditButton),"clicked",G_CALLBACK(on_startup_service_edit),widgets);
g_signal_connect(G_OBJECT(widgets->StartupServicesRemoveButton),"clicked",G_CALLBACK(on_startup_services_remove),widgets);
g_signal_connect(G_OBJECT(widgets->StartupChosenCell),"toggled",G_CALLBACK(on_srartup_services_toggled),widgets);
g_signal_connect(G_OBJECT(widgets->StartupAppsTree),"cursor-changed",G_CALLBACK(on_startup_apps_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->StartupAppsAddButton),"clicked",G_CALLBACK(on_startup_app_add),widgets);
g_signal_connect(G_OBJECT(widgets->StartupAppsEditButton),"clicked",G_CALLBACK(on_startup_app_edit),widgets);
g_signal_connect(G_OBJECT(widgets->StartupAppsRemoveButton),"clicked",G_CALLBACK(on_startup_apps_remove),widgets);
g_signal_connect(G_OBJECT(widgets->StartupAppsChosenCell),"toggled",G_CALLBACK(on_srartup_services_toggled),widgets);
g_signal_connect(G_OBJECT(widgets->AutoHostnameCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),widgets->HotnameEntry);
yon_gtk_revealer_set_from_switch(GTK_REVEALER(widgets->NextInstallationFormatRevealer),GTK_SWITCH(widgets->NextInstallationFormatSwitch));
yon_gtk_revealer_set_from_switch(GTK_REVEALER(widgets->SameInstallationFormatRevealer),GTK_SWITCH(widgets->SameInstallationFormatSwitch));
yon_gtk_revealer_set_from_switch(GTK_REVEALER(widgets->UserdataRevealer),GTK_SWITCH(widgets->UserdataFormatSwitch));
g_signal_connect(G_OBJECT(widgets->OSGpartedButton),"clicked",G_CALLBACK(on_gparted_open),NULL);
g_signal_connect(G_OBJECT(widgets->OSUpdateGpartedButton),"clicked",G_CALLBACK(on_gparted_update),widgets);
g_signal_connect(G_OBJECT(widgets->OSDevicesTree),"cursor-changed",G_CALLBACK(on_device_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->OSFormatEncryptionCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box),widgets->OSFormatEncryptionEntry);
g_signal_connect(G_OBJECT(widgets->OSFormatEncryptionCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box),widgets->OSFormatEncryptionButton);
g_signal_connect(G_OBJECT(widgets->OSFormatEncryptionButton),"clicked",G_CALLBACK(yon_os_password_open),widgets);
yon_gtk_revealer_set_from_switch(GTK_REVEALER(widgets->OSRevealer),GTK_SWITCH(widgets->OSFormatSwitch));
g_signal_connect(G_OBJECT(widgets->UserdataFormatEncryptionCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box),widgets->UserdataFormatEncryptionButton);
g_signal_connect(G_OBJECT(widgets->UserdataFormatEncryptionButton),"clicked",G_CALLBACK(yon_userdata_password_open),widgets);
g_signal_connect(G_OBJECT(widgets->PacmanSoftwareAllCell),"toggled",G_CALLBACK(on_pacman_software_all_toggled),widgets);
g_signal_connect(G_OBJECT(widgets->PacmanSoftwareChosenCell),"toggled",G_CALLBACK(on_pacman_software_chosen_toggled),widgets);
g_signal_connect(G_OBJECT(widgets->PacmanSoftwareSearchEntry),"icon-press",G_CALLBACK(on_pacman_icon_press),widgets);
g_signal_connect(G_OBJECT(widgets->BootloadUserAddButton),"clicked",G_CALLBACK(on_bootloader_user_add),widgets);
g_signal_connect(G_OBJECT(widgets->BootloadTimerSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->BootloadTimerSpin);
g_signal_connect(G_OBJECT(widgets->BootloadNoPasswordSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch_inversed),widgets->BootloadUserRemoveButton);
g_signal_connect(G_OBJECT(widgets->BootloadNoPasswordSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch_inversed),widgets->BootloadUserAddButton);
g_signal_connect(G_OBJECT(widgets->BootloadNoPasswordSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch_inversed),widgets->BootloadUserTree);
g_signal_connect(G_OBJECT(widgets->NetworkDomainSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->NetworkDomainNameEntry);
g_signal_connect(G_OBJECT(widgets->NetworkDomainSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->NetworkDomainAdminEntry);
g_signal_connect(G_OBJECT(widgets->NetworkDomainSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->NetworkDomainPasswordEntry);
g_signal_connect(G_OBJECT(widgets->NetworkNTPServerSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->NetworkNTPCombo);
g_signal_connect(G_OBJECT(widgets->NetworkNTPServerSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->NetworkNTPEntry);
g_signal_connect(G_OBJECT(widgets->HostnameSensitiveSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->HotnameEntry);
g_signal_connect(G_OBJECT(widgets->HostnameSensitiveSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->AutoHostnameCheck);
g_signal_connect(G_OBJECT(widgets->HostnameSensitiveSwitch),"state-set",G_CALLBACK(on_autohostname_sensitiveness_check),widgets);
g_signal_connect(G_OBJECT(widgets->AutoHostnameCheck),"toggled",G_CALLBACK(on_autohostname_check),widgets);
g_signal_connect(G_OBJECT(widgets->HotnameEntry),"changed",G_CALLBACK(on_hostname_entry_changed),widgets);
g_signal_connect(G_OBJECT(widgets->NetworkConnectionsAddButton),"clicked",G_CALLBACK(on_connection_add),widgets);
g_signal_connect(G_OBJECT(widgets->NetworkNTPCombo),"changed",G_CALLBACK(on_ntp_sync),widgets);
yon_gtk_revealer_set_from_switch(GTK_REVEALER(widgets->AdvancedLoadTypeRevealer),GTK_SWITCH(widgets->AdvancedLoadTypeSwitch));
yon_gtk_revealer_set_from_switch(GTK_REVEALER(widgets->AdvancedSwapRevealer),GTK_SWITCH(widgets->AdvancedSwapSwitch));
g_signal_connect(G_OBJECT(widgets->AdvancedSwapFixedSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->AdvancedSwapFixedSpin);
g_signal_connect(G_OBJECT(widgets->AdvancedSwapFixedSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->AdvancedSwapFixedSizeSwitch);
g_signal_connect(G_OBJECT(widgets->AdvancedDeviceChosenCell),"toggled",G_CALLBACK(on_install_advanced_device_chosen),widgets);
g_signal_connect(G_OBJECT(widgets->StartScenarioButton),"clicked",G_CALLBACK(yon_quick_install),widgets);
g_signal_connect(G_OBJECT(widgets->SourceButton),"clicked",G_CALLBACK(on_source_clicked),widgets);
g_signal_connect(G_OBJECT(widgets->AdvancedAddButton),"clicked",G_CALLBACK(on_advanced_partition_create),widgets);
g_signal_connect(G_OBJECT(widgets->AdvancedPartChosenCell),"toggled",G_CALLBACK(on_install_advanced_partition_chosen),widgets);
g_signal_connect(G_OBJECT(widgets->AdvancedVirtualDeviceCombo),"changed",G_CALLBACK(on_advanced_virtual_device_changed),widgets);
g_signal_connect(G_OBJECT(widgets->PackagesTree),"cursor-changed",G_CALLBACK(yon_on_packages_selected),widgets);
g_signal_connect(G_OBJECT(widgets->PackagesTree),"row-activated",G_CALLBACK(yon_on_packages_activated),widgets);
g_signal_connect(G_OBJECT(widgets->PackagesChosenCell),"toggled",G_CALLBACK(yon_on_packages_chosen),widgets);
g_signal_connect(G_OBJECT(widgets->HubPersonalListBox),"child-activated",G_CALLBACK(on_configuration_hub_open),widgets);
g_signal_connect(G_OBJECT(widgets->HubSystemListBox),"child-activated",G_CALLBACK(on_configuration_hub_open),widgets);
g_signal_connect(G_OBJECT(widgets->HubPackagesListBox),"child-activated",G_CALLBACK(on_configuration_hub_open),widgets);
g_signal_connect(G_OBJECT(widgets->HubPersonalListBox),"selected-children-changed",G_CALLBACK(on_configuration_hub_selected),widgets);
g_signal_connect(G_OBJECT(widgets->HubSystemListBox),"selected-children-changed",G_CALLBACK(on_configuration_hub_selected),widgets);
g_signal_connect(G_OBJECT(widgets->HubPackagesListBox),"selected-children-changed",G_CALLBACK(on_configuration_hub_selected),widgets);
g_signal_connect(G_OBJECT(widgets->ScrollLeftEventBox),"button-release-event",G_CALLBACK(on_install_slider_prev),widgets);
g_signal_connect(G_OBJECT(widgets->ScrollRightEventBox),"button-release-event",G_CALLBACK(on_install_slider_next),widgets);
g_signal_connect(G_OBJECT(widgets->ScrollLeftEventBox),"enter-notify-event",G_CALLBACK(on_install_slider_hover_highlight),widgets);
g_signal_connect(G_OBJECT(widgets->ScrollRightEventBox),"enter-notify-event",G_CALLBACK(on_install_slider_hover_highlight),widgets);
g_signal_connect(G_OBJECT(widgets->ScrollLeftEventBox),"leave-notify-event",G_CALLBACK(on_install_slider_hover_highlight_end),widgets);
g_signal_connect(G_OBJECT(widgets->ScrollRightEventBox),"leave-notify-event",G_CALLBACK(on_install_slider_hover_highlight_end),widgets);
g_signal_connect(G_OBJECT(widgets->AboutMenuItem),"activate",G_CALLBACK(yon_on_about),NULL);
g_signal_connect(G_OBJECT(widgets->DocumentationMenuItem),"activate",G_CALLBACK(on_open_documentation_confirmation),WIKI_LINK);
yon_gtk_revealer_set_from_switch(GTK_REVEALER(widgets->NextInstallationFormatRevealer),GTK_SWITCH(widgets->NextInstallationFormatSwitch));
yon_gtk_revealer_set_from_switch(GTK_REVEALER(widgets->SameInstallationFormatRevealer),GTK_SWITCH(widgets->SameInstallationFormatSwitch));
yon_gtk_revealer_set_from_switch(GTK_REVEALER(widgets->UserdataRevealer),GTK_SWITCH(widgets->UserdataFormatSwitch));
g_signal_connect(G_OBJECT(widgets->OSGpartedButton),"clicked",G_CALLBACK(on_gparted_open),NULL);
g_signal_connect(G_OBJECT(widgets->OSUpdateGpartedButton),"clicked",G_CALLBACK(on_gparted_update),widgets);
g_signal_connect(G_OBJECT(widgets->OSDevicesTree),"cursor-changed",G_CALLBACK(on_device_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->OSFormatEncryptionCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box),widgets->OSFormatEncryptionEntry);
g_signal_connect(G_OBJECT(widgets->OSFormatEncryptionCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box),widgets->OSFormatEncryptionButton);
g_signal_connect(G_OBJECT(widgets->OSFormatEncryptionButton),"clicked",G_CALLBACK(yon_os_password_open),widgets);
yon_gtk_revealer_set_from_switch(GTK_REVEALER(widgets->OSRevealer),GTK_SWITCH(widgets->OSFormatSwitch));
g_signal_connect(G_OBJECT(widgets->UserdataFormatEncryptionCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box),widgets->UserdataFormatEncryptionButton);
g_signal_connect(G_OBJECT(widgets->UserdataFormatEncryptionButton),"clicked",G_CALLBACK(yon_userdata_password_open),widgets);
g_signal_connect(G_OBJECT(widgets->PacmanSoftwareAllCell),"toggled",G_CALLBACK(on_pacman_software_all_toggled),widgets);
g_signal_connect(G_OBJECT(widgets->PacmanSoftwareChosenCell),"toggled",G_CALLBACK(on_pacman_software_chosen_toggled),widgets);
g_signal_connect(G_OBJECT(widgets->PacmanSoftwareSearchEntry),"icon-press",G_CALLBACK(on_pacman_icon_press),widgets);
g_signal_connect(G_OBJECT(widgets->BootloadUserAddButton),"clicked",G_CALLBACK(on_bootloader_user_add),widgets);
g_signal_connect(G_OBJECT(widgets->BootloadTimerSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->BootloadTimerSpin);
g_signal_connect(G_OBJECT(widgets->BootloadNoPasswordSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch_inversed),widgets->BootloadUserRemoveButton);
g_signal_connect(G_OBJECT(widgets->BootloadNoPasswordSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch_inversed),widgets->BootloadUserAddButton);
g_signal_connect(G_OBJECT(widgets->BootloadNoPasswordSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch_inversed),widgets->BootloadUserTree);
g_signal_connect(G_OBJECT(widgets->NetworkDomainSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->NetworkDomainNameEntry);
g_signal_connect(G_OBJECT(widgets->NetworkDomainSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->NetworkDomainAdminEntry);
g_signal_connect(G_OBJECT(widgets->NetworkDomainSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->NetworkDomainPasswordEntry);
g_signal_connect(G_OBJECT(widgets->NetworkNTPServerSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->NetworkNTPCombo);
g_signal_connect(G_OBJECT(widgets->NetworkNTPServerSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->NetworkNTPEntry);
g_signal_connect(G_OBJECT(widgets->HostnameSensitiveSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->HotnameEntry);
g_signal_connect(G_OBJECT(widgets->HostnameSensitiveSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->AutoHostnameCheck);
g_signal_connect(G_OBJECT(widgets->HostnameSensitiveSwitch),"state-set",G_CALLBACK(on_autohostname_sensitiveness_check),widgets);
g_signal_connect(G_OBJECT(widgets->AutoHostnameCheck),"toggled",G_CALLBACK(on_autohostname_check),widgets);
g_signal_connect(G_OBJECT(widgets->HotnameEntry),"changed",G_CALLBACK(on_hostname_entry_changed),widgets);
g_signal_connect(G_OBJECT(widgets->NetworkConnectionsAddButton),"clicked",G_CALLBACK(on_connection_add),widgets);
g_signal_connect(G_OBJECT(widgets->NetworkNTPCombo),"changed",G_CALLBACK(on_ntp_sync),widgets);
yon_gtk_revealer_set_from_switch(GTK_REVEALER(widgets->AdvancedLoadTypeRevealer),GTK_SWITCH(widgets->AdvancedLoadTypeSwitch));
yon_gtk_revealer_set_from_switch(GTK_REVEALER(widgets->AdvancedSwapRevealer),GTK_SWITCH(widgets->AdvancedSwapSwitch));
g_signal_connect(G_OBJECT(widgets->AdvancedSwapFixedSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->AdvancedSwapFixedSpin);
g_signal_connect(G_OBJECT(widgets->AdvancedSwapFixedSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->AdvancedSwapFixedSizeSwitch);
g_signal_connect(G_OBJECT(widgets->AdvancedDeviceChosenCell),"toggled",G_CALLBACK(on_install_advanced_device_chosen),widgets);
g_signal_connect(G_OBJECT(widgets->StartScenarioButton),"clicked",G_CALLBACK(yon_quick_install),widgets);
g_signal_connect(G_OBJECT(widgets->SourceButton),"clicked",G_CALLBACK(on_source_clicked),widgets);
g_signal_connect(G_OBJECT(widgets->AdvancedAddButton),"clicked",G_CALLBACK(on_advanced_partition_create),widgets);
g_signal_connect(G_OBJECT(widgets->AdvancedPartChosenCell),"toggled",G_CALLBACK(on_install_advanced_partition_chosen),widgets);
g_signal_connect(G_OBJECT(widgets->AdvancedVirtualDeviceCombo),"changed",G_CALLBACK(on_advanced_virtual_device_changed),widgets);
g_signal_connect(G_OBJECT(widgets->PackagesTree),"cursor-changed",G_CALLBACK(yon_on_packages_selected),widgets);
g_signal_connect(G_OBJECT(widgets->PackagesTree),"row-activated",G_CALLBACK(yon_on_packages_activated),widgets);
g_signal_connect(G_OBJECT(widgets->PackagesChosenCell),"toggled",G_CALLBACK(yon_on_packages_chosen),widgets);
g_signal_connect(G_OBJECT(widgets->HubPersonalListBox),"child-activated",G_CALLBACK(on_configuration_hub_open),widgets);
g_signal_connect(G_OBJECT(widgets->HubSystemListBox),"child-activated",G_CALLBACK(on_configuration_hub_open),widgets);
g_signal_connect(G_OBJECT(widgets->HubPackagesListBox),"child-activated",G_CALLBACK(on_configuration_hub_open),widgets);
g_signal_connect(G_OBJECT(widgets->HubPersonalListBox),"selected-children-changed",G_CALLBACK(on_configuration_hub_selected),widgets);
g_signal_connect(G_OBJECT(widgets->HubSystemListBox),"selected-children-changed",G_CALLBACK(on_configuration_hub_selected),widgets);
g_signal_connect(G_OBJECT(widgets->HubPackagesListBox),"selected-children-changed",G_CALLBACK(on_configuration_hub_selected),widgets);
g_signal_connect(G_OBJECT(widgets->ScrollLeftEventBox),"button-release-event",G_CALLBACK(on_install_slider_prev),widgets);
g_signal_connect(G_OBJECT(widgets->ScrollRightEventBox),"button-release-event",G_CALLBACK(on_install_slider_next),widgets);
g_signal_connect(G_OBJECT(widgets->ScrollLeftEventBox),"enter-notify-event",G_CALLBACK(on_install_slider_hover_highlight),widgets);
g_signal_connect(G_OBJECT(widgets->ScrollRightEventBox),"enter-notify-event",G_CALLBACK(on_install_slider_hover_highlight),widgets);
g_signal_connect(G_OBJECT(widgets->ScrollLeftEventBox),"leave-notify-event",G_CALLBACK(on_install_slider_hover_highlight_end),widgets);
g_signal_connect(G_OBJECT(widgets->ScrollRightEventBox),"leave-notify-event",G_CALLBACK(on_install_slider_hover_highlight_end),widgets);
g_signal_connect(G_OBJECT(widgets->AboutMenuItem),"activate",G_CALLBACK(yon_on_about),NULL);
g_signal_connect(G_OBJECT(widgets->DocumentationMenuItem),"activate",G_CALLBACK(on_open_documentation_confirmation),WIKI_LINK);
}
yon_window_config_setup(GTK_WINDOW(widgets->MainWindow));
yon_gtk_window_setup(GTK_WINDOW(widgets->MainWindow),NULL,TITLE_LABEL,icon_path,NULL);
@ -922,10 +927,6 @@ void yon_main_window_create(main_window *widgets){
if (main_config.lock_load_global == 1){
gtk_widget_set_sensitive(widgets->LoadGlobalConfigurationMenuItem,0);
}
if (getuid()){
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widgets->ConfigurationModeMenuItem),1);
}
gtk_window_set_title(GTK_WINDOW(widgets->MainWindow),TITLE_LABEL);
gtk_window_set_icon_name(GTK_WINDOW(widgets->MainWindow),icon_path);
@ -953,6 +954,13 @@ void yon_main_window_create(main_window *widgets){
} else {
gtk_widget_hide(widgets->StartScenarioButton);
}
if (getuid()){
gtk_menu_item_activate(GTK_MENU_ITEM(widgets->ConfigurationModeMenuItem));
if (yon_char_is_empty(main_config.config_save_path)){
gtk_main_quit();
exit (1);
}
}
if (main_config.force_ini){
if (yon_configuration_path_check(main_config.config_save_path)){
GList *box = gtk_container_get_children(GTK_CONTAINER(widgets->ConfigurationModeMenuItem));
@ -967,8 +975,6 @@ void yon_main_window_create(main_window *widgets){
exit (1);
}
}
yon_locale_init();
set_locales_list(widgets);
}
gboolean yon_maximize_start(main_window *widgets){
@ -989,7 +995,7 @@ void *yon_maximize(main_window *widgets){
* Функция настройки основного окна приложения. [widgets] - структура со стандартным интерфейсом.
*/
main_window *yon_main_window_complete(){
if (main_config.force_ini){
if (main_config.force_ini){ //Check if config path exists
if (yon_configuration_path_check(main_config.config_save_path)){
{
main_config.configure_mode=1;
@ -997,17 +1003,32 @@ main_window *yon_main_window_complete(){
}
}
main_window *widgets=NULL;
widgets = yon_remalloc(widgets,sizeof(main_window));
widgets = malloc(sizeof(main_window));
memset(widgets,0,sizeof(main_window));
yon_startup_language_init();
yon_main_window_create(widgets);
yon_window_config_setup(GTK_WINDOW(widgets->MainWindow));
// yon_window_config_custom_window_setup(GTK_WINDOW(widgets->MainWindow),"MainWindow");
yon_startup_language_init();
yon_locale_init();
set_locales_list(widgets);
// yon_main_window_update_locale(widgets);
// // yon_window_config_custom_window_setup(GTK_WINDOW(widgets->MainWindow),"MainWindow");
int fullscreen = 0;
char *path = yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL);
if (access(path,F_OK)){
fullscreen = 1;
g_thread_new("fullscreen",(GThreadFunc)yon_maximize,widgets);
}
yon_window_config_load(path);
yon_window_config_add_instant_parameter("fullscreen","window",&fullscreen,YON_TYPE_BOOLEAN);
yon_main_window_update_locale(widgets);
return widgets;
}
int main(int argc, char *argv[]){
__attribute__((unused)) char *locale = setlocale(LC_ALL, "");
// __attribute__((unused)) char *locale = setlocale(LC_ALL, "en_US.UTF-8");
textdomain(LocaleName);
yon_ubl_connect_config((_template_config*)&main_config);
config_init();
@ -1040,31 +1061,24 @@ int main(int argc, char *argv[]){
}
gtk_init(&argc,&argv);
main_window *widgets = NULL;
if (widgets){};
int fullscreen = 0;
widgets = yon_main_window_complete();
GtkWidget *root_button = yon_root_button_new(argv,argc);
gtk_style_context_add_class(gtk_widget_get_style_context(root_button),"menuitemtop");
gtk_menu_shell_prepend(GTK_MENU_SHELL(gtk_widget_get_parent(widgets->AboutMenuItem)),root_button);
yon_root_button_init(root_button,GTK_WINDOW(widgets->MainWindow));
on_config_global_load(NULL,widgets);
char *path = yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL);
if (access(path,F_OK)){
fullscreen = 1;
g_thread_new("fullscreen",(GThreadFunc)yon_maximize,widgets);
}
yon_window_config_load(path);
yon_window_config_add_instant_parameter("fullscreen","window",&fullscreen,YON_TYPE_BOOLEAN);
main_config.launch_arguments=yon_char_parsed_copy(argv,argc);
main_config.launch_size=argc;
GtkCssProvider *css=gtk_css_provider_new();
gtk_css_provider_load_from_resource(css,CssPath);
gtk_style_context_add_provider_for_screen(gdk_screen_get_default(),
GTK_STYLE_PROVIDER(css),
-1);
{
widgets = yon_main_window_complete();
GtkWidget *root_button = yon_root_button_new(argv,argc);
gtk_style_context_add_class(gtk_widget_get_style_context(root_button),"menuitemtop");
gtk_menu_shell_prepend(GTK_MENU_SHELL(gtk_widget_get_parent(widgets->AboutMenuItem)),root_button);
yon_root_button_init(root_button,GTK_WINDOW(widgets->MainWindow));
on_config_global_load(NULL,widgets);
}
main_config.launch_arguments=yon_char_parsed_copy(argv,argc);
main_config.launch_size=argc;
if (getuid()!=0){
yon_ubl_status_box_render(yon_char_get_localised_from_lib(ROOT_WARNING_LABEL),BACKGROUND_IMAGE_FAIL_TYPE);
}

@ -1468,4 +1468,6 @@ void yon_main_window_update_locale(main_window *widgets);
gboolean yon_progress_bar_start(main_window *widgets);
void *yon_progress_file_buzyfy(void*);
void yon_startup_language_init();
gboolean on_languages_search_func(GtkTreeModel *model, gint col,const char *key, GtkTreeIter *iter, main_window *widgets);
gboolean on_languages_search_func(GtkTreeModel *model, gint col,const char *key, GtkTreeIter *iter, main_window *widgets);
void yon_update_translation(GtkBuilder *builder);
void yon_translation_init(GtkBuilder *builder);
Loading…
Cancel
Save