diff --git a/gresource.xml b/gresource.xml index 0ed7fcf..319ad25 100644 --- a/gresource.xml +++ b/gresource.xml @@ -17,6 +17,7 @@ ubinstall-gtk-bootloader-user.glade ubinstall-gtk-network-box.glade ubinstall-gtk-advanced-box.glade + ubinstall-gtk-configuration-mode.glade ubinstall-gtk.css diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 990ee99..4256ed5 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -74,6 +74,7 @@ set(DEPENDFILES ../ubinstall-gtk-bootloader-user.glade ../ubinstall-gtk-network-box.glade ../ubinstall-gtk-advanced-box.glade + ../ubinstall-gtk-configuration-mode.glade ../gresource.xml ../ubinstall-gtk.css ../modules.csv diff --git a/source/ubinstall-gtk-configuration-mode.c b/source/ubinstall-gtk-configuration-mode.c index d0b0e8f..2d4f99f 100644 --- a/source/ubinstall-gtk-configuration-mode.c +++ b/source/ubinstall-gtk-configuration-mode.c @@ -1,25 +1,79 @@ #include "ubinstall-gtk.h" +void configuration_mode_accept(GtkWidget *,configuration_window *window){ + const char *path = gtk_entry_get_text(GTK_ENTRY(window->PathEntry)); + if (yon_char_is_empty(path)){ + yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),_EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(window->PathEntry); + return; + } + if (!yon_char_is_empty(main_config.config_save_path)) free(main_config.config_save_path); + main_config.config_save_path = yon_char_new(path); + gtk_widget_destroy(window->Window); +} + +void on_path_choose(GtkWidget *,configuration_window *window){ + filechooser_window *dialog = yon_file_chooser_window_new(GTK_FILE_CHOOSER_ACTION_SAVE); + yon_gtk_window_setup(GTK_WINDOW(dialog->Window),GTK_WINDOW(window->Window),CONFIGURATION_MODE_TITLE_LABEL,icon_path,"filechooser_window"); + GtkFileFilter *filter = gtk_file_filter_new(); + gtk_file_filter_add_pattern(filter,"*.ini"); + gtk_file_filter_set_name(filter,"*.ini"); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog->MainFileChooser),filter); + if (yon_file_chooser_start(dialog)==GTK_RESPONSE_APPLY){ + gtk_entry_set_text(GTK_ENTRY(window->PathEntry),dialog->last_success_selection); + free(dialog); + } +} + +void on_configuration_exit(GtkWidget *,configuration_window *window){ + main_window *widgets = g_object_get_data(G_OBJECT(window->Window),"widgets"); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widgets->ConfigurationModeMenuItem),0); + gtk_widget_destroy(window->Window); +} + 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); - } - } + if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(self))){ + 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"); + window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox"); + window->PathEntry = yon_gtk_builder_get_widget(builder,"PathEntry"); + window->PathButton = yon_gtk_builder_get_widget(builder,"PathButton"); + window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton"); + window->ChooseButton = yon_gtk_builder_get_widget(builder,"ChooseButton"); + + g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_configuration_exit),window); + g_signal_connect(G_OBJECT(window->Window),"destroy",G_CALLBACK(gtk_main_quit),NULL); + g_signal_connect(G_OBJECT(window->ChooseButton),"clicked",G_CALLBACK(configuration_mode_accept),window); + g_signal_connect(G_OBJECT(window->PathButton),"clicked",G_CALLBACK(on_path_choose),window); + g_object_set_data(G_OBJECT(window->Window),"widgets",widgets); + yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->MainWindow),CONFIGURATION_MODE_TITLE_LABEL,icon_path,"configuration_window"); + + if (!yon_char_is_empty(main_config.config_save_path)) gtk_entry_set_text(GTK_ENTRY(window->PathEntry),main_config.config_save_path); + gtk_widget_show(window->Window); + gtk_main(); + + yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(widgets->StatusBox),"config_mode",CONFIGURATION_MODE_STATUS_LABEL,BACKGROUND_IMAGE_INFO_TYPE); + yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(widgets->StatusBox2),"config_mede",CONFIG_PATH_LABEL(main_config.config_save_path),BACKGROUND_IMAGE_INFO_TYPE); + GList *revealerlist = gtk_container_get_children(GTK_CONTAINER(widgets->StatusBox2)); + GList *list = gtk_container_get_children(GTK_CONTAINER(g_list_nth_data(revealerlist,0))); + GtkWidget *box = GTK_WIDGET(list->data); + + g_list_free(revealerlist); + g_list_free(list); + + gtk_style_context_remove_class(gtk_widget_get_style_context(box),"boxInfoMessOK"); + gtk_style_context_add_class(gtk_widget_get_style_context(box),"boxInfoMessGray"); + main_config.configure_mode = 1; + gtk_widget_destroy(window->Window); + return; + + } else { + yon_ubl_status_box_despawn_infinite(GTK_CONTAINER(widgets->StatusBox)); + GList *revealerlist = gtk_container_get_children(GTK_CONTAINER(widgets->StatusBox2)); + gtk_widget_destroy(GTK_WIDGET(g_list_nth_data(revealerlist,0))); + g_list_free(revealerlist); + main_config.configure_mode = 0; + } - main_config.configure_mode = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(self)); } diff --git a/source/ubinstall-gtk-install-start.c b/source/ubinstall-gtk-install-start.c index d6648ca..5a66d07 100644 --- a/source/ubinstall-gtk-install-start.c +++ b/source/ubinstall-gtk-install-start.c @@ -4,8 +4,9 @@ int yon_installation_start(main_window *widgets){ return !pthread_create(&main_config.install_thread,NULL,on_config_save,widgets); } -void yon_quick_install(GtkWidget *, main_window *widgets){ +void yon_quick_install(GtkWidget *self, main_window *widgets){ main_config.save_configured=1; + gtk_widget_hide(self); pthread_create(&main_config.install_thread,NULL,on_config_save,widgets); gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION); } \ No newline at end of file diff --git a/source/ubinstall-gtk-page-switch.c b/source/ubinstall-gtk-page-switch.c index 81cf723..6bc9107 100644 --- a/source/ubinstall-gtk-page-switch.c +++ b/source/ubinstall-gtk-page-switch.c @@ -20,10 +20,10 @@ enum YON_PAGES yon_page_get_next(main_window *widgets, enum YON_PAGES page){ case YON_PAGE_STARTUP: return YON_PAGE_BOOTLOADER; break; case YON_PAGE_BOOTLOADER: return YON_PAGE_NETWORK; break; case YON_PAGE_NETWORK: return main_config.configure_mode? YON_PAGE_CONFIGURE_END : YON_PAGE_INSTALLATION; break; - case YON_PAGE_INSTALL_COMMON: return main_config.configure_mode?YON_PAGE_KERNEL:YON_PAGE_OS_COMPONENTS; break; - case YON_PAGE_INSTALL_SEPARATE: return main_config.configure_mode?YON_PAGE_KERNEL:YON_PAGE_OS_COMPONENTS; break; - case YON_PAGE_INSTALL_SAME_PARTITION: return main_config.configure_mode?YON_PAGE_KERNEL:YON_PAGE_OS_COMPONENTS; break; - case YON_PAGE_INSTALL_ADVANCED: return main_config.configure_mode?YON_PAGE_KERNEL:YON_PAGE_OS_COMPONENTS; break; + case YON_PAGE_INSTALL_COMMON: return YON_PAGE_OS_COMPONENTS; break; + case YON_PAGE_INSTALL_SEPARATE: return YON_PAGE_OS_COMPONENTS; break; + case YON_PAGE_INSTALL_SAME_PARTITION: return YON_PAGE_OS_COMPONENTS; break; + case YON_PAGE_INSTALL_ADVANCED: return YON_PAGE_OS_COMPONENTS; break; case YON_PAGE_INSTALL_RECOVERY: return yon_recovery_get_next(widgets); break; case YON_PAGE_RECOVERY_GRUB_INSTALL: return main_config.configure_mode?YON_PAGE_INSTALLATION:YON_PAGE_INSTALLATION_BEGIN; break; case YON_PAGE_RECOVERY_GRUB_UPDATE: return main_config.configure_mode?YON_PAGE_INSTALLATION:YON_PAGE_INSTALLATION_BEGIN; break; @@ -77,8 +77,19 @@ void yon_navigation_buttons_set_sensetiveness(main_window *widgets){ switch(page){ case YON_PAGE_WELCOME: + yon_load_proceed(YON_CONFIG_LOCAL); gtk_widget_hide(widgets->BackButton); gtk_widget_set_sensitive(widgets->NextButton,1); + gtk_widget_set_sensitive(widgets->CancelInstallButton,0); + gtk_widget_hide(widgets->BackButton); + gtk_widget_hide(widgets->SourceButton); + gtk_widget_hide(widgets->SkipInstallationButton); + gtk_widget_show(widgets->NextButton); + if (!yon_char_is_empty(config(AUTOINSTALL_TYPE_INSTALL))){ + gtk_widget_show(widgets->StartScenarioButton); + } else { + gtk_widget_hide(widgets->StartScenarioButton); + } break; case YON_PAGE_LICENCE: gtk_widget_show(widgets->BackButton); @@ -93,10 +104,14 @@ void yon_navigation_buttons_set_sensetiveness(main_window *widgets){ case YON_PAGE_KERNEL: gtk_widget_set_sensitive(widgets->BackButton,0); break; + case YON_PAGE_CONFIGURE_END: + gtk_button_set_label(GTK_BUTTON(widgets->NextButton),SAVE_AND_EXIT_LABEL); + gtk_button_set_label(GTK_BUTTON(widgets->CancelInstallButton),EXIT_LABEL); + + break; case YON_PAGE_COMPLETED: case YON_PAGE_INSTALL_ERROR: case YON_PAGE_CONFIGURE_SAVE: - case YON_PAGE_CONFIGURE_END: case YON_PAGE_COMPLETION: gtk_button_set_label(GTK_BUTTON(widgets->NextButton),RESTART_LABEL); gtk_widget_set_sensitive(widgets->BackButton,0); @@ -171,6 +186,8 @@ int yon_page_save(main_window *widgets, enum YON_PAGES page){ case YON_PAGE_INSTALLATION_BEGIN: return yon_installation_start(widgets); break; + case YON_PAGE_CONFIGURE_END: + return yon_config_save(widgets); default:return 1; } return 1; @@ -336,6 +353,9 @@ void yon_page_init(main_window *widgets, enum YON_PAGES page){ case YON_PAGE_INSTALLATION_BEGIN: yon_install_init(widgets,page); break; + case YON_PAGE_COMPLETION: + yon_config_restore(widgets); + break; case YON_PAGE_INSTALLATION: main_config.save_configured=1; g_mutex_lock(&main_config.install_mutex); @@ -380,5 +400,7 @@ void on_page_cancel_clicked(GtkWidget *, main_window *widgets){ gtk_widget_set_sensitive(widgets->CancelInstallButton,0); gtk_widget_set_sensitive(widgets->BackButton,1); gtk_widget_set_sensitive(widgets->NextButton,1); - + gtk_widget_set_sensitive(widgets->ConfigurationModeMenuItem,1); + yon_page_update(widgets); + } \ No newline at end of file diff --git a/source/ubinstall-gtk-saving.c b/source/ubinstall-gtk-saving.c index 60dd33b..9c02163 100644 --- a/source/ubinstall-gtk-saving.c +++ b/source/ubinstall-gtk-saving.c @@ -21,13 +21,12 @@ void yon_config_save_proceed(char *path, YON_CONFIG_TYPE type){ void yon_load_proceed(YON_CONFIG_TYPE type){ if (type!=YON_CONFIG_CUSTOM){ yon_config_clean(); - if (!yon_char_is_empty(config_get_default_command)) - yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL); + yon_config_load_config(YON_CONFIG_DEFAULT,yon_config_get_command(main_config.config_load_path),NULL); } if (type==YON_CONFIG_GLOBAL){ - yon_config_load_config(type,yon_config_get_command("global"),NULL); + yon_config_load_config(type,yon_config_get_command(main_config.config_load_path),NULL); } else if (type==YON_CONFIG_LOCAL){ - yon_config_load_config(type,yon_config_get_command("system"),NULL); + yon_config_load_config(type,yon_config_get_command(main_config.config_load_path),NULL); } else if (type==YON_CONFIG_CUSTOM){ textdomain(template_ui_LocaleName); GtkWidget *dialog = gtk_file_chooser_dialog_new(template_app_information.app_title,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,CANCEL_LABEL,GTK_RESPONSE_CANCEL,OPEN_LABEL,GTK_RESPONSE_ACCEPT,NULL); @@ -59,12 +58,16 @@ void yon_load_proceed(YON_CONFIG_TYPE type){ void on_config_local_load(GtkWidget *,main_window *widgets){ + if (!yon_char_is_empty(main_config.config_load_path)) free(main_config.config_load_path); + main_config.config_load_path = yon_char_new("system"); yon_load_proceed(YON_CONFIG_LOCAL); yon_page_init(widgets,gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->Notebook))); main_config.load_mode=YON_CONFIG_LOCAL; } void on_config_global_load(GtkWidget *,main_window *widgets){ + if (!yon_char_is_empty(main_config.config_load_path)) free(main_config.config_load_path); + main_config.config_load_path = yon_char_new("global"); yon_load_proceed(YON_CONFIG_GLOBAL); yon_page_init(widgets,gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->Notebook))); main_config.load_mode=YON_CONFIG_GLOBAL; @@ -462,6 +465,7 @@ void on_config_global_save(GtkWidget *,main_window *widgets){ gboolean on_install_success(main_window *widgets){ gtk_label_set_text(GTK_LABEL(widgets->InstallationLabel),""); gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_COMPLETION); + yon_config_restore(widgets); yon_page_update(widgets); return 0; @@ -491,23 +495,26 @@ enum INSTALL_TYPE{ * */ enum INSTALL_TYPE yon_ubl_get_install_mode(){ + char *value = config(AUTOINSTALL_TYPE_INSTALL); - if (!strcmp(value,"fast")){ - return INSTALL_COMMON; - } else if (!strcmp(value,"part")){ - return INSTALL_PART; - } else if (!strcmp(value,"next")){ - return INSTALL_NEXT; - } else if (!strcmp(value,"advanced")){ - return INSTALL_ADVANCED; - } else if (!strcmp(value,"grub_install")){ - return INSTALL_GRUB_INSTALL; - } else if (!strcmp(value,"grub_update")){ - return INSTALL_GRUB_UPDATE; - } else if (!strcmp(value,"system_only")){ - return INSTALL_SYSTEM_ONLY; - } else if (!strcmp(value,"data_only")){ - return INSTALL_USER_ONLY; + if (!yon_char_is_empty(value)){ + if (!strcmp(value,"fast")){ + return INSTALL_COMMON; + } else if (!strcmp(value,"part")){ + return INSTALL_PART; + } else if (!strcmp(value,"next")){ + return INSTALL_NEXT; + } else if (!strcmp(value,"advanced")){ + return INSTALL_ADVANCED; + } else if (!strcmp(value,"grub_install")){ + return INSTALL_GRUB_INSTALL; + } else if (!strcmp(value,"grub_update")){ + return INSTALL_GRUB_UPDATE; + } else if (!strcmp(value,"system_only")){ + return INSTALL_SYSTEM_ONLY; + } else if (!strcmp(value,"data_only")){ + return INSTALL_USER_ONLY; + } } return INSTALL_ERROR; } @@ -667,3 +674,131 @@ void *on_setup_system_configuration(void * data){ g_idle_add((GSourceFunc)on_install_success,widgets); return NULL; } + +int yon_config_save(main_window *widgets){ + { + int size=0; + config_str parameters = NULL; + enum INSTALL_TYPE install_mode = yon_ubl_get_install_mode(); + switch(install_mode){ + case INSTALL_COMMON: + parameters = yon_config_get_selection_by_key_no_ignored(&size,install_common_parameters,modules_parameter,NULL); + break; + case INSTALL_PART: + parameters = yon_config_get_selection_by_key_no_ignored(&size,install_part_parameters,modules_parameter,NULL); + break; + case INSTALL_NEXT: + parameters = yon_config_get_selection_by_key_no_ignored(&size,install_next_parameters,modules_parameter,NULL); + break; + case INSTALL_ADVANCED: + parameters = yon_config_get_selection_by_key_no_ignored(&size,install_advanced_parameters,modules_parameter,NULL); + break; + case INSTALL_GRUB_INSTALL: + case INSTALL_GRUB_UPDATE: + parameters = yon_config_get_selection_by_key_no_ignored(&size,install_grub_install_update_parameters,NULL); + break; + case INSTALL_SYSTEM_ONLY: + parameters = yon_config_get_selection_by_key_no_ignored(&size,install_system_only_parameters,NULL); + break; + case INSTALL_USER_ONLY: + parameters = yon_config_get_selection_by_key_no_ignored(&size,install_userdata_only_parameters,NULL); + break; + default: + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),ERROR_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + return 0; + } + char *command = yon_debug_output("%s\n",ubconfig_set_command_full(main_config.config_save_path,"",yon_char_parsed_to_string(parameters,size," "))); + if (system(command)){ + return 0; + } + } + int size; + config_str all_parameters = yon_config_get_selection_by_key(&size, + root_password_parameter, + autologin_parameter, + xkbmodel_parameter, + xkblayout_parameter, + xkbvariant_parameter, + xkboptions_parameter, + hostname_parameter, + zone_parameter, + lang_parameter, + locale_parameter, + SERVICES_ENABLE_parameter, + GRUB_DEFAULT_parameter, + GRUB_TIMEOUT_parameter, + AUTOLOGINUSER_parameter, + GRUB_SUPERUSERS_parameter, + DOMAIN_parameter, + DOMAIN_admanger_parameter, + NTPSERVERS_parameter, + modules_extra_parameter, + KERNEL_BOOT_parameter, + packages_parameter, + NULL); + int user_size=0; + config_str users = yon_config_get_all_by_key(USERADD_parameter_search,&user_size); + if (user_size){ + int final_size; + config_str final = yon_char_parsed_merge(all_parameters,size,users,user_size,&final_size); + yon_char_parsed_free(users,user_size); + if (size) yon_char_parsed_free(all_parameters,size); + all_parameters = final; + size = final_size; + } + users = yon_config_get_all_by_key(GRUB_PASSWORD_parameter_search,&user_size); + if (users){ + int final_size; + config_str final = yon_char_parsed_merge(all_parameters,size,users,user_size,&final_size); + yon_char_parsed_free(users,user_size); + if (size) yon_char_parsed_free(all_parameters,size); + all_parameters = final; + size = final_size; + } + int network_size; + config_str networks = yon_config_get_all_by_key(NETWORK_parameter_search,&network_size); + if (network_size){ + int final_size; + config_str final = yon_char_parsed_merge(all_parameters,size,networks,network_size,&final_size); + yon_char_parsed_free(networks,network_size); + if (size) yon_char_parsed_free(all_parameters,size); + all_parameters = final; + size = final_size; + } + + if (all_parameters){ + for (int i=0;iMainWindow=yon_gtk_builder_get_widget(builder,"MainWindow"); widgets->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox"); + widgets->StatusBox2 = yon_gtk_builder_get_widget(builder,"StatusBox2"); widgets->Notebook = yon_gtk_builder_get_widget(builder,"Notebook"); widgets->MainSpinner=yon_gtk_builder_get_widget(builder,"MainSpinner"); @@ -686,8 +687,14 @@ main_window *yon_main_window_complete(){ g_object_unref(pix); } gtk_builder_connect_signals(builder,NULL); - yon_load_proceed(YON_CONFIG_LOCAL); + // yon_load_proceed(YON_CONFIG_LOCAL); + on_config_global_load(NULL,widgets); // yon_interface_update(widgets); + if (!yon_char_is_empty(config(AUTOINSTALL_TYPE_INSTALL))){ + gtk_widget_show(widgets->StartScenarioButton); + } else { + gtk_widget_hide(widgets->StartScenarioButton); + } return widgets; } diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index b192da8..cb3b6f0 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -34,6 +34,7 @@ #define glade_path_service "/com/ublinux/ui/ubinstall-gtk-service-window.glade" #define glade_path_bootloader_user "/com/ublinux/ui/ubinstall-gtk-bootloader-user.glade" #define glade_path_advanced_part "/com/ublinux/ui/ubinstall-gtk-advanced-box.glade" +#define glade_path_configuration_mode "/com/ublinux/ui/ubinstall-gtk-configuration-mode.glade" #define CssPath "/com/ublinux/css/ubinstall-gtk.css" #define config_path yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL) @@ -421,6 +422,7 @@ typedef struct { GtkWidget *MainSpinner; GtkWidget *StatusBox; + GtkWidget *StatusBox2; GtkWidget *WelcomeToggle; GtkWidget *LicenceToggle; GtkWidget *LocationToggle; @@ -869,6 +871,15 @@ typedef struct { char *prev_name; } bootloader_user_window; +typedef struct { + GtkWidget *Window; + GtkWidget *StatusBox; + GtkWidget *PathEntry; + GtkWidget *PathButton; + GtkWidget *CancelButton; + GtkWidget *ChooseButton; +} configuration_window; + void config_init(); main_window *yon_main_window_complete(); ubinstall_language_window *yon_ubinstall_language_new(); @@ -937,7 +948,7 @@ void on_config_global_local_save(GtkWidget *,main_window *widgets); void on_config_custom_load(GtkWidget *,main_window *); void on_config_global_load(GtkWidget *,main_window *); void on_config_local_load(GtkWidget *,main_window *widgets); -// void yon_save_proceed(char *path, YON_CONFIG_TYPE type); +void yon_config_save_proceed(char *path, YON_CONFIG_TYPE type); void on_page_next_clicked(GtkWidget *, main_window *widgets); void on_page_prev_clicked(GtkWidget *, main_window *widgets); void yon_load_proceed(YON_CONFIG_TYPE type); @@ -1052,4 +1063,9 @@ void yon_layout_build(char *key, GHashTable *value, main_window *widgets); void yon_os_row_setup(os_row *row, char *name, char *version,char *tags, char *description); os_row *yon_os_row_new(); void yon_quick_install(GtkWidget *, main_window *widgets); -void on_keyboard_layout_chosen(GtkCellRenderer *self, gchar *path, main_window *widgets); \ No newline at end of file +void on_keyboard_layout_chosen(GtkCellRenderer *self, gchar *path, main_window *widgets); +void configuration_mode_accept(GtkWidget *,configuration_window *window); +void on_path_choose(GtkWidget *,configuration_window *window); +void on_configuration_exit(GtkWidget *,configuration_window *window); +int yon_config_save(main_window *widgets); +void yon_config_restore(main_window *widgets); \ No newline at end of file diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 65e5c25..c8ba6c3 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -137,6 +137,8 @@ #define INSTALLATION_OPTIONS_LABEL _("Installation options") #define CONFIGURATION_MODE_LABEL _("Configuration mode") +#define CONFIGURATION_MODE_STATUS_LABEL _("Attention! Configuration mode was enabled!") +#define CONFIG_PATH_LABEL(path) yon_char_unite(_("Configuration will be saved in configuration file")," ",path,NULL) #define ERROR_HEAD_LABEL _("Error") #define ERROR_LABEL _("Error has occured while installation process") @@ -206,4 +208,7 @@ #define WRONG_IP_LABEL _("Ip adress is incorrect") -#define ENABLED_KERNEL_MISSING_LABEL _("No kernel was enabled") \ No newline at end of file +#define ENABLED_KERNEL_MISSING_LABEL _("No kernel was enabled") + +#define CONFIGURATION_MODE_TITLE_LABEL _("Choose installation configuration file") +#define SAVE_AND_EXIT_LABEL _("Save and exit") \ No newline at end of file diff --git a/ubinstall-gtk-configuration-mode.glade b/ubinstall-gtk-configuration-mode.glade new file mode 100644 index 0000000..f4e73df --- /dev/null +++ b/ubinstall-gtk-configuration-mode.glade @@ -0,0 +1,184 @@ + + + + + + + True + False + com.ublinux.libublsettingsui-gtk3.zoom-symbolic + + + 400 + 250 + False + True + + + True + False + vertical + + + True + False + vertical + + + + + + False + True + 1 + + + + + True + False + 5 + 5 + 15 + 15 + 15 + + + True + False + start + com.ublinux.ubinstall-gtk + 6 + + + False + True + 0 + + + + + True + False + vertical + 5 + + + True + False + Choose a path for configuration file + 0 + + + False + True + 0 + + + + + True + False + 5 + + + True + False + File position: + 0 + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + + + + True + True + True + image1 + + + + False + True + 2 + + + + + False + True + 1 + + + + + True + True + 1 + + + + + False + True + 2 + + + + + + + True + False + + + True + False + 2 + UBLinux installation + + + + + + + + Cancel + True + True + True + + + + + Choose + True + True + True + + + end + 1 + + + + + + diff --git a/ubinstall-gtk-source.glade b/ubinstall-gtk-source.glade new file mode 100644 index 0000000..4d82003 --- /dev/null +++ b/ubinstall-gtk-source.glade @@ -0,0 +1,244 @@ + + + + + + 400 + 250 + False + True + + + True + False + vertical + + + True + False + vertical + + + + + + False + True + 1 + + + + + True + False + 5 + 5 + 5 + 5 + 15 + 15 + 15 + + + True + False + start + com.ublinux.ubinstall-gtk + 6 + + + False + True + 0 + + + + + True + False + vertical + 5 + + + True + False + Choose a path for configuration file + 0 + + + False + True + 0 + + + + + True + False + 5 + + + True + True + + + False + True + 0 + + + + + True + False + Automatically + + + False + True + 1 + + + + + False + True + 1 + + + + + True + False + 5 + + + True + False + + Device + Folder + ISO-image + + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + + + + True + True + True + image1 + + + + False + True + 2 + + + + + True + True + True + image2 + + + + False + True + 3 + + + + + False + True + 2 + + + + + True + True + 1 + + + + + False + True + 2 + + + + + + + True + False + + + True + False + 2 + UBLinux installation + + + + + + + + Cancel + True + True + True + + + + + Choose + True + True + True + + + end + 1 + + + + + + + True + False + com.ublinux.libublsettingsui-gtk3.zoom-symbolic + + + True + False + com.ublinux.libublsettingsui-gtk3.increase-symbolic + + diff --git a/ubinstall-gtk.css b/ubinstall-gtk.css index 3950870..9823f36 100644 --- a/ubinstall-gtk.css +++ b/ubinstall-gtk.css @@ -118,6 +118,10 @@ background:transparent; .boxInfoMessOK{ background-color: #f3f0ac; } + +.boxInfoMessGray{ + background-color: darker(@theme_bg_color); +} .errorBox { border-width: 2px; border-color: #ea9999; diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 392fe86..3d9feb4 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -1,5 +1,5 @@ - + @@ -448,6 +448,21 @@ 0 + + + True + False + vertical + + + + + + False + True + 1 + + True @@ -10575,7 +10590,7 @@ separately into the selected partition. True True - 1 + 2