diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 1fd2ae6..175cf07 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -79,167 +79,291 @@ void yon_load_proceed(YON_CONFIG_TYPE type){ void yon_interface_update(main_window *widgets){ if (widgets){}; - // enum YON_PAGES page=YON_PAGE_COMPLETED; - // char *type = config(AUTOINSTALL_TYPE_INSTALL); - // if (strcmp(type,"fast")){ - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationRadio),1); - // page = YON_PAGE_INSTALL_COMMON; - // } else if (strcmp(type,"next")){ - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationNearRadio),1); - // page = YON_PAGE_INSTALL_SEPARATE; - // } else if (strcmp(type,"part")){ - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationLinuxRadio),1); - // page = YON_PAGE_INSTALL_SAME_PARTITION; - // } else if (!strcmp(type,"grub_install")){ - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->GrubInstallRadio),1); - // page = YON_PAGE_OPTIONS_GRUB_INSTALL; - // } else if (strcmp(type,"grub_update")){ - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->GrubUpdateRadio),1); - // page = YON_PAGE_OPTIONS_GRUB_UPDATE; - // } else if (strcmp(type,"system_only")){ - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->OSRadio),1); - // page = YON_PAGE_OPTIONS_OS_ONLY; - // } else if (strcmp(type,"data_only")){ - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UserDataOnlyRadio),1); - // page = YON_PAGE_OPTIONS_USRDATA_ONLY; - // } else if (strcmp(type,"custom")){ - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SeparateRadio),1); - // page = YON_PAGE_OPTIONS_SEPARATE; - // } - - // char *device = config(AUTOINSTALL_DEVICE); - // char *part = NULL; - // if (page!=YON_PAGE_INSTALL_COMMON) - // part = config(part_parameter); - - // char *fs_type = config(part_type_parameter); - // char *device_label = config(device_label_parameter); - // char *format = config(device_format_parameter); - // char *part_size = config(part_size_parameter); - - // GtkListStore *device_list = widgets->DevicesList; - // GtkListStore *part_list=widgets->PartitionsList; - // GtkWidget *device_tree=NULL; - // GtkWidget *part_tree=NULL; - // switch (page){ - // case YON_PAGE_INSTALL_COMMON:{ - // device_tree = widgets->CommonInstallationDevicesTree; - // } break; - // case YON_PAGE_INSTALL_SEPARATE:{ - // device_tree = widgets->InstallationNearSysDevicesTree; - // part_tree = widgets->InstallationNearSysSectionTree; - // gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->InstallationNearSizeSpin),atof(part_size)); - // if (part_size[strlen(part_size)-1]=='M') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),0); - // if (part_size[strlen(part_size)-1]=='G') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),1); - // if (part_size[strlen(part_size)-1]=='T') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),2); - // if (!strcmp(format,"no")) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck),0); - // else gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck),1); - // gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->NextInstallationFilesystemTypeCombo),fs_type); - // gtk_entry_set_text(GTK_ENTRY(widgets->NextInstallationSectionNameEntry),device_label); - - // } break; - // case YON_PAGE_INSTALL_SAME_PARTITION:{ - // device_tree = widgets->SamePlaceDeviceTree; - // part_tree = widgets->SamePlacePartTree; - // gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->SameInstallationFilesystemTypeCombo),fs_type); - // if (!strcmp(format,"no")) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SameInstallationFormatCheck),0); - // else gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SameInstallationFormatCheck),1); - // gtk_entry_set_text(GTK_ENTRY(widgets->SameInstallationSectionNameEntry),device_label); - // } break; - // case YON_PAGE_OPTIONS_GRUB_INSTALL:{ - // device_tree = widgets->GrubInstallDevicesTree; - // } break; - // case YON_PAGE_OPTIONS_GRUB_UPDATE:{ - // device_tree = widgets->GrubUpdateDevicesTree; - // } break; - // case YON_PAGE_OPTIONS_SEPARATE:{ - // GtkTreeIter iter; - // device_tree = widgets->SeparateDevicesTree; - // part_tree = widgets->SeparateSysSectionTree; - // for_iter(GTK_TREE_MODEL(device_list),&iter){ - // char *cur_device; - // gtk_tree_model_get(GTK_TREE_MODEL(device_list),&iter, 0,&cur_device,-1); - // if (!strcmp(cur_device,device)){ - // gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(device_tree)),&iter); - // break; - // } - // } - // for_iter(GTK_TREE_MODEL(part_list),&iter){ - // char *cur_part; - // gtk_tree_model_get(GTK_TREE_MODEL(device_list),&iter, 0,&cur_part,-1); - // if (!strcmp(cur_part,part)){ - // gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(part_tree)),&iter); - // } - // } - // } break; - // case YON_PAGE_OPTIONS_OS_ONLY:{ - // device_tree = widgets->OSDevicesTree; - // part_tree = widgets->OSSysSectionTree; - // } break; - // case YON_PAGE_OPTIONS_USRDATA_ONLY:{ - // device_tree = widgets->UserdataDevicesTree; - // part_tree = widgets->UserdataSysSectionTree; - // } break; - // default:{}break; - // } - - // GtkTreeIter iter; - - // char *zone = config(zone_parameter); - // char *region = NULL; - // if (!yon_char_is_empty(zone)) region = yon_char_divide_search(zone,"",-1); - // char *system_locale = config(locale_parameter); - // char *language = config(lang_parameter); - // for_iter(widgets->LanguagesList,&iter){ - // char *cur=NULL; - // gtk_tree_model_get(GTK_TREE_MODEL(widgets->LanguagesList),&iter,1,&cur,-1); - // if (strstr(system_locale,cur)){ - // gtk_list_store_set(GTK_TREE_MODEL(widgets->LanguagesList),&iter,0,1,-1); - // } else { - // gtk_list_store_set(GTK_TREE_MODEL(widgets->LanguagesList),&iter,0,0,-1); - // } - // } - // gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); - // gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->RegionCombo),region); - // gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->ZoneCombo),zone); - // gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->LanguageCombo),language); - - - // char *kbmodel = config (xkbmodel_parameter); - // char *optinos = config(xkboptions_parameter); - // char *layout = config(xkblayout_parameter); - - - - // char *user_name = config(user_name_parameter); - // char *user_gecos = config(user_name_parameter); - // char *user_password = config(user_name_parameter); - // char *root_password = config(user_name_parameter); - // char *autologin = config(user_name_parameter); - // char *hostname = config(user_name_parameter); + enum YON_PAGES page=YON_PAGE_COMPLETED; + char *type = config(AUTOINSTALL_TYPE_INSTALL); + if (!yon_char_is_empty(type)){ + if (!strcmp(type,"fast")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationRadio),1); + page = YON_PAGE_INSTALL_COMMON; + } else if (!strcmp(type,"next")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationNearRadio),1); + page = YON_PAGE_INSTALL_SEPARATE; + } else if (!strcmp(type,"part")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationLinuxRadio),1); + page = YON_PAGE_INSTALL_SAME_PARTITION; + } else if (!strcmp(type,"grub_install")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->GrubInstallRadio),1); + page = YON_PAGE_OPTIONS_GRUB_INSTALL; + } else if (!strcmp(type,"grub_update")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->GrubUpdateRadio),1); + page = YON_PAGE_OPTIONS_GRUB_UPDATE; + } else if (!strcmp(type,"system_only")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->OSRadio),1); + page = YON_PAGE_OPTIONS_OS_ONLY; + } else if (!strcmp(type,"data_only")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UserDataOnlyRadio),1); + page = YON_PAGE_OPTIONS_USRDATA_ONLY; + } else if (!strcmp(type,"custom")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SeparateRadio),1); + page = YON_PAGE_OPTIONS_SEPARATE; + } + } + + char *device = config(AUTOINSTALL_DEVICE); + char *part = NULL; + if (page!=YON_PAGE_INSTALL_COMMON) + part = config(part_parameter); + + char *fs_type = config(part_type_parameter); + char *device_label = config(device_label_parameter); + char *format = config(device_format_parameter); + char *part_size = config(part_size_parameter); + + GtkListStore *device_list = widgets->DevicesList; + GtkListStore *part_list=widgets->PartitionsList; + GtkWidget *device_tree=NULL; + GtkWidget *part_tree=NULL; + switch (page){ + case YON_PAGE_INSTALL_COMMON:{ + device_tree = widgets->CommonInstallationDevicesTree; + } break; + case YON_PAGE_INSTALL_SEPARATE:{ + device_tree = widgets->InstallationNearSysDevicesTree; + part_tree = widgets->InstallationNearSysSectionTree; + if (!yon_char_is_empty(part_size)){ + gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->InstallationNearSizeSpin),atof(part_size)); + if (part_size[strlen(part_size)-1]=='M') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),0); + if (part_size[strlen(part_size)-1]=='G') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),1); + if (part_size[strlen(part_size)-1]=='T') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),2); + } + if (format&&!strcmp(format,"yes")) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck),1); + else gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck),main_config.format_default); + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->NextInstallationFilesystemTypeCombo),fs_type); + gtk_entry_set_text(GTK_ENTRY(widgets->NextInstallationSectionNameEntry),device_label); + + } break; + case YON_PAGE_INSTALL_SAME_PARTITION:{ + device_tree = widgets->SamePlaceDeviceTree; + part_tree = widgets->SamePlacePartTree; + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->SameInstallationFilesystemTypeCombo),fs_type); + if (format&&!strcmp(format,"yes")) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SameInstallationFormatCheck),1); + else gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SameInstallationFormatCheck),main_config.format_default); + if (device_label) + gtk_entry_set_text(GTK_ENTRY(widgets->SameInstallationSectionNameEntry),device_label); + else + gtk_entry_set_text(GTK_ENTRY(widgets->SameInstallationSectionNameEntry),""); + + } break; + case YON_PAGE_OPTIONS_GRUB_INSTALL:{ + device_tree = widgets->GrubInstallDevicesTree; + } break; + case YON_PAGE_OPTIONS_GRUB_UPDATE:{ + device_tree = widgets->GrubUpdateDevicesTree; + } break; + case YON_PAGE_OPTIONS_SEPARATE:{ + GtkTreeIter iter; + device_tree = widgets->SeparateDevicesTree; + part_tree = widgets->SeparateSysSectionTree; + for_iter(GTK_TREE_MODEL(device_list),&iter){ + char *cur_device; + gtk_tree_model_get(GTK_TREE_MODEL(device_list),&iter, 0,&cur_device,-1); + if (!strcmp(cur_device,device)){ + gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(device_tree)),&iter); + break; + } + } + on_near_installation_device_changed(device_tree,widgets); + for_iter(GTK_TREE_MODEL(part_list),&iter){ + char *cur_part; + gtk_tree_model_get(GTK_TREE_MODEL(device_list),&iter, 0,&cur_part,-1); + if (!strcmp(cur_part,part)){ + gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(part_tree)),&iter); + } + } + } break; + case YON_PAGE_OPTIONS_OS_ONLY:{ + device_tree = widgets->OSDevicesTree; + part_tree = widgets->OSSysSectionTree; + } break; + case YON_PAGE_OPTIONS_USRDATA_ONLY:{ + device_tree = widgets->UserdataDevicesTree; + part_tree = widgets->UserdataSysSectionTree; + } break; + default:{}break; + } + + GtkTreeIter iter; + char *cur_device=""; + if (page!=YON_PAGE_OPTIONS_SEPARATE && !yon_char_is_empty(device)){ + for_iter (widgets->DevicesList,&iter){ + gtk_tree_model_get(GTK_TREE_MODEL(widgets->DevicesList),&iter,0,&cur_device,-1); + if (!strcmp(device,cur_device)){ + gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(device_tree)),&iter); + break; + } + } + on_near_installation_device_changed(device_tree,widgets); + if (!yon_char_is_empty(part)){ + for_iter (widgets->PartitionsList,&iter){ + gtk_tree_model_get(GTK_TREE_MODEL(widgets->PartitionsList),&iter,0,&part,-1); + if (!strcmp(device,cur_device)){ + gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(part_tree)),&iter); + break; + } + } + } + } + + + char *system_locale = config(locale_parameter); + if (!yon_char_is_empty(system_locale)){ + for_iter(widgets->LanguagesList,&iter){ + char *cur=NULL; + gtk_tree_model_get(GTK_TREE_MODEL(widgets->LanguagesList),&iter,1,&cur,-1); + if (strstr(system_locale,cur)){ + gtk_list_store_set((widgets->LanguagesList),&iter,0,1,-1); + } else { + gtk_list_store_set((widgets->LanguagesList),&iter,0,0,-1); + } + } + gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); + } else { + for_iter(widgets->LanguagesList,&iter){ + gtk_list_store_set((widgets->LanguagesList),&iter,0,0,-1); + } + gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); + } + + char *zone = config(zone_parameter); + char *region = NULL; + if (!yon_char_is_empty(zone)) region = yon_char_divide_search(zone,"/",-1); + if (!yon_char_is_empty(region)){ + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->RegionCombo),region); + } else { + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->RegionCombo),0); + } + + if (!yon_char_is_empty(zone)){ + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->ZoneCombo),zone); + } else { + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->ZoneCombo),0); + } + + char *language = config(lang_parameter); + if (!yon_char_is_empty(language)){ + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->LanguageCombo),language); + } else { + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->LanguageCombo),0); + } + + + char *kbmodel = config (xkbmodel_parameter); + char *optinos = config(xkboptions_parameter); + char *layout = config(xkblayout_parameter); + + if (!yon_char_is_empty(kbmodel)){ + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->KeyboardModelCombo),kbmodel); + } else gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->KeyboardModelCombo),0); + + if (!yon_char_is_empty(optinos)){ + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->LayoutBindingCombo),optinos); + } else gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->LayoutBindingCombo),0); + + if (!yon_char_is_empty(layout)){ + for_iter(widgets->LayoutList,&iter){ + char *cur=NULL; + gtk_tree_model_get(GTK_TREE_MODEL(widgets->LayoutList),&iter,1,&cur,-1); + if (strstr(layout,cur)){ + gtk_tree_store_set(widgets->LayoutList,&iter,0,1,-1); + } else { + gtk_tree_store_set(widgets->LayoutList,&iter,0,0,-1); + } + } + gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); + } else { + for_iter(widgets->LayoutList,&iter){ + gtk_tree_store_set((widgets->LayoutList),&iter,0,0,-1); + } + gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); + } + + char *user_name = config(user_name_parameter); + char *user_gecos = config(user_gecos_parameter); + char *user_password = config(user_password_parameter); + char *root_password = config(root_password_parameter); + char *autologin = config(autologin_parameter); + char *hostname = config(hostname_parameter); + + if (!yon_char_is_empty(user_name)){ + gtk_entry_set_text(GTK_ENTRY(widgets->LoginEntry),user_name); + } else gtk_entry_set_text(GTK_ENTRY(widgets->LoginEntry),""); + + if (!yon_char_is_empty(user_gecos)){ + gtk_entry_set_text(GTK_ENTRY(widgets->UserNameEntry),user_gecos); + } else gtk_entry_set_text(GTK_ENTRY(widgets->UserNameEntry),""); + + 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 { + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->PasswordCombo),0); + gtk_entry_set_text(GTK_ENTRY(widgets->PasswordEntry),""); + } + + 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 { + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->AdminPasswordCombo),0); + gtk_entry_set_text(GTK_ENTRY(widgets->AdminPasswordEntry),""); + } + + if (!yon_char_is_empty(autologin)){ + if (!strcmp(autologin,"yes")) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AutologinCheck),1); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AutologinCheck),0); + } else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AutologinCheck),main_config.autologin_default); + + if (!yon_char_is_empty(hostname)){ + if (strcmp(hostname,"auto")){ + gtk_entry_set_text(GTK_ENTRY(widgets->HotnameEntry),hostname); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AutoHostnameCheck),0); + } else{ + gtk_entry_set_text(GTK_ENTRY(widgets->HotnameEntry),""); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AutoHostnameCheck),1); + } + } else { + gtk_entry_set_text(GTK_ENTRY(widgets->HotnameEntry),""); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AutoHostnameCheck),1); + } } -void on_config_local_load(GtkWidget *,main_window *); -void on_config_local_load(GtkWidget *,main_window *){ +void on_config_local_load(GtkWidget *,main_window *widgets); +void on_config_local_load(GtkWidget *,main_window *widgets){ yon_load_proceed(YON_CONFIG_LOCAL); + yon_interface_update(widgets); main_config.load_mode=1; } void on_config_global_load(GtkWidget *,main_window *); -void on_config_global_load(GtkWidget *,main_window *){ +void on_config_global_load(GtkWidget *,main_window *widgets){ yon_load_proceed(YON_CONFIG_GLOBAL); + yon_interface_update(widgets); main_config.load_mode=0; } void on_config_custom_load(GtkWidget *,main_window *); -void on_config_custom_load(GtkWidget *,main_window *){ +void on_config_custom_load(GtkWidget *,main_window *widgets){ yon_load_proceed(YON_CONFIG_CUSTOM); + yon_interface_update(widgets); main_config.load_mode=3; } @@ -963,10 +1087,10 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ GtkTreeModel *model = GTK_TREE_MODEL(widgets->LanguagesFilter); char *lang_code=NULL; for_iter(model,&iter){ - gtk_tree_model_get(model,&iter,1,&lang_code,-1); - languages = yon_char_unite(languages,",",lang_code,NULL); + gtk_tree_model_get(model,&iter,2,&lang_code,-1); + languages = yon_char_unite(languages,!yon_char_is_empty(languages)?",":"",lang_code,NULL); } - if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->AvailableLanguagesEntry)))){ + if (yon_char_is_empty(languages)){ yon_config_remove_by_key(locale_parameter); } else { yon_config_register(locale_parameter,locale_parameter_command,languages); @@ -1017,9 +1141,9 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ yon_config_remove_by_key(xkbmodel_parameter); } if (!yon_char_is_empty(layouts_list)) - yon_config_register(locale_parameter,locale_parameter_command,layouts_list); + yon_config_register(xkblayout_parameter,xkblayout_parameter_command,layouts_list); else - yon_config_remove_by_key(locale_parameter); + yon_config_remove_by_key(xkblayout_parameter); gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),page+1); } break; @@ -1153,7 +1277,7 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->LoginEntry)))){ yon_config_remove_by_key(user_name_parameter); } else { - char *login = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry)); + char *login = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->LoginEntry)); yon_config_register(user_name_parameter,user_name_parameter_command,login); } @@ -1194,7 +1318,7 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ yon_config_remove_by_key(hostname_parameter); } else { - char *hostname = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry)); + char *hostname = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->HotnameEntry)); yon_config_register(hostname_parameter,hostname_parameter_command,hostname); } @@ -1212,7 +1336,6 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ gtk_tree_model_get(GTK_TREE_MODEL(widgets->LayoutsFilter),&iter,0,&id,3,&status,-1); if (status){ char *temp = yon_char_unite(locales,!yon_char_is_empty(locales)?",":"",id,NULL); - free(locales); locales=temp; } } @@ -1563,7 +1686,6 @@ void on_separate_installation_changed(GtkWidget *self, main_window *widgets){ } } -void on_near_installation_device_changed(GtkWidget *self, main_window *widgets); void on_near_installation_device_changed(GtkWidget *self, main_window *widgets){ gtk_list_store_clear(widgets->PartitionsList); GtkTreeIter iter; diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 7e3739e..a479794 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -106,7 +106,7 @@ NULL #define locale_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[locale]" #define device_format_parameter "AUTOINSTALL[device_format]" #define device_format_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[device_format]" -#define device_label_parameter "AUTOINSTALL[part_label]" +#define device_label_parameter "AUTOINSTALL[device_label]" #define device_label_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[part_label]" #define part_size_parameter "AUTOINSTALL[part_size]" #define part_size_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[part_size]" @@ -135,10 +135,10 @@ NULL #define full_log_path "/var/log/ubinstall.log" -#define yon_config_get_custom_command(target) yon_char_unite("ubconfig --source ",target," get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra]",NULL) -#define config_get_local_command "ubconfig --source system get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra]" -#define config_get_global_command yon_char_new("ubconfig --source global get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra]") -#define config_get_default_command "ubconfig --source default get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra]" +#define yon_config_get_custom_command(target) yon_char_unite("ubconfig --source ",target," get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra] AUTOINSTALL[device_label] AUTOINSTALL[locale]",NULL) +#define config_get_local_command "ubconfig --source system get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra] AUTOINSTALL[device_label] AUTOINSTALL[locale]" +#define config_get_global_command yon_char_new("ubconfig --source global get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra] AUTOINSTALL[device_label] AUTOINSTALL[locale]") +#define config_get_default_command "ubconfig --source default get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra] AUTOINSTALL[device_label] AUTOINSTALL[locale]" #define config_get_global_only_parameters "" #define config_get_local_only_parameters "" @@ -203,6 +203,8 @@ typedef struct { guint progress_thread; int configure_mode; int log_progress_buzy; + int autologin_default; + int format_default; } config; typedef struct { @@ -423,4 +425,5 @@ char* yon_debug_output(char *pattern,char*text); char *yon_save_command_prepare(char *command, char *target); void yon_interface_update(main_window *widgets); -void on_summary_log_view(GtkWidget *); \ No newline at end of file +void on_summary_log_view(GtkWidget *); +void on_near_installation_device_changed(GtkWidget *self, main_window *widgets); \ No newline at end of file diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 6153559..d1176b9 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -143,3 +143,20 @@ #define LOG_VIEW_LABEL _("Log exploration") #define SAVE_LABEL _("Save") #define LOAD_LABEL _("Load") + + +#define LOAD_GLOBAL_LABEL _("Load global configuration") +#define LOAD_LOCAL_LABEL _("Load local configuration") +#define LOAD_CUSTOM_LABEL _("Load from specific file") + +#define SAVE_ALL_LABEL _("Save configuration") +#define SAVE_GLOBAL_LABEL _("Save to global configuration") +#define SAVE_LOCAL_LABEL _("Save to local configuration") +#define SAVE_CUSTOM_LABEL _("Save to specific file") + +#define CONFIGURATION_TITLE_LABEL _("Configuration") +#define CONFIGURATION_FINISH_HEAD_LABEL _("Installer configuration has been finished") +#define CONFIGURATION_FINISH_LABEL _("Choose a save option on the header bar") + +#define CONFIGURATION_SAVE_HEAD_LABEL _("Configuration has been saved") +#define CONFIGURATION_SAVE_LABEL _("You can safely exit configurator or return and create new configuration file.") \ No newline at end of file diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 0ef282d..8938134 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -564,6 +564,7 @@ agreement 5 5 left + False True @@ -1000,7 +1001,6 @@ and help you install UBLinux on your computer - True True False True diff --git a/ubinstall-gtk.pot b/ubinstall-gtk.pot index 3e4df4b..61832ea 100644 --- a/ubinstall-gtk.pot +++ b/ubinstall-gtk.pot @@ -549,6 +549,42 @@ msgstr "" msgid "Log exploration" msgstr "" +msgid "Load global configuration" +msgstr "" + +msgid "Load local configuration" +msgstr "" + +msgid "Load from specific file" +msgstr "" + +msgid "Save configuration" +msgstr "" + +msgid "Save to global configuration" +msgstr "" + +msgid "Save to local configuration" +msgstr "" + +msgid "Save to specific file" +msgstr "" + +msgid "Configuration" +msgstr "" + +msgid "Installer configuration has been finished" +msgstr "" + +msgid "Choose a save option on the header bar" +msgstr "" + +msgid "Configuration has been saved" +msgstr "" + +msgid "You can safely exit configurator or return and create new configuration file." +msgstr "" + msgid "Afrikaans" msgstr "" diff --git a/ubinstall-gtk_ru.po b/ubinstall-gtk_ru.po index 3f8c82b..c9bb321 100644 --- a/ubinstall-gtk_ru.po +++ b/ubinstall-gtk_ru.po @@ -332,13 +332,17 @@ msgstr "Расширенный режим установки" #: source/ubl-strings.h:72 msgid "" "Installing OS files, user data on different partitions, creating RAID, etc." -msgstr "Установка файлов ОС, пользовательских данныъ на разные разделы, создание RAID и др." +msgstr "" +"Установка файлов ОС, пользовательских данныъ на разные разделы, создание " +"RAID и др." #: source/ubl-strings.h:73 msgid "" -"Attention! The selected OS UBLinux components will be installed\n" +"Attention! The selected OC UBLinux components will be installed\n" "separately into the selected partition." -msgstr "Внимание! В выбранный раздел будет произведена раздельная установка выбранных компонентов ОС UBLinux/" +msgstr "" +"Внимание! В выбранный раздел будет произведена раздельная установка " +"выбранных компонентов ОС UBLinux/" #: source/ubl-strings.h:74 msgid "GRUB install" @@ -362,7 +366,8 @@ msgstr "Раздельная установка" #: source/ubl-strings.h:79 msgid "Installing OS components and user data on different disk partitions" -msgstr "Установка компонентов ОС и пользовательских данных на разные разделы диска" +msgstr "" +"Установка компонентов ОС и пользовательских данных на разные разделы диска" #: source/ubl-strings.h:80 msgid "OS only" @@ -571,6 +576,44 @@ msgstr "Во время процесса установки произошла msgid "Log exploration" msgstr "Просмотр лога" +msgid "Load global configuration" +msgstr "Загрузить глобальную конфигурацию" + +msgid "Load local configuration" +msgstr "Загрузить локальную конфигурацию" + +msgid "Load from specific file" +msgstr "Зашрузить из файла" + +msgid "Save configuration" +msgstr "Сохранить конфигурацию" + +msgid "Save to global configuration" +msgstr "Сохранить глобальную конфигурацию" + +msgid "Save to local configuration" +msgstr "Сохранить в локальную конфигурацию" + +msgid "Save to specific file" +msgstr "Сохранить в файл" + +msgid "Configuration" +msgstr "Конфигурация" + +msgid "Installer configuration has been finished" +msgstr "Настройка конфигурации завершена" + +msgid "Choose a save option on the header bar" +msgstr "Выберите опцию сохранения на верхней панели" + +#, fuzzy +msgid "Configuration has been saved" +msgstr "Конфигурация сохранена" + +msgid "" +"You can safely exit configurator or return and create new configuration file." +msgstr "Вы можете выйти из настройки конфигурации или настроить другой файл конфигурации." + msgid "Afrikaans" msgstr "Африканский"