diff --git a/icons/actions/com.ublinux.ubinstall-gtk.sync-symbolic.svg b/icons/actions/com.ublinux.ubinstall-gtk.sync-symbolic.svg
new file mode 100644
index 0000000..e81e0f7
--- /dev/null
+++ b/icons/actions/com.ublinux.ubinstall-gtk.sync-symbolic.svg
@@ -0,0 +1,8 @@
+
+
diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c
index 5a2b5a7..293c348 100644
--- a/source/ubinstall-gtk.c
+++ b/source/ubinstall-gtk.c
@@ -3,12 +3,436 @@
config main_config;
//functions
+
+void _yon_saving_threaded(char *final_command);
+void _yon_saving_threaded(char *final_command){
+ FILE *file = popen(final_command,"r");
+ int file_save;
+ config_str file_return = yon_config_load_file(file,&file_save);
+ pclose(file);
+ file_return = yon_char_parsed_append(file_return,&file_save,final_command);
+ char *result = yon_char_parsed_to_string(file_return,file_save,"");
+ yon_debug_output("%s\n",result);
+ free(result);
+}
+
+char *yon_save_command_prepare(char *command, char *target){
+ int size;
+ config_str parsed = yon_char_parse(command,&size," ");
+ free(parsed[2]);
+ parsed[2]=yon_char_new(target);
+ free(parsed[3]);
+ parsed[3]=yon_char_new("set");
+ for (int i=5;iInstallationRadio),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)){
+ char *chosen_langs = "";
+ for_iter(widgets->LanguagesList,&iter){
+ char *cur=NULL, *render = NULL;
+ gtk_tree_model_get(GTK_TREE_MODEL(widgets->LanguagesList),&iter,1,&render,2,&cur,-1);
+ if (strstr(system_locale,cur)){
+ gtk_list_store_set((widgets->LanguagesList),&iter,0,1,-1);
+ chosen_langs = yon_char_unite(chosen_langs,!yon_char_is_empty(chosen_langs)?";":"",render,NULL);
+ } else {
+ gtk_list_store_set((widgets->LanguagesList),&iter,0,0,-1);
+ }
+ }
+ if (!yon_char_is_empty(chosen_langs)){
+ gtk_entry_set_text(GTK_ENTRY(widgets->AvailableLanguagesEntry),chosen_langs);
+ free(chosen_langs);
+ }
+ // 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)){
+ int feasf = gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->LanguageCombo),language);
+ if (feasf){
+ printf("fsa\n");
+ };
+ } 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)){
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->ManualLayoutRadio),1);
+ for_iter(widgets->LayoutList,&iter){
+ char *cur=NULL;
+ gtk_tree_model_get(GTK_TREE_MODEL(widgets->LayoutList),&iter,0,&cur,-1);
+ if (strstr(layout,cur)){
+ gtk_tree_store_set(widgets->LayoutList,&iter,3,1,-1);
+ } else {
+ gtk_tree_store_set(widgets->LayoutList,&iter,3,0,-1);
+ }
+ }
+ } else {
+ for_iter(widgets->LayoutList,&iter){
+ gtk_tree_store_set((widgets->LayoutList),&iter,3,0,-1);
+ }
+ }
+
+ 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 *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 *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 *widgets){
+ yon_load_proceed(YON_CONFIG_CUSTOM);
+ yon_interface_update(widgets);
+ main_config.load_mode=3;
+}
+
+void on_config_global_local_save(GtkWidget *,main_window *widgets);
+void on_config_global_local_save(GtkWidget *,main_window *widgets){
+ yon_save_proceed(NULL,YON_CONFIG_BOTH);
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_COMPLETED);
+}
+
+void on_config_local_save(GtkWidget *,main_window *widgets);
+void on_config_local_save(GtkWidget *,main_window *widgets){
+ yon_save_proceed("system",YON_CONFIG_LOCAL);
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_COMPLETED);
+
+}
+
+void on_config_global_save(GtkWidget *,main_window *widgets);
+void on_config_global_save(GtkWidget *,main_window *widgets){
+ yon_save_proceed("global",YON_CONFIG_GLOBAL);
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_COMPLETED);
+
+}
+
+void on_config_custom_save(GtkWidget *, main_window *widgets);
+void on_config_custom_save(GtkWidget *, main_window *widgets){
+ char *path = NULL;
+ // YON_CONFIG_TYPE type = YON_CONFIG_CUSTOM;
+ GtkWidget *dialog = gtk_file_chooser_dialog_new(TITLE_LABEL,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,CANCEL_LABEL,GTK_RESPONSE_CANCEL,SAVE_LABEL,GTK_RESPONSE_ACCEPT,NULL);
+ textdomain(TITLE_LABEL);
+ GtkFileFilter *filter = gtk_file_filter_new();
+ gtk_window_set_icon_name(GTK_WINDOW(dialog),yon_char_append("com.ublinux.",LocaleName));
+ gtk_file_filter_add_pattern(filter,"*.ini");
+ gtk_file_filter_set_name(filter, "*.ini");
+ gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog),filter);
+ int response = gtk_dialog_run(GTK_DIALOG(dialog));
+ if (response == GTK_RESPONSE_ACCEPT){
+ char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
+ // char *directory = gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(dialog));
+ if (!yon_char_is_empty(file)){
+ if (!strstr(file,".ini")) file = yon_char_append(file,".ini");
+ if (access(file,0)!=F_OK){
+ char *command_creation = ubconfig_file_create(file);
+ int a = system(command_creation);
+ if (access(file,0)!=F_OK||a){
+ yon_ubl_status_box_render(CUSTOM_CONFIG_CREATION_ERROR_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
+ return;
+ }
+ }
+ }
+ path = yon_char_unite("'",file,"'",NULL);
+ free(file);
+ gtk_widget_destroy(dialog);
+ } else {
+ gtk_widget_destroy(dialog);
+ return;
+ }
+ yon_save_proceed(path,YON_CONFIG_CUSTOM);
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_COMPLETED);
+}
void yon_open_browser(GtkWidget *, char *link);
void yon_open_browser(GtkWidget *, char *link){
@@ -228,6 +652,8 @@ void config_init(){
main_config.install_complete=0;
main_config.save_done=0;
main_config.configure_mode=0;
+ main_config.load_mode=-1;
+ main_config.log_progress_buzy=0;
}
void on_configuration_mode_switch(GtkWidget *self);
@@ -308,7 +734,6 @@ gboolean on_image_slide(void *data){
return 1;
}
-char* yon_debug_output(char *pattern,char*text);
char* yon_debug_output(char *pattern,char*text){
if (main_config.debug_mode){
printf(pattern,text);
@@ -346,52 +771,39 @@ void *on_config_save(void *data){
gboolean yon_installation_progress_update(void *data);
gboolean yon_installation_progress_update(void *data){
main_window *widgets = (main_window*)data;
- FILE *file = NULL;
- char *current = g_malloc0(4096);
- clock_t last_time = 0;
- clock_t current_time;
- while (1){
- while (gtk_events_pending()) gtk_main_iteration();
- current_time = clock();
- if ((double)(current_time - last_time) / CLOCKS_PER_SEC >= 0.5){
- if (!file)
- file = fopen(progress_path,"r");
- if (file){
- if (fgets(current,4096,file)){
-
- } else {
- if (!yon_char_is_empty(current)&¤t[0]=='('){
- char * current_copy = yon_char_new(current);
- char *percentage = yon_char_divide_search(current_copy,")",-1);
- free(yon_char_divide(current_copy,0));
- free(yon_char_divide(percentage,0));
- if (strcmp(percentage,"#pb")){
- double fraction = atof(percentage);
- gtk_label_set_text(GTK_LABEL(widgets->InstallationLabel),current_copy);
- gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->InstallationProgress),fraction/100);
- gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->PackageInstallationProgress),0);
- gtk_label_set_text(GTK_LABEL(widgets->PackageInstallationLabel),"");
- } else {
- gtk_widget_show(gtk_widget_get_parent(widgets->PackageInstallationProgress));
-
- int size;
- config_str parsed = yon_char_parse(current_copy,&size," ");
- double fraction = atof(parsed[2])/100;
- gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->PackageInstallationProgress),fraction);
- gtk_label_set_text(GTK_LABEL(widgets->PackageInstallationLabel),yon_char_parsed_to_string(parsed,size," "));
- yon_char_parsed_free(parsed,size);
- }
- last_time = current_time;
- free(current_copy);
- free(percentage);
- }
- break;
- }
- }
+ while (gtk_events_pending()) gtk_main_iteration();
+ int size;
+ while (main_config.log_progress_buzy){
+ while (gtk_events_pending()) gtk_main_iteration();};
+ main_config.log_progress_buzy=1;
+ config_str text = yon_file_open(progress_path,&size);
+ main_config.log_progress_buzy=0;
+ if (size){
+ if (!yon_char_is_empty(text[size-1])&&text[size-1][0]=='('){
+ char * current_copy = yon_char_new(text[size-1]);
+ char *percentage = yon_char_divide_search(current_copy,")",-1);
+ free(yon_char_divide(current_copy,0));
+ free(yon_char_divide(percentage,0));
+ if (strcmp(percentage,"#pb")){
+ double fraction = atof(percentage);
+ gtk_label_set_text(GTK_LABEL(widgets->InstallationLabel),current_copy);
+ gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->InstallationProgress),fraction/100);
+ gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->PackageInstallationProgress),0);
+ gtk_label_set_text(GTK_LABEL(widgets->PackageInstallationLabel),"");
+ } else {
+ gtk_widget_show(gtk_widget_get_parent(widgets->PackageInstallationProgress));
+
+ int size;
+ config_str parsed = yon_char_parse(current_copy,&size," ");
+ double fraction = atof(parsed[2])/100;
+ gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->PackageInstallationProgress),fraction);
+ gtk_label_set_text(GTK_LABEL(widgets->PackageInstallationLabel),yon_char_parsed_to_string(parsed,size," "));
+ yon_char_parsed_free(parsed,size);
}
+ free(current_copy);
+ free(percentage);
}
- fclose(file);
- file=NULL;
+ }
if (main_config.install_thread){
return 1;
@@ -405,6 +817,7 @@ void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets);
void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets){
switch(page){
case YON_PAGE_WELCOME: {
+ gtk_widget_hide(widgets->SaveButton);
gtk_widget_set_sensitive(widgets->CancelInstallButton,0);
gtk_widget_set_sensitive(widgets->BackButton,0);
gtk_widget_set_sensitive(widgets->NextButton,1);
@@ -412,7 +825,7 @@ void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets){
gtk_button_set_label(GTK_BUTTON(widgets->CancelInstallButton),CANCEL_LABEL);
gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(GTK_BUTTON(widgets->NextButton))),"com.ublinux.ubinstall-gtk.arrow-right-symbolic",GTK_ICON_SIZE_BUTTON);
gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(GTK_BUTTON(widgets->CancelInstallButton))),"com.ublinux.ubinstall-gtk.circle-exit-symbolic",GTK_ICON_SIZE_BUTTON);
- // gtk_widget_set_sensitive(widgets->ConfigurationModeMenuItem,1);
+ gtk_widget_set_sensitive(widgets->ConfigurationModeMenuItem,1);
yon_switch_page_render(widgets,0);
} break;
@@ -455,8 +868,12 @@ void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets){
case YON_PAGE_USERS:
yon_switch_page_render(widgets,6);
gtk_widget_set_sensitive(widgets->NextButton,1);
+ gtk_widget_hide(widgets->SaveButton);
break;
+
case YON_PAGE_INSTALL_ERROR:
+ on_summary_log_view((GtkWidget*)NULL);
+ [[fallthrough]];
case YON_PAGE_COMPLETION:{
yon_switch_page_render(widgets,7);
gtk_widget_set_sensitive(widgets->BackButton,0);
@@ -469,10 +886,27 @@ void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets){
main_config.save_done=0;
gtk_button_set_label(GTK_BUTTON(widgets->NextButton),RESTART_LABEL);
gtk_button_set_label(GTK_BUTTON(widgets->CancelInstallButton),EXIT_LABEL);
- gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(GTK_BUTTON(widgets->NextButton))),"com.ublinux.libublsettingsui-gtk3.sync-symbolic",GTK_ICON_SIZE_BUTTON);
+ gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(GTK_BUTTON(widgets->NextButton))),
+ "com.ublinux.ubinstall-gtk.sync-symbolic",GTK_ICON_SIZE_BUTTON);
}
break;
+ case YON_PAGE_COMPLETED:{
+ yon_switch_page_render(widgets,7);
+ gtk_widget_set_sensitive(widgets->BackButton,1);
+ gtk_widget_hide(gtk_widget_get_parent(widgets->PackageInstallationProgress));
+ gtk_widget_hide(widgets->InstallationLabel);
+ gtk_widget_hide(widgets->PackageInstallationLabel);
+ gtk_widget_set_sensitive(widgets->NextButton,0);
+ gtk_widget_set_sensitive(widgets->CancelInstallButton,1);
+ main_config.install_complete=0;
+ main_config.save_done=0;
+ gtk_button_set_label(GTK_BUTTON(widgets->CancelInstallButton),EXIT_LABEL);
+ gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(GTK_BUTTON(widgets->NextButton))),
+ "com.ublinux.ubinstall-gtk.sync-symbolic",GTK_ICON_SIZE_BUTTON);
+
+ }break;
+
case YON_PAGE_SECTIONS:
case YON_PAGE_INSTALL_COMMON:
case YON_PAGE_INSTALL_SEPARATE:
@@ -485,6 +919,12 @@ void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets){
case YON_PAGE_OPTIONS_OS_ONLY:
case YON_PAGE_OPTIONS_USRDATA_ONLY: {
yon_switch_page_render(widgets,2);
+ } break;
+ case YON_PAGE_CONFIGURE_END: {
+ gtk_widget_set_sensitive(widgets->BackButton,1);
+ gtk_widget_set_sensitive(widgets->NextButton,0);
+ gtk_widget_set_sensitive(widgets->CancelInstallButton,1);
+ gtk_widget_show(widgets->SaveButton);
}
}
}
@@ -530,6 +970,7 @@ log_window *yon_log_window_new(){
log_window *window = malloc(sizeof(log_window));
GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_log_view);
window->Window = yon_gtk_builder_get_widget(builder,"MainWindow");
+ window->ScrollWindow = yon_gtk_builder_get_widget(builder,"ScrollWindow");
window->HeadLabel = yon_gtk_builder_get_widget(builder,"headerTopic");
window->LogLabel = yon_gtk_builder_get_widget(builder,"LogLabel");
window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox");
@@ -543,12 +984,16 @@ gboolean yon_read_log(void *data){
log_window *window = (log_window*)data;
if (window->Window){
int size;
+ while (!main_config.install_complete&&main_config.log_progress_buzy){};
+ main_config.log_progress_buzy=1;
config_str parsed = yon_file_open(window->command,&size);
+ main_config.log_progress_buzy=0;
if (size){
char *final = yon_char_parsed_to_string(parsed,size,"");
gtk_label_set_text(GTK_LABEL(window->LogLabel),final);
free(final);
yon_char_parsed_free(parsed,size);
+ gtk_adjustment_set_value(gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(window->ScrollWindow)),gtk_adjustment_get_upper(gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(window->ScrollWindow))));
}
return 1;
}
@@ -563,7 +1008,6 @@ void on_process_log_view(GtkWidget *){
gdk_threads_add_timeout(500,(GSourceFunc)yon_read_log,window);
}
-void on_summary_log_view(GtkWidget *);
void on_summary_log_view(GtkWidget *){
log_window *window = yon_log_window_new();
yon_gtk_window_setup(GTK_WINDOW(window->Window),NULL,LOG_VIEW_LABEL,icon_path,"log_viewer");
@@ -607,7 +1051,7 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){
switch (page){
case YON_PAGE_WELCOME:{
gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_LICENCE);
- // gtk_widget_set_sensitive(widgets->ConfigurationModeMenuItem,0);
+ gtk_widget_set_sensitive(widgets->ConfigurationModeMenuItem,0);
} break;
case YON_PAGE_SECTIONS:{ //sections
@@ -653,10 +1097,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);
@@ -698,16 +1142,18 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){
} else {
yon_config_remove_by_key(xkblayout_parameter);
}
- char *model = gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->KeyboardModelCombo))?(char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->KeyboardModelCombo)):"";
- // char *layout_switch;
- if (!yon_char_is_empty(model))
- yon_config_register(xkbmodel_parameter,xkbmodel_parameter_command,model);
- else
+ if (!gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->KeyboardModelCombo))){
+ char *model = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->KeyboardModelCombo));
+ // char *layout_switch;
+ if (!yon_char_is_empty(model))
+ yon_config_register(xkbmodel_parameter,xkbmodel_parameter_command,model);
+ } else{
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;
@@ -841,7 +1287,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);
}
@@ -853,11 +1299,12 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){
return;
} else {
char *password = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->PasswordEntry));
+
yon_config_register(user_password_parameter,user_password_parameter_command,password);
}
} else {
- yon_config_register(user_password_parameter,user_password_parameter_command,PASSWORD_DEFAULT);
+ yon_config_remove_by_key(user_password_parameter);
}
if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->AdminPasswordCombo))==1){
@@ -881,7 +1328,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);
}
@@ -899,7 +1346,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;
}
}
@@ -916,12 +1362,13 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){
yon_config_remove_by_key(xkbmodel_parameter);
}
- char *options = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->LayoutBindingCombo));
- if (!yon_char_is_empty(options)){
+ if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->LayoutBindingCombo))){
+ char *options = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->LayoutBindingCombo));
yon_config_register(xkboptions_parameter,xkboptions_parameter_command,options);
} else {
yon_config_remove_by_key(xkboptions_parameter);
}
+
if (!main_config.configure_mode){
if (!main_config.install_complete){
gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION);
@@ -1102,6 +1549,14 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){
gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_SECTIONS);
break;
+ case YON_PAGE_CONFIGURE_END:{
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_USERS);
+ } break;
+
+ case YON_PAGE_COMPLETED:{
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_USERS);
+ } break;
+
default:{
gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),page-1);
}
@@ -1241,7 +1696,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;
@@ -1343,6 +1797,10 @@ main_window *yon_main_window_complete(){
main_window *widgets=NULL;
widgets = yon_remalloc(widgets,sizeof(main_window));
GtkBuilder *builder = gtk_builder_new_from_resource(glade_path);
+ 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,"yon_gtk_toggle_button_set_inactive_from_toggle",G_CALLBACK(yon_gtk_toggle_button_set_inactive_from_toggle));
+ gtk_builder_add_callback_symbol(builder,"yon_gtk_toggle_button_set_inactive_from_entry",G_CALLBACK(yon_gtk_toggle_button_set_inactive_from_entry));
+ gtk_builder_add_callback_symbol(builder,"yon_gtk_toggle_button_set_inactive_from_combo_box",G_CALLBACK(yon_gtk_toggle_button_set_inactive_from_combo_box));
// Custom widgets configuration
widgets->builder = builder;
@@ -1466,6 +1924,17 @@ main_window *yon_main_window_complete(){
widgets->UserdataDevicesTree = yon_gtk_builder_get_widget(builder,"UserdataDevicesTree");
widgets->UserdataSysSectionTree = yon_gtk_builder_get_widget(builder,"UserdataSysSectionTree");
+ widgets->SaveButton = yon_gtk_builder_get_widget(builder,"SaveButton");
+
+ widgets->LoadGlobalConfigurationMenuItem = yon_gtk_builder_get_widget(builder,"LoadGlobalConfigurationMenuItem");
+ widgets->LoadLocalConfigurationMenuItem = yon_gtk_builder_get_widget(builder,"LoadLocalConfigurationMenuItem");
+ widgets->LoadExternalConfigurationMenuItem = yon_gtk_builder_get_widget(builder,"LoadExternalConfigurationMenuItem");
+
+ widgets->SaveGlobalLocalConfigurationMenuItem = yon_gtk_builder_get_widget(builder,"SaveGlobalLocalConfigurationMenuItem");
+ widgets->SaveGlobalConfigurationMenuItem = yon_gtk_builder_get_widget(builder,"SaveGlobalConfigurationMenuItem");
+ widgets->SaveLocalConfigurationMenuItem = yon_gtk_builder_get_widget(builder,"SaveLocalConfigurationMenuItem");
+ widgets->SaveExternalConfigurationMenuItem = yon_gtk_builder_get_widget(builder,"SaveExternalConfigurationMenuItem");
+
widgets->LanguagesList = GTK_LIST_STORE(gtk_builder_get_object(builder,"LanguagesList"));
widgets->LanguagesFilter = GTK_TREE_MODEL(gtk_builder_get_object(builder,"LanguagesFilter"));
widgets->LayoutsFilter = GTK_TREE_MODEL(gtk_builder_get_object(builder,"LayoutsFilter"));
@@ -1473,6 +1942,15 @@ main_window *yon_main_window_complete(){
widgets->AdditionalSoftwareList = GTK_LIST_STORE(gtk_builder_get_object(builder,"AdditionalSoftwareList"));
widgets->PartitionsList = GTK_LIST_STORE(gtk_builder_get_object(builder,"PartitionsList"));
+ 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->SaveGlobalLocalConfigurationMenuItem),"activate",G_CALLBACK(on_config_global_local_save),widgets);
+ g_signal_connect(G_OBJECT(widgets->SaveGlobalConfigurationMenuItem),"activate",G_CALLBACK(on_config_global_save),widgets);
+ g_signal_connect(G_OBJECT(widgets->SaveLocalConfigurationMenuItem),"activate",G_CALLBACK(on_config_local_save),widgets);
+ g_signal_connect(G_OBJECT(widgets->SaveExternalConfigurationMenuItem),"activate",G_CALLBACK(on_config_custom_save),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);
@@ -1522,6 +2000,7 @@ main_window *yon_main_window_complete(){
g_signal_connect(G_OBJECT(widgets->SameInstallationFormatCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->SameInstallationFilesystemTypeCombo);
// g_signal_connect(G_OBJECT(widgets->InstallationToggle),"toggled",G_CALLBACK(on_toggle_block),widgets);
+
gtk_tree_model_filter_set_visible_column(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter),0);
gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter));
@@ -1583,6 +2062,7 @@ main_window *yon_main_window_complete(){
if (layout_size){
char *layout_id = yon_char_new(layout[0]);
gtk_tree_store_append(widgets->LayoutList,&iter,NULL);
+ yon_debug_output("%s\n",parsed[i]);
gtk_tree_store_set(widgets->LayoutList,&iter,0,layout[0],1,_(layout[1]),2,1,-1);
yon_char_parsed_free(layout,layout_size);
layout = yon_config_load(get_layouts_local_command(layout_id),&layout_size);
@@ -1642,7 +2122,9 @@ main_window *yon_main_window_complete(){
models[i+1] = yon_char_divide_search(models[i+1],"\n",-1);
gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(widgets->KeyboardModelCombo),models[i],_(models[i+1]));
}
-
+ gtk_builder_connect_signals(builder,NULL);
+ yon_load_proceed(YON_CONFIG_DEFAULT);
+ yon_interface_update(widgets);
return widgets;
}
diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h
index 4eff327..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]"
@@ -117,7 +117,7 @@ NULL
#define set_user_config_command(parameters) yon_char_unite("pkexec bash -c 'ubconfig --target system set [autoinstall] ",parameters,";nice ubinstall2 autoconfig'",NULL)
-#define open_gparted_command "pkexec gparted"
+#define open_gparted_command "gparted"
#define AUTOINSTALL_TYPE_INSTALL_command "ubconfig --source global get autoinstall AUTOINSTALL[install_type]"
#define AUTOINSTALL_DEVICE_command "ubconfig --source global get autoinstall AUTOINSTALL[device]"
@@ -135,6 +135,16 @@ 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] 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 ""
+
+#define ubconfig_file_create(target) yon_char_unite("ubconfig --target \"",target,"\" create",NULL)
+
typedef char* string;
string version_application;
@@ -182,6 +192,7 @@ typedef struct {
int password_min_length;
int save_done;
+ int load_mode;
int install_complete;
int debug_mode;
@@ -191,6 +202,9 @@ typedef struct {
GThread *install_thread;
guint progress_thread;
int configure_mode;
+ int log_progress_buzy;
+ int autologin_default;
+ int format_default;
} config;
typedef struct {
@@ -201,6 +215,17 @@ typedef struct {
GtkListStore *AdditionalSoftwareList;
GtkListStore *PartitionsList;
+ GtkWidget *LoadGlobalConfigurationMenuItem;
+ GtkWidget *LoadLocalConfigurationMenuItem;
+ GtkWidget *LoadExternalConfigurationMenuItem;
+
+ GtkWidget *SaveGlobalLocalConfigurationMenuItem;
+ GtkWidget *SaveGlobalConfigurationMenuItem;
+ GtkWidget *SaveLocalConfigurationMenuItem;
+ GtkWidget *SaveExternalConfigurationMenuItem;
+
+ GtkWidget *SaveButton;
+
GtkWidget *MainWindow;
GtkWidget *StatusBox;
@@ -379,6 +404,7 @@ typedef struct{
typedef struct {
GtkWidget *Window;
+ GtkWidget *ScrollWindow;
GtkWidget *StatusBox;
GtkWidget *HeadLabel;
GtkWidget *LogLabel;
@@ -392,4 +418,12 @@ void NewFunction(ubinstall_language_window *window, GtkBuilder *builder);
ubinstall_keyboard_window *yon_ubinstall_keyboard_new();
password_window *yon_password_new();
-void on_password_accept(GtkWidget *self, dictionary *dict);
\ No newline at end of file
+void on_password_accept(GtkWidget *self, dictionary *dict);
+
+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 *);
+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 c53c39f..d1176b9 100644
--- a/source/ubl-strings.h
+++ b/source/ubl-strings.h
@@ -6,7 +6,10 @@
#define WELCOME_LABEL _("Welcome to UBLinux installation")
#define WELCOME_BOTTOM_LABEL _("This program will ask you few questions\nand help you install UBLinux on your computer")
+#define OPEN_LABEL _("Open")
+
#define KEYBOARD_TITLE_LABEL _("Keyboard layout")
+ #define CUSTOM_CONFIG_CREATION_ERROR_LABEL _("New configuration file creation failed")
#define CANCEL_LABEL _("Cancel")
#define BACK_LABEL _("Back")
@@ -138,3 +141,22 @@
#define ERROR_LABEL _("Error has occured while installation process")
#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-keyboard.glade b/ubinstall-gtk-keyboard.glade
index c5f6ad6..8ca6152 100644
--- a/ubinstall-gtk-keyboard.glade
+++ b/ubinstall-gtk-keyboard.glade
@@ -50,13 +50,13 @@
@@ -1869,6 +2065,40 @@ and help you install UBLinux on your computer
1
+
+
+ False
+ True
+ 2
+
+
+
+
+ True
+ False
+ vertical
+ 5
+
+
+ True
+ False
+ False
+ True
+
+
+
+
+
+
+
+
+
+
+ False
+ True
+ 1
+
+
True
@@ -1884,10 +2114,12 @@ and help you install UBLinux on your computer
Default layout (ru)
True
+ False
True
False
True
True
+
False
@@ -1899,10 +2131,12 @@ and help you install UBLinux on your computer
Define
True
+ False
True
False
True
DefaultLayoutRadio
+
False
@@ -1920,7 +2154,6 @@ and help you install UBLinux on your computer
True
- False
False
5
@@ -1931,6 +2164,7 @@ and help you install UBLinux on your computer
True
+ False
True
LayoutsFilter
0
@@ -1977,6 +2211,7 @@ and help you install UBLinux on your computer
True
+ False
True
True
image13
@@ -1993,6 +2228,7 @@ and help you install UBLinux on your computer
True
+ False
True
True
image14
@@ -2031,7 +2267,7 @@ and help you install UBLinux on your computer
False
True
- 2
+ 3
@@ -2096,6 +2332,23 @@ and help you install UBLinux on your computer
True
False
5
+
+
+ True
+ False
+ False
+ True
+
+
+
+
+
+
+ False
+ True
+ 0
+
+
True
@@ -2106,19 +2359,21 @@ and help you install UBLinux on your computer
False
True
- 0
+ 1
True
+ False
True
Super Admin
+
True
True
- 1
+ 2
@@ -2133,6 +2388,23 @@ and help you install UBLinux on your computer
True
False
5
+
+
+ True
+ False
+ False
+ True
+
+
+
+
+
+
+ False
+ True
+ 0
+
+
True
@@ -2143,19 +2415,21 @@ and help you install UBLinux on your computer
False
True
- 0
+ 1
True
+ False
True
superadmin
+
True
True
- 1
+ 2
@@ -2170,6 +2444,24 @@ and help you install UBLinux on your computer
True
False
5
+
+
+ True
+ False
+ False
+ True
+
+
+
+
+
+
+
+ False
+ True
+ 0
+
+
True
@@ -2180,38 +2472,42 @@ and help you install UBLinux on your computer
False
True
- 0
+ 1
True
+ False
False
0
- Default
- Set a password
+
False
True
- 1
+ 2
True
+ False
True
False
●
******
password
+
True
True
- 2
+ 3
@@ -2226,18 +2522,37 @@ and help you install UBLinux on your computer
True
False
5
+
+
+ True
+ False
+ False
+ True
+
+
+
+
+
+
+ False
+ True
+ 0
+
+
Automatic login without password prompt
True
+ False
True
False
True
+
False
True
- 0
+ 1
@@ -2252,6 +2567,24 @@ and help you install UBLinux on your computer
True
False
5
+
+
+ True
+ False
+ False
+ True
+
+
+
+
+
+
+
+ False
+ True
+ 0
+
+
True
@@ -2262,38 +2595,42 @@ and help you install UBLinux on your computer
False
True
- 0
+ 1
True
+ False
False
0
- Default
- Set a password
+
False
True
- 1
+ 2
True
+ False
True
False
●
******
password
+
True
True
- 2
+ 3
@@ -2320,11 +2657,16 @@ and help you install UBLinux on your computer
False
5
-
+
True
False
- Computer name:
- 0
+ False
+ True
+
+
+
+
+
False
@@ -2333,12 +2675,11 @@ and help you install UBLinux on your computer
-
- Automatically
+
True
- True
- False
- True
+ False
+ Computer name:
+ 0
False
@@ -2349,8 +2690,10 @@ and help you install UBLinux on your computer
True
+ False
True
ubstation
+
True
@@ -2358,6 +2701,22 @@ and help you install UBLinux on your computer
2
+
+
+ Automatically
+ True
+ False
+ True
+ False
+ True
+
+
+
+ False
+ True
+ 3
+
+
False
@@ -2485,9 +2844,10 @@ or continue working in the UBLinux Live environment.
True
False
- Installation completion
+ Completion
+
@@ -2500,7 +2860,6 @@ or continue working in the UBLinux Live environment.
- True
False
@@ -2509,6 +2868,41 @@ or continue working in the UBLinux Live environment.
1
+
+
+ True
+ False
+ end
+ Configuration has been saved
+
+
+
+
+
+
+ True
+ True
+ 2
+
+
+
+
+ True
+ False
+ start
+ You can safely exit configurator or return and create new configuration file.
+ center
+ True
+
+
+
+
+
+ True
+ True
+ 3
+
+
11
@@ -2767,6 +3161,23 @@ or continue working in the UBLinux Live environment.
True
False
5
+
+
+ True
+ False
+ False
+ True
+
+
+
+
+
+
+ False
+ True
+ 0
+
+
True
@@ -2776,12 +3187,13 @@ or continue working in the UBLinux Live environment.
False
True
- 0
+ 1
True
+ False
False
1
@@ -2795,11 +3207,12 @@ or continue working in the UBLinux Live environment.
- xfs
- zfs
+
True
True
- 1
+ 2
@@ -2814,6 +3227,23 @@ or continue working in the UBLinux Live environment.
True
False
5
+
+
+ True
+ False
+ False
+ True
+
+
+
+
+
+
+ False
+ True
+ 0
+
+
True
@@ -2823,18 +3253,20 @@ or continue working in the UBLinux Live environment.
False
True
- 0
+ 1
True
+ False
True
+
True
True
- 1
+ 2
@@ -3014,42 +3446,12 @@ installed.
True
False
vertical
- 5
-
+
True
False
- 5
-
-
- True
- False
- Select device:
- 0
-
-
- False
- True
- 0
-
-
-
-
- True
- True
- True
- image36
-
-
-
- False
- True
- end
- 1
-
-
+ Choose a section:
+ 0
False
@@ -3064,17 +3466,17 @@ installed.
in
128
-
+
True
True
- DevicesList
+ PartitionsList
0
- Device
+ Section
@@ -3085,7 +3487,7 @@ installed.
- Description
+ Capacity
@@ -3096,7 +3498,7 @@ installed.
- Mark
+ Free space
@@ -3107,7 +3509,7 @@ installed.
- Size
+ File system
@@ -3118,7 +3520,7 @@ installed.
- Serial
+ Mark
@@ -3140,7 +3542,7 @@ installed.
False
True
- 0
+ 1
@@ -3148,12 +3550,42 @@ installed.
True
False
vertical
+ 5
-
+
True
False
- Choose a section:
- 0
+ 5
+
+
+ True
+ False
+ Select device:
+ 0
+
+
+ False
+ True
+ 0
+
+
+
+
+ True
+ True
+ True
+ image36
+
+
+
+ False
+ True
+ end
+ 1
+
+
False
@@ -3168,17 +3600,17 @@ installed.
in
128
-
+
True
True
- PartitionsList
+ DevicesList
0
- Section
+ Device
@@ -3189,7 +3621,7 @@ installed.
- Capacity
+ Description
@@ -3200,7 +3632,7 @@ installed.
- Free space
+ Mark
@@ -3211,7 +3643,7 @@ installed.
- File system
+ Size
@@ -3222,7 +3654,7 @@ installed.
- Mark
+ Serial
@@ -3244,7 +3676,7 @@ installed.
False
True
- 1
+ 2
@@ -3252,6 +3684,24 @@ installed.
True
False
5
+
+
+ True
+ False
+ False
+ True
+
+
+
+
+
+
+
+ False
+ True
+ 0
+
+
True
@@ -3261,12 +3711,13 @@ installed.
False
True
- 0
+ 1
True
+ False
True
0,0
adjustment1
@@ -3275,12 +3726,13 @@ installed.
False
True
- 1
+ 2
True
+ False
False
1
@@ -3288,11 +3740,12 @@ installed.
- Gb
- Tb
+
False
True
- 2
+ 3
@@ -3314,6 +3767,24 @@ installed.
True
False
5
+
+
+ True
+ False
+ False
+ True
+
+
+
+
+
+
+
+ False
+ True
+ 0
+
+
True
@@ -3323,45 +3794,49 @@ installed.
False
True
- 0
+ 1
True
+ False
False
1
- - ext3
- - ext4
- - fat16
- - fat32
- - exfat
- - riserfs
- - udf
- - xfs
- - zfs
+ - ext3
+ - ext4
+ - fat16
+ - fat32
+ - exfat
+ - riserfs
+ - udf
+ - xfs
+ - zfs
+
True
True
- 1
+ 2
Format
True
+ False
True
False
True
True
+
False
True
- 2
+ 3
@@ -3376,6 +3851,23 @@ installed.
True
False
5
+
+
+ True
+ False
+ False
+ True
+
+
+
+
+
+
+ False
+ True
+ 0
+
+
True
@@ -3385,18 +3877,20 @@ installed.
False
True
- 0
+ 1
True
+ False
True
+
True
True
- 1
+ 2
@@ -3809,6 +4303,24 @@ installed.
True
False
5
+
+
+ True
+ False
+ False
+ True
+
+
+
+
+
+
+
+ False
+ True
+ 0
+
+
True
@@ -3818,12 +4330,13 @@ installed.
False
True
- 0
+ 1
True
+ False
False
1
@@ -3837,26 +4350,29 @@ installed.
- xfs
- zfs
+
True
True
- 1
+ 2
Format
True
+ False
True
False
True
True
+
False
True
- 2
+ 3
@@ -3871,6 +4387,23 @@ installed.
True
False
5
+
+
+ True
+ False
+ False
+ True
+
+
+
+
+
+
+ False
+ True
+ 0
+
+
True
@@ -3880,18 +4413,20 @@ installed.
False
True
- 0
+ 1
True
+ False
True
+
True
True
- 1
+ 2
@@ -7000,6 +7535,7 @@ separately into the selected partition.
+
+
+
+ end
+ 2
+
+
diff --git a/ubinstall-gtk.pot b/ubinstall-gtk.pot
index 3e4df4b..ec770d3 100644
--- a/ubinstall-gtk.pot
+++ b/ubinstall-gtk.pot
@@ -549,6 +549,48 @@ 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 "Save"
+msgstr ""
+
+msgid "Load"
+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..88ee4a7 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,50 @@ 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 "Save"
+msgstr "Сохранить"
+
+msgid "Load"
+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 "Африканский"