Merge pull request 'Fixed separate installation page' (#19) from YanTheKaller/ubinstall-gtk:master into master

Reviewed-on: #19
master v1.7
Dmitry Razumov 1 year ago
commit 02fe449fca

@ -13,6 +13,7 @@ void _yon_saving_threaded(char *final_command){
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);
yon_char_parsed_free(file_return,file_save);
free(result);
}
@ -27,7 +28,6 @@ char *yon_save_command_prepare(char *command, char *target){
char * cur = yon_config_get_by_key(parsed[i]);
char *full_value = yon_char_unite(parsed[i],"='",cur,"'",NULL);
free(parsed[i]);
free(cur);
parsed[i]=full_value;
}
char *final = yon_char_parsed_to_string(parsed,size," ");
@ -55,7 +55,7 @@ void yon_load_proceed(YON_CONFIG_TYPE type){
GtkWidget *dialog = gtk_file_chooser_dialog_new(TITLE_LABEL,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,CANCEL_LABEL,GTK_RESPONSE_CANCEL,OPEN_LABEL,GTK_RESPONSE_ACCEPT,NULL);
yon_gtk_window_setup(GTK_WINDOW(dialog),NULL,TITLE_LABEL,icon_path,"FileChooserWindow");
textdomain(LocaleName);
gtk_window_set_icon_name(GTK_WINDOW(dialog),"com.ublinux.ubl-settings-video");
gtk_window_set_icon_name(GTK_WINDOW(dialog),"com.ublinux.ubinstall");
gtk_window_set_title(GTK_WINDOW(dialog),TITLE_LABEL);
GtkFileFilter *filter = gtk_file_filter_new();
gtk_file_filter_add_pattern(filter,"*.ini");
@ -74,6 +74,7 @@ void yon_load_proceed(YON_CONFIG_TYPE type){
gtk_widget_destroy(dialog);
}
yon_config_load_config(type,yon_config_get_custom_command(path),NULL);
if (path) free(path);
}
}
@ -354,6 +355,26 @@ void yon_interface_update(main_window *widgets){
gtk_entry_set_text(GTK_ENTRY(widgets->HotnameEntry),"");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AutoHostnameCheck),1);
}
if (fs_type) free(fs_type);
if (device_label) free(device_label);
if (format) free(format);
if (part_size) free(part_size);
if (user_name) free(user_name);
if (user_gecos) free(user_gecos);
if (user_password) free(user_password);
if (root_password) free(root_password);
if (autologin) free(autologin);
if (hostname) free(hostname);
if (kbmodel) free(kbmodel);
if (optinos) free(optinos);
if (layout) free(layout);
if (language) free(language);
if (zone) free(zone);
if (system_locale) free(system_locale);
if (region) free(region);
if (device) free(device);
if (part) free(part);
}
void on_config_local_load(GtkWidget *,main_window *widgets);
@ -431,6 +452,7 @@ void on_config_custom_save(GtkWidget *, main_window *widgets){
return;
}
yon_save_proceed(path,YON_CONFIG_CUSTOM);
if (path) free(path);
gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_COMPLETED);
}
@ -587,7 +609,10 @@ void on_language_window_accept(GtkWidget *,dictionary *dict){
if (status)
yon_char_parsed_add_or_create_if_exists(parsed,&size,current);
}
gtk_entry_set_text(GTK_ENTRY(widgets->AvailableLanguagesEntry),yon_char_parsed_to_string(parsed,size,", "));
char *final = yon_char_parsed_to_string(parsed,size,", ");
gtk_entry_set_text(GTK_ENTRY(widgets->AvailableLanguagesEntry),final);
free(final);
yon_char_parsed_free(parsed,size);
}
on_subwindow_close(window->MainWindow);
free(window);
@ -752,10 +777,12 @@ void *on_config_save(void *data){
if (file)
fclose(file);
char *command = save_config_command(yon_char_parsed_to_string(parameters,size," "));
yon_char_parsed_free(parameters,size);
if (system(command)){
gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALL_ERROR);
// yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),INSTALLATION_ERROR,5,BACKGROUND_IMAGE_FAIL_TYPE);
};
free(command);
main_config.install_thread=NULL;
main_config.install_complete=1;
yon_debug_output("Install set to: %s\n",yon_char_from_int(main_config.install_complete));
@ -782,6 +809,7 @@ gboolean yon_installation_progress_update(void *data){
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);
yon_char_parsed_free(text,size);
free(yon_char_divide(current_copy,0));
free(yon_char_divide(percentage,0));
if (strcmp(percentage,"#pb")){
@ -1028,6 +1056,9 @@ void yon_install_options_save(GtkWidget *device_tree, GtkWidget *part_tree,char
yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,cur_device);
yon_config_register(AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_TYPE_INSTALL_command,mode);
yon_config_register(part_parameter,part_parameter_command,cur_section);
if(cur_section) free(cur_section);
if(cur_device) free(cur_device);
if (!main_config.configure_mode)
gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION_BEGIN);
else
@ -1104,17 +1135,21 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){
yon_config_remove_by_key(locale_parameter);
} else {
yon_config_register(locale_parameter,locale_parameter_command,languages);
free(languages);
}
if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->LanguagesCombo))==-1||!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->LanguagesSensitiveCheck))){
yon_config_remove_by_key(lang_parameter);
} else {
char *language = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->LanguagesCombo));
yon_config_register(lang_parameter,lang_parameter_command,language);
free(language);
}
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->RegionSensitiveCheck))){
char *region = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->RegionCombo));
char *zone = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->ZoneCombo));
yon_config_register(zone_parameter,zone_parameter_command,yon_char_unite(region,"/",zone,NULL));
free(zone);
free(region);
} else {
yon_config_remove_by_key(zone_parameter);
}

