From d3a699e52c220ad44375ec574f0b1f81129e350e Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 31 Oct 2025 10:48:53 +0600 Subject: [PATCH] Fixed installation process stopping --- locale/ubinstall-gtk.pot | 4 +++ locale/ubinstall-gtk_ru.po | 4 +++ source/ubinstall-gtk-page-switch.c | 10 ++++++++ source/ubinstall-gtk.c | 2 +- source/ubl-strings.h | 1 + ubinstall-gtk.glade | 40 +----------------------------- 6 files changed, 21 insertions(+), 40 deletions(-) diff --git a/locale/ubinstall-gtk.pot b/locale/ubinstall-gtk.pot index 395ba9f..f7df02d 100644 --- a/locale/ubinstall-gtk.pot +++ b/locale/ubinstall-gtk.pot @@ -1173,6 +1173,10 @@ msgstr "" msgid "Are you sure want to exit and\ninterrupt installation process?" msgstr "" +#: source/ubl-strings.h:331 +msgid "Are you sure want to interrupt installation process?" +msgstr "" + #: source/ubl-strings.h:331 msgid "About system installation" msgstr "" \ No newline at end of file diff --git a/locale/ubinstall-gtk_ru.po b/locale/ubinstall-gtk_ru.po index 977278f..ce95a19 100644 --- a/locale/ubinstall-gtk_ru.po +++ b/locale/ubinstall-gtk_ru.po @@ -659,6 +659,10 @@ msgstr "" "Вы уверены, что хотите закрыть программу и\n" "прервать процесс установки?" +#: source/ubl-strings.h:331 +msgid "Are you sure want to interrupt installation process?" +msgstr "Вы уверены, что хотите прервать процесс установки?" + #: source/ubl-strings.h:187 msgid "Are you sure want to reboot system?" msgstr "Вы уверены что хотите перезагрузить систему?" diff --git a/source/ubinstall-gtk-page-switch.c b/source/ubinstall-gtk-page-switch.c index 929cc8c..97d9958 100644 --- a/source/ubinstall-gtk-page-switch.c +++ b/source/ubinstall-gtk-page-switch.c @@ -430,6 +430,16 @@ void on_page_cancel_clicked(GtkWidget *, main_window *widgets){ gtk_widget_set_sensitive(widgets->ConfigurationModeMenuItem,1); yon_page_update(widgets); + dialog_confirmation_data *data = yon_confirmation_dialog_data_new(); + data->action_text=INTERRUPT_TEXT_LABEL; + data->title=WARNING_TITLE_LABEL; + if (yon_confirmation_dialog_call(widgets->MainWindow,data)==GTK_RESPONSE_ACCEPT ){ + if (main_config.install_thread){ + gtk_widget_hide(gtk_widget_get_parent(widgets->InstallationProgress)); + pthread_cancel((pthread_t)main_config.install_thread); + } + } + } void on_system_setup_pass(GtkWidget *, main_window *widgets){ diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 69f30ec..fd64d2c 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -600,7 +600,7 @@ gboolean on_yon_exit(GtkWidget *,GdkEvent*, main_window *widgets){ if (!main_config.exit_accepted||(main_config.save_done&&main_config.install_complete)){ if (widgets){}; dialog_confirmation_data *data = yon_confirmation_dialog_data_new(); - data->action_text=WARNING_TEXT_LABEL; + data->action_text=INTERRUPT_TEXT_LABEL; data->title=WARNING_TITLE_LABEL; if (yon_confirmation_dialog_call(widgets->MainWindow,data)==GTK_RESPONSE_ACCEPT ){ on_exit_accepted(widgets); diff --git a/source/ubl-strings.h b/source/ubl-strings.h index e21887c..04c031f 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -189,6 +189,7 @@ NULL) #define WARNING_TITLE_LABEL _("Warning") #define WARNING_TEXT_LABEL _("Are you sure want to exit and\ninterrupt installation process?") +#define INTERRUPT_TEXT_LABEL _("Are you sure want to interrupt installation process?") #define WARNING_REBOOT_TEXT_LABEL _("Are you sure want to reboot system?") #define DEFAULT_BOOTLOAD_MENU_ITEM_LABEL _("Default (Use last succeeded)") diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index bfa86cb..e27fb4e 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -1,5 +1,5 @@ - + @@ -1537,48 +1537,10 @@ and help you install system on your computer False vertical 5 - - - True - False - 5 - 5 - 5 - - - True - True - - - False - True - 0 - - - - - True - False - Default - - - False - True - 1 - - - - - False - True - 0 - - True True - in True