From f71848ea9d88c37f9c2a7e6039af9769c61be4a4 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 3 Jul 2025 18:00:11 +0600 Subject: [PATCH] WIP navigation; WIP network saving; WIP kernel saving --- source/CMakeLists.txt | 1 + source/ubinstall-gtk-components.c | 3 - source/ubinstall-gtk-configuration-mode.c | 25 ++++++ source/ubinstall-gtk-installation.c | 34 +++++--- source/ubinstall-gtk-network.c | 95 +++++++++++++++++++++++ source/ubinstall-gtk-page-switch.c | 24 +++++- source/ubinstall-gtk-region.c | 18 ++++- source/ubinstall-gtk.c | 47 +---------- source/ubinstall-gtk.h | 22 +++++- ubinstall-gtk-network-box.glade | 18 +++++ ubinstall-gtk.glade | 27 ++++++- 11 files changed, 248 insertions(+), 66 deletions(-) create mode 100644 source/ubinstall-gtk-configuration-mode.c diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index c81cf69..9a5fe02 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -115,6 +115,7 @@ set(SOURCE_FILES ubinstall-gtk-network.c ubinstall-gtk-separate.c ubinstall-gtk-users.c + ubinstall-gtk-configuration-mode.c ubinstall-gtk.h ubl-strings.h ) diff --git a/source/ubinstall-gtk-components.c b/source/ubinstall-gtk-components.c index 245bd14..67ca9bc 100644 --- a/source/ubinstall-gtk-components.c +++ b/source/ubinstall-gtk-components.c @@ -13,9 +13,6 @@ int yon_kernel_save(main_window *widgets){ yon_char_parsed_add_or_create_if_exists(kernels,&size,target); } } - if (!size){ - return 0; - } return 1; } diff --git a/source/ubinstall-gtk-configuration-mode.c b/source/ubinstall-gtk-configuration-mode.c new file mode 100644 index 0000000..d0b0e8f --- /dev/null +++ b/source/ubinstall-gtk-configuration-mode.c @@ -0,0 +1,25 @@ +#include "ubinstall-gtk.h" + +void on_configuration_mode_switch(GtkWidget *self,main_window *widgets){ + if (getuid()) { + if (main_config.configure_mode==1){ + char *argline = LocaleName; + for (int i=1;iMainWindow); + } + } + } + main_config.configure_mode = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(self)); +} diff --git a/source/ubinstall-gtk-installation.c b/source/ubinstall-gtk-installation.c index 6f2c073..6fcdfc4 100644 --- a/source/ubinstall-gtk-installation.c +++ b/source/ubinstall-gtk-installation.c @@ -151,23 +151,23 @@ int yon_advanced_sections_save(dictionary *dict){ char *size = yon_char_unite(size_first,size_last?",":NULL,size_last,NULL); yon_config_register(part_size_parameter,part_size_parameter_command,size); - char *device_label_first = gtk_entry_get_text(GTK_ENTRY(first_section->SectionMarkEntry)); - char *device_label_last = last_section&&!strcmp(format_last,"yes")?gtk_entry_get_text(GTK_ENTRY(last_section->SectionMarkEntry)):NULL; + char *device_label_first = (char*)gtk_entry_get_text(GTK_ENTRY(first_section->SectionMarkEntry)); + char *device_label_last = last_section&&!strcmp(format_last,"yes")?(char*)gtk_entry_get_text(GTK_ENTRY(last_section->SectionMarkEntry)):NULL; char *device_label = yon_char_unite(device_label_first,device_label_last?",":NULL,device_label_last,NULL); yon_config_register(device_label_parameter,device_label_parameter_command,device_label); - char *fs_label_first = gtk_entry_get_text(GTK_ENTRY(first_section->FileSystemMarkentry)); - char *fs_label_last = last_section&&!strcmp(format_last,"yes")?gtk_entry_get_text(GTK_ENTRY(last_section->FileSystemMarkentry)):NULL; + char *fs_label_first = (char*)gtk_entry_get_text(GTK_ENTRY(first_section->FileSystemMarkentry)); + char *fs_label_last = last_section&&!strcmp(format_last,"yes")?(char*)gtk_entry_get_text(GTK_ENTRY(last_section->FileSystemMarkentry)):NULL; char *fs_label = yon_char_unite(fs_label_first,fs_label_last?",":NULL,fs_label_last,NULL); yon_config_register(part_fs_label_parameter,part_fs_label_parameter_command,fs_label); - char *fs_type_first = gtk_combo_box_get_active_id(GTK_COMBO_BOX(first_section->FileSystemTypeCombo)); - char *fs_type_last = last_section&&!strcmp(format_last,"yes")?gtk_combo_box_get_active_id(GTK_COMBO_BOX(last_section->FileSystemTypeCombo)):NULL; + char *fs_type_first = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(first_section->FileSystemTypeCombo)); + char *fs_type_last = last_section&&!strcmp(format_last,"yes")?(char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(last_section->FileSystemTypeCombo)):NULL; char *fs_type = yon_char_unite(fs_type_first,fs_type_last?",":NULL,fs_type_last,NULL); yon_config_register(part_type_parameter,part_type_parameter_command,fs_type); - char *part_crypt_first = gtk_combo_box_get_active(first_section->EncryptionCombo)?gtk_entry_get_text(GTK_ENTRY(first_section->EncryptionEntry)):NULL; - char *part_crypt_last = last_section&&!strcmp(format_last,"yes")&>k_combo_box_get_active(last_section->EncryptionCombo)?gtk_entry_get_text(GTK_ENTRY(first_section->EncryptionEntry)):NULL; + char *part_crypt_first = gtk_combo_box_get_active(GTK_COMBO_BOX(first_section->EncryptionCombo))?(char*)gtk_entry_get_text(GTK_ENTRY(first_section->EncryptionEntry)):NULL; + char *part_crypt_last = last_section&&!strcmp(format_last,"yes")&>k_combo_box_get_active(GTK_COMBO_BOX(last_section->EncryptionCombo))?(char*)gtk_entry_get_text(GTK_ENTRY(first_section->EncryptionEntry)):NULL; char *part_crypt = NULL; if (part_crypt_first||part_crypt_last){ part_crypt = yon_char_unite(part_crypt_first,part_crypt_last?",":NULL,part_crypt_last,NULL); @@ -201,7 +201,9 @@ int yon_install_advanced_save(main_window *widgets){ char *part; gtk_tree_model_get(model,&iter,0,&part,-1); - yon_advanced_section_get_string(widgets->advanced_sections); + if (!yon_advanced_sections_save(widgets->advanced_sections)){ + return 0; + } if (gtk_switch_get_active(GTK_SWITCH(widgets->AdvancedSwapSwitch))){ if (gtk_switch_get_active(GTK_SWITCH(widgets->AdvancedSwapAutoSwitch))){ @@ -215,6 +217,20 @@ int yon_install_advanced_save(main_window *widgets){ yon_config_register(swap_size_parameter,swap_size_parameter_command,swap); } } + const char *device_typevfs = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->AdvancedVirtualDeviceCombo)); + if (!yon_char_is_empty(device_typevfs)){ + yon_config_register(device_typevfs_parameter,device_typevfs_parameter_command,(char*)device_typevfs); + } else { + yon_config_remove_by_key(device_typevfs_parameter); + } + if (gtk_switch_get_active(GTK_SWITCH(widgets->AdvancedLoadTypeSwitch))){ + char *bios = gtk_switch_get_active(GTK_SWITCH(widgets->AdvancedBiosSectorSwitch))?"bios":""; + char *efi = gtk_switch_get_active(GTK_SWITCH(widgets->AdvancedEFISwitch))?"efi":NULL; + char *boot = yon_char_unite(bios,!yon_char_is_empty(bios)&&!yon_char_is_empty(efi)?"+":"",efi,NULL); + yon_config_register(boot_parameter,boot_parameter_command,boot); + } else { + yon_config_register(boot_parameter,boot_parameter_command,"none"); + } return 1; } \ No newline at end of file diff --git a/source/ubinstall-gtk-network.c b/source/ubinstall-gtk-network.c index 6df7f1f..c1d4e4f 100644 --- a/source/ubinstall-gtk-network.c +++ b/source/ubinstall-gtk-network.c @@ -6,6 +6,7 @@ network_info *yon_network_info_new(){ info->MainBox = yon_gtk_builder_get_widget(builder,"MainBox"); info->TypeCombo = yon_gtk_builder_get_widget(builder,"TypeCombo"); info->ConnectionCombo = yon_gtk_builder_get_widget(builder,"ConnectionCombo"); + info->ConnectionEntry = yon_gtk_builder_get_widget(builder,"ConnectionEntry"); info->EnabledSwitch = yon_gtk_builder_get_widget(builder,"EnabledSwitch"); info->RemoveButton = yon_gtk_builder_get_widget(builder,"RemoveButton"); info->AutoGetIPSwitch = yon_gtk_builder_get_widget(builder,"AutoGetIPSwitch"); @@ -17,5 +18,99 @@ network_info *yon_network_info_new(){ g_object_set_data(G_OBJECT(info->RemoveButton),"network_info",info); g_object_set_data(G_OBJECT(info->MainBox),"network_info",info); + gtk_widget_show(info->MainBox); return info; +} + +void on_ntp_sync(GtkWidget *, main_window *widgets){ + int mode = gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->NetworkNTPCombo)); + gtk_widget_set_sensitive(widgets->NetworkNTPEntry,0); + switch(mode){ + case 0: + gtk_entry_set_text(GTK_ENTRY(widgets->NetworkNTPEntry),""); + gtk_entry_set_placeholder_text(GTK_ENTRY(widgets->NetworkNTPEntry),""); + break; + case 2:{ + int size; + config_str parsed = yon_config_load(get_ntp_default_command,&size); + if (size&&!yon_char_is_empty(parsed[0])&&strcmp(parsed[0],"(null)\n")){ + free(yon_char_divide_search(parsed[0],"=",-1)); + yon_char_remove_last_symbol(parsed[0],'\n'); + yon_char_remove_brackets(parsed[0]); + gtk_entry_set_placeholder_text(GTK_ENTRY(widgets->NetworkNTPEntry),parsed[0]); + yon_char_parsed_free(parsed,size); + gtk_entry_set_text(GTK_ENTRY(widgets->NetworkNTPEntry),""); + } + } + break; + case 3:{ + int size; + config_str parsed = yon_config_load(get_ntp_ru_command,&size); + if (size&&!yon_char_is_empty(parsed[0])&&strcmp(parsed[0],"(null)\n")){ + free(yon_char_divide_search(parsed[0],"=",-1)); + yon_char_remove_last_symbol(parsed[0],'\n'); + yon_char_remove_brackets(parsed[0]); + gtk_entry_set_placeholder_text(GTK_ENTRY(widgets->NetworkNTPEntry),parsed[0]); + yon_char_parsed_free(parsed,size); + gtk_entry_set_text(GTK_ENTRY(widgets->NetworkNTPEntry),""); + } + } + break; + case 1: + gtk_entry_set_placeholder_text(GTK_ENTRY(widgets->NetworkNTPEntry),"DHCP"); + gtk_entry_set_text(GTK_ENTRY(widgets->NetworkNTPEntry),""); + break; + case 5: + gtk_entry_set_placeholder_text(GTK_ENTRY(widgets->NetworkNTPEntry),""); + gtk_entry_set_text(GTK_ENTRY(widgets->NetworkNTPEntry),""); + break; + case 4: + gtk_widget_set_sensitive(widgets->NetworkNTPEntry,1); + gtk_entry_set_placeholder_text(GTK_ENTRY(widgets->NetworkNTPEntry),""); + gtk_entry_set_text(GTK_ENTRY(widgets->NetworkNTPEntry),""); + break; + } +} + +void on_connection_add(main_window *widgets){ + network_info *info = yon_network_info_new(); + gtk_box_pack_start(GTK_BOX(widgets->NetworkConnectionsBox),info->MainBox,0,0,0); +} + +int yon_network_save(main_window *widgets){ + if (gtk_switch_get_active(GTK_SWITCH(widgets->NetworkDomainSwitch))){ + // const char *domain_name = gtk_entry_get_text(GTK_ENTRY(widgets->NetworkDomainNameEntry)); + // const char *domain_admin = gtk_entry_get_text(GTK_ENTRY(widgets->NetworkDomainAdminEntry)); + // const char *domain_password = gtk_entry_get_text(GTK_ENTRY(widgets->NetworkDomainPasswordEntry)); + } + if (gtk_switch_get_active(GTK_SWITCH(widgets->NetworkNTPServerSwitch))){ + + int mode = gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->NetworkNTPCombo)); + switch(mode){ + case 0:yon_config_remove_by_key(NTPSERVERS_parameter); + break; + case 1:yon_config_register(NTPSERVERS_parameter,NTPSERVERS_parameter_command,"dhcp"); + break; + case 2:yon_config_register(NTPSERVERS_parameter,NTPSERVERS_parameter_command,"default"); + break; + case 3:yon_config_register(NTPSERVERS_parameter,NTPSERVERS_parameter_command,"ntp-ru"); + break; + case 5:yon_config_register(NTPSERVERS_parameter,NTPSERVERS_parameter_command,"disable"); + break; + case 6:yon_config_register(NTPSERVERS_parameter,NTPSERVERS_parameter_command,"stop"); + break; + case 4: + char *value = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->NetworkNTPEntry)); + if (yon_char_is_empty(value)) { + yon_ubl_status_box_render(EMPTY_IMPORTANT_LABEL,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(widgets->NetworkNTPEntry); + return 0; + } + yon_config_register(NTPSERVERS_parameter,NTPSERVERS_parameter_command,value); + break; + } + } else { + yon_config_remove_by_key(NTPSERVERS_parameter); + } + return 1; } \ No newline at end of file diff --git a/source/ubinstall-gtk-page-switch.c b/source/ubinstall-gtk-page-switch.c index 102f13f..da2ac11 100644 --- a/source/ubinstall-gtk-page-switch.c +++ b/source/ubinstall-gtk-page-switch.c @@ -1,11 +1,14 @@ #include "ubinstall-gtk.h" enum YON_PAGES yon_page_get_next(main_window *widgets, enum YON_PAGES page){ + if (!yon_page_save(widgets,page)){ + return -1; + } switch (page){ case YON_PAGE_WELCOME: return YON_PAGE_LICENCE; break; case YON_PAGE_LICENCE: return YON_PAGE_SECTIONS; break; case YON_PAGE_SECTIONS: return yon_sections_get_next_page(widgets); break; - case YON_PAGE_OS_COMPONENTS: return YON_PAGE_INSTALLATION_BEGIN; break; + case YON_PAGE_OS_COMPONENTS: return main_config.configure_mode? YON_PAGE_KERNEL : YON_PAGE_INSTALLATION_BEGIN; break; case YON_PAGE_INSTALLATION_BEGIN: return YON_PAGE_KERNEL; break; case YON_PAGE_KERNEL: return YON_PAGE_SOFTWARE; break; case YON_PAGE_SOFTWARE: return YON_PAGE_REGION; break; @@ -14,7 +17,7 @@ enum YON_PAGES yon_page_get_next(main_window *widgets, enum YON_PAGES page){ case YON_PAGE_USERS: return YON_PAGE_STARTUP; break; case YON_PAGE_STARTUP: return YON_PAGE_BOOTLOADER; break; case YON_PAGE_BOOTLOADER: return YON_PAGE_NETWORK; break; - case YON_PAGE_NETWORK: return YON_PAGE_INSTALLATION; break; + case YON_PAGE_NETWORK: return main_config.configure_mode? YON_PAGE_CONFIGURE_END : YON_PAGE_INSTALLATION; break; case YON_PAGE_INSTALL_COMMON: return YON_PAGE_KERNEL; break; case YON_PAGE_INSTALL_SEPARATE: return YON_PAGE_KERNEL; break; case YON_PAGE_INSTALL_SAME_PARTITION: return YON_PAGE_KERNEL; break; @@ -129,7 +132,7 @@ int yon_page_save(main_window *widgets, enum YON_PAGES page){ return yon_bootloader_save(widgets); break; case YON_PAGE_NETWORK: - // return yon_network_save(widgets); + return yon_network_save(widgets); break; case YON_PAGE_INSTALL_COMMON: return yon_install_common_save(widgets); @@ -160,9 +163,24 @@ int yon_page_save(main_window *widgets, enum YON_PAGES page){ return 1; } +void yon_configuration_mode_check(main_window *widgets){ + enum YON_PAGES page = gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->Notebook)); + if (page==YON_PAGE_WELCOME){ + gtk_widget_set_sensitive(widgets->ConfigurationModeMenuItem,1); + } else { + gtk_widget_set_sensitive(widgets->ConfigurationModeMenuItem,0); + } + if (page == YON_PAGE_CONFIGURE_END){ + gtk_widget_show(widgets->SaveButton); + } else { + gtk_widget_hide(widgets->SaveButton); + } +} + void yon_page_update(main_window *widgets){ yon_navigation_buttons_set_sensetiveness(widgets); yon_switch_page_render(widgets); + yon_configuration_mode_check(widgets); } enum YON_PAGES yon_sections_get_next_page(main_window *widgets){ diff --git a/source/ubinstall-gtk-region.c b/source/ubinstall-gtk-region.c index 80439cb..27b85da 100644 --- a/source/ubinstall-gtk-region.c +++ b/source/ubinstall-gtk-region.c @@ -40,4 +40,20 @@ int yon_region_save(main_window *widgets){ yon_config_remove_by_key(zone_parameter); } return 1; -} \ No newline at end of file +} + +void on_region_changed(GtkComboBox *self, main_window *widgets){ + char *active = (char*)gtk_combo_box_get_active_id(self); + active = yon_char_append("/usr/share/zoneinfo/",active); + int size; + gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->ZoneCombo)); + if (yon_file_is_directory(active)){ + config_str parsed = yon_file_ls(active,&size); + for (int i=0;iZoneCombo),parsed[i],_(parsed[i])); + } + if (size) yon_char_parsed_free(parsed,size); + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->ZoneCombo),0); + } + free(active); +} diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 97f7898..2c5022c 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -661,30 +661,6 @@ void on_toggle_button_switch_on(GtkWidget *, GtkToggleButton *toggle){ // yon_launch(argline); // } -// void on_configuration_mode_switch(GtkWidget *self,main_window *widgets){ -// if (getuid()) { -// if (main_config.configure_mode==1){ -// char *argline = LocaleName; -// for (int i=1;iMainWindow); -// } -// } -// } -// main_config.configure_mode = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(self)); -// } - // int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled){ // int width = gtk_widget_get_allocated_width((gtk_widget_get_parent(GTK_WIDGET(target)))); // int height = gtk_widget_get_allocated_height((gtk_widget_get_parent(GTK_WIDGET(target)))); @@ -1161,23 +1137,6 @@ void yon_switch_page_render(main_window *widgets){ // // } - -// void on_region_changed(GtkComboBox *self, main_window *widgets){ -// char *active = (char*)gtk_combo_box_get_active_id(self); -// active = yon_char_append("/usr/share/zoneinfo/",active); -// int size; -// gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->ZoneCombo)); -// if (yon_file_is_directory(active)){ -// config_str parsed = yon_file_ls(active,&size); -// for (int i=0;iZoneCombo),parsed[i],_(parsed[i])); -// } -// if (size) yon_char_parsed_free(parsed,size); -// gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->ZoneCombo),0); -// } -// free(active); -// } - // void on_locale_changed(GtkWidget *,main_window *){ // // } @@ -1666,7 +1625,7 @@ main_window *yon_main_window_complete(){ widgets->NetworkDomainSwitch = yon_gtk_builder_get_widget(builder,"NetworkDomainSwitch"); widgets->NetworkDomainNameEntry = yon_gtk_builder_get_widget(builder,"NetworkDomainNameEntry"); widgets->NetworkDomainAdminEntry = yon_gtk_builder_get_widget(builder,"NetworkDomainAdminEntry"); - widgets->DomainPasswordEntry = yon_gtk_builder_get_widget(builder,"DomainPasswordEntry"); + widgets->NetworkDomainPasswordEntry = yon_gtk_builder_get_widget(builder,"NetworkDomainPasswordEntry"); widgets->NetworkNTPServerSwitch = yon_gtk_builder_get_widget(builder,"NetworkNTPServerSwitch"); widgets->NetworkNTPCombo = yon_gtk_builder_get_widget(builder,"NetworkNTPCombo"); widgets->NetworkNTPEntry = yon_gtk_builder_get_widget(builder,"NetworkNTPEntry"); @@ -1717,7 +1676,7 @@ main_window *yon_main_window_complete(){ g_signal_connect(G_OBJECT(widgets->BackButton),"clicked",G_CALLBACK(on_page_prev_clicked),widgets); // g_signal_connect(G_OBJECT(widgets->CancelInstallButton),"clicked",G_CALLBACK(on_page_navigation_clicked),widgets); // g_signal_connect(G_OBJECT(widgets->AvailableLanguagesButton),"clicked",G_CALLBACK(on_language_clicked),widgets); - // g_signal_connect(G_OBJECT(widgets->RegionCombo),"changed",G_CALLBACK(on_region_changed),widgets); + g_signal_connect(G_OBJECT(widgets->RegionCombo),"changed",G_CALLBACK(on_region_changed),widgets); // g_signal_connect(G_OBJECT(widgets->LayoutSensitiveCheck),"toggled",G_CALLBACK(on_layout_toggle_button_switch),widgets); // g_signal_connect(G_OBJECT(widgets->AddButton),"clicked",G_CALLBACK(on_keyboard_clicked),widgets); // g_signal_connect(G_OBJECT(widgets->RemoveButton),"clicked",G_CALLBACK(on_keyboard_removed),widgets); @@ -1730,7 +1689,7 @@ main_window *yon_main_window_complete(){ // g_signal_connect(G_OBJECT(widgets->OSDevicesTree),"cursor-changed",G_CALLBACK(on_near_installation_device_changed),widgets); // g_signal_connect(G_OBJECT(widgets->SeparateDevicesTree),"cursor-changed",G_CALLBACK(on_separate_installation_changed),widgets); - // g_signal_connect(G_OBJECT(widgets->ConfigurationModeMenuItem),"toggled",G_CALLBACK(on_configuration_mode_switch),widgets); + g_signal_connect(G_OBJECT(widgets->ConfigurationModeMenuItem),"toggled",G_CALLBACK(on_configuration_mode_switch),widgets); // g_signal_connect(G_OBJECT(widgets->DocumentationMenuItem),"activate",G_CALLBACK(on_open_documentation_confirmation),widgets); // g_signal_connect(G_OBJECT(widgets->AboutMenuItem),"activate",G_CALLBACK(on_about),widgets); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 25442ae..7aef6a5 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -65,6 +65,9 @@ "/com/ublinux/images/slide-12.png", \ NULL +#define get_ntp_default_command "ubconfig --default get [network] NTPSERVERS_DEFAULT" +#define get_ntp_ru_command "ubconfig --default get [network] NTPSERVERS_RU" + #define get_models_command "sed '/<\\/modelList>/q' /usr/share/X11/xkb/rules/base.xml | grep -E '^ {8,8}|^ {8,8}'|sed -e 's/ *//g' -e 's,,,g' -e 's/ *//g' -e 's,,,g'" #define check_is_password_hash(password) system(yon_char_unite("/lib/ublinux/functions is_hash_password '", password,"'",NULL)) @@ -133,6 +136,12 @@ NULL #define swap_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[swap]" #define swap_size_parameter "AUTOINSTALL[swap_size]" #define swap_size_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[swap_size]" +#define boot_parameter "AUTOINSTALL[boot]" +#define boot_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[boot]" +#define device_typevfs_parameter "AUTOINSTALL[device_typevfs]" +#define device_typevfs_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[device_typevfs]" +#define NTPSERVERS_parameter "AOUTINSTALL[ubconfig set [network] NTPSERVERS]" +#define NTPSERVERS_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[ubconfig set [network] NTPSERVERS]" #define save_config_command(parameters) yon_char_unite("ubconfig --target system set [autoinstall] AUTOINSTALL[log]=yes ",parameters, "; nice ubinstall2 --debug autoinstall", NULL) @@ -434,13 +443,13 @@ typedef struct { GtkWidget *NetworkDomainSwitch; GtkWidget *NetworkDomainNameEntry; GtkWidget *NetworkDomainAdminEntry; - GtkWidget *DomainPasswordEntry; + GtkWidget *NetworkDomainPasswordEntry; GtkWidget *NetworkNTPServerSwitch; GtkWidget *NetworkNTPCombo; GtkWidget *NetworkNTPEntry; GtkWidget *NetworkConnectionsBox; GtkWidget *NetworkConnectionsAddButton; - dictionary *network_connections; + GHashTable *network_connections; GtkWidget *AdvancedDeviceTree; GtkWidget *AdvancedVirtualDeviceCombo; @@ -545,6 +554,7 @@ typedef struct { GtkWidget *MainBox; GtkWidget *TypeCombo; GtkWidget *ConnectionCombo; + GtkWidget *ConnectionEntry; GtkWidget *EnabledSwitch; GtkWidget *RemoveButton; GtkWidget *AutoGetIPSwitch; @@ -652,4 +662,10 @@ int yon_users_save(main_window *widgets); int yon_bootloader_save(main_window *widgets); int yon_startup_save(main_window *widgets); network_info *yon_network_info_new(); -int yon_install_advanced_save(main_window *widgets); \ No newline at end of file +int yon_install_advanced_save(main_window *widgets); +int yon_network_save(main_window *widgets); +void on_connection_add(main_window *widgets); +void on_ntp_sync(GtkWidget *, main_window *widgets); +int yon_advanced_sections_save(dictionary *dict); +void yon_configuration_mode_check(main_window *widgets); +void on_configuration_mode_switch(GtkWidget *self,main_window *widgets); \ No newline at end of file diff --git a/ubinstall-gtk-network-box.glade b/ubinstall-gtk-network-box.glade index 0f37eda..0dfad0c 100644 --- a/ubinstall-gtk-network-box.glade +++ b/ubinstall-gtk-network-box.glade @@ -43,6 +43,13 @@ True False + + Wired + Wireless + Tunnel + Bridge + Modem + False @@ -54,6 +61,17 @@ True False + 0 + True + + Deafault + + + + True + Deafault + + False diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index ac0bfe8..821b93c 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -3501,7 +3501,7 @@ and help you install UBLinux on your computer - + True True 10 @@ -3551,6 +3551,14 @@ and help you install UBLinux on your computer True False + + Default + DHCP + NTP (ntp.org) + NTP (vniiftri.ru) + Manual + Do not configure + False @@ -3577,13 +3585,26 @@ and help you install UBLinux on your computer - + True False vertical 5 - + + True + False + vertical + 5 + + + + + + False + True + 0 +