@ -3446,11 +3446,17 @@ installed.</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="spacing">5</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Choose a section:</property>
<property name="label" translatable="yes">Select device:</property>
<property name="xalign">0</property>
</object>
<packing>
@ -3459,6 +3465,30 @@ installed.</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="GpartedNearButton">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image">image36</property>
<style>
<class name="thin"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack-type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
@ -3466,17 +3496,17 @@ installed.</property>
<property name="shadow-type">in</property>
<property name="min-content-height">128</property>
<child>
<object class="GtkTreeView" id="InstallationNearSysSectionTree">
<object class="GtkTreeView" id="InstallationNearSysDevicesTree">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="model">PartitionsList</property>
<property name="model">DevicesList</property>
<property name="search-column">0</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Section</property>
<property name="title" translatable="yes">Device</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
@ -3487,7 +3517,7 @@ installed.</property>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Capacity</property>
<property name="title" translatable="yes">Description</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
@ -3498,7 +3528,7 @@ installed.</property>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Free space</property>
<property name="title" translatable="yes">Mark</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
@ -3509,7 +3539,7 @@ installed.</property>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">File system</property>
<property name="title" translatable="yes">Size</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
@ -3520,7 +3550,7 @@ installed.</property>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Mark</property>
<property name="title" translatable="yes">Serial</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
@ -3542,7 +3572,7 @@ installed.</property>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">0</property>
</packing>
</child>
<child>
@ -3550,17 +3580,11 @@ installed.</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="spacing">5</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Select device:</property>
<property name="label" translatable="yes">Choose a section:</property>
<property name="xalign">0</property>
</object>
<packing>
@ -3569,30 +3593,6 @@ installed.</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="GpartedNearButton">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image">image36</property>
<style>
<class name="thin"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack-type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
@ -3600,17 +3600,17 @@ installed.</property>
<property name="shadow-type">in</property>
<property name="min-content-height">128</property>
<child>
<object class="GtkTreeView" id="InstallationNearSysDevicesTree">
<object class="GtkTreeView" id="InstallationNearSysSectionTree">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="model">DevicesList</property>
<property name="model">PartitionsList</property>
<property name="search-column">0</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Device</property>
<property name="title" translatable="yes">Section</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
@ -3621,7 +3621,7 @@ installed.</property>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Description</property>
<property name="title" translatable="yes">Capacity</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
@ -3632,7 +3632,7 @@ installed.</property>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Mark</property>
<property name="title" translatable="yes">Free space</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
@ -3643,7 +3643,7 @@ installed.</property>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Size</property>
<property name="title" translatable="yes">File system</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
@ -3654,7 +3654,7 @@ installed.</property>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Serial</property>
<property name="title" translatable="yes">Mark</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
@ -3676,7 +3676,7 @@ installed.</property>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">1</property>
</packing>
</child>
<child>

Loading…
Cancel
Save