From 0488712549ef5d49882cf54ea162f66eb2d5962a Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 8 Sep 2025 17:23:13 +0600 Subject: [PATCH] Buttons actions --- source/ubinstall-gtk-page-switch.c | 11 +++++++++++ source/ubinstall-gtk-saving.c | 11 +++++++---- source/ubinstall-gtk.c | 3 ++- source/ubinstall-gtk.h | 3 ++- ubinstall-gtk-source.glade | 1 + 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/source/ubinstall-gtk-page-switch.c b/source/ubinstall-gtk-page-switch.c index 6bc9107..f0b2c58 100644 --- a/source/ubinstall-gtk-page-switch.c +++ b/source/ubinstall-gtk-page-switch.c @@ -75,6 +75,8 @@ enum YON_PAGES yon_page_get_current(GtkNotebook *target){ void yon_navigation_buttons_set_sensetiveness(main_window *widgets){ enum YON_PAGES page = yon_page_get_current(GTK_NOTEBOOK(widgets->Notebook)); + gtk_widget_hide(widgets->SourceButton); + gtk_widget_hide(widgets->StartScenarioButton); switch(page){ case YON_PAGE_WELCOME: yon_load_proceed(YON_CONFIG_LOCAL); @@ -100,6 +102,7 @@ void yon_navigation_buttons_set_sensetiveness(main_window *widgets){ case YON_PAGE_INSTALLATION: gtk_widget_set_sensitive(widgets->NextButton,0); gtk_widget_set_sensitive(widgets->BackButton,0); + gtk_widget_hide(widgets->SkipInstallationButton); break; case YON_PAGE_KERNEL: gtk_widget_set_sensitive(widgets->BackButton,0); @@ -116,6 +119,9 @@ void yon_navigation_buttons_set_sensetiveness(main_window *widgets){ gtk_button_set_label(GTK_BUTTON(widgets->NextButton),RESTART_LABEL); gtk_widget_set_sensitive(widgets->BackButton,0); break; + case YON_PAGE_SECTIONS: + gtk_widget_show(widgets->SourceButton); + break; default: gtk_widget_set_sensitive(widgets->BackButton,1); gtk_widget_set_sensitive(widgets->NextButton,1); @@ -403,4 +409,9 @@ void on_page_cancel_clicked(GtkWidget *, main_window *widgets){ gtk_widget_set_sensitive(widgets->ConfigurationModeMenuItem,1); yon_page_update(widgets); +} + +void on_system_setup_pass(GtkWidget *, main_window *widgets){ + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION); + 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 9c02163..b002a28 100644 --- a/source/ubinstall-gtk-saving.c +++ b/source/ubinstall-gtk-saving.c @@ -789,12 +789,15 @@ int yon_config_save(main_window *widgets){ } char *parameter_string = yon_char_parsed_to_string(all_parameters,size," "); - char *command = ubconfig_set_command_full(main_config.config_save_path,"",parameter_string); - if (!system(command)){ - return 1; + if (!yon_char_is_empty(parameter_string)){ + char *command = ubconfig_set_command_full(main_config.config_save_path,"",parameter_string); + if (!system(command)){ + return 1; + } else return 0; + } } - return 0; + return 1; } void yon_config_restore(main_window *widgets){ diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index d133411..dab1c53 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -147,7 +147,7 @@ void on_source_choose(GtkWidget *self){ GtkWidget *target_mode = g_object_get_data(G_OBJECT(self),"combo"); switch (gtk_combo_box_get_active(GTK_COMBO_BOX(target_mode))){ case 0: { - + } break; case 1:{ filechooser_window *dialog = yon_file_chooser_window_new(GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); @@ -766,6 +766,7 @@ main_window *yon_main_window_complete(){ // g_signal_connect(G_OBJECT(widgets->AdvancedPartitionAddBox),"remove",G_CALLBACK(on_advanced_parts_removed),widgets); g_signal_connect(G_OBJECT(widgets->StartScenarioButton),"clicked",G_CALLBACK(yon_quick_install),widgets); g_signal_connect(G_OBJECT(widgets->SourceButton),"clicked",G_CALLBACK(on_source_clicked),widgets); + g_signal_connect(G_OBJECT(widgets->SkipInstallationButton),"clicked",G_CALLBACK(on_system_setup_pass),widgets); { diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index dd1ad1c..38d5026 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -1104,4 +1104,5 @@ void on_source_remove(GtkWidget *,source_element *element); void on_source_add(GtkWidget *,source_window *window); void yon_source_update(source_window *window); void yon_source_element_add(char *key,void*,source_window *window); -source_element *yon_source_element_new(); \ No newline at end of file +source_element *yon_source_element_new(); +void on_system_setup_pass(GtkWidget *, main_window *widgets); \ No newline at end of file diff --git a/ubinstall-gtk-source.glade b/ubinstall-gtk-source.glade index fe32aa9..e1848e1 100644 --- a/ubinstall-gtk-source.glade +++ b/ubinstall-gtk-source.glade @@ -122,6 +122,7 @@ True True + never True