From 62684554e9ca32a0fc2947dfc098bb5ad47d3623 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Wed, 10 Dec 2025 18:06:47 +0600 Subject: [PATCH] Localisation; Cancel button fix --- locale/ubinstall-gtk.pot | 6 ++++++ locale/ubinstall-gtk_ru.po | 8 ++++++++ source/ubinstall-gtk-page-switch.c | 7 +++++++ source/ubinstall-gtk.c | 9 +++++++++ source/ubinstall-gtk.h | 6 +++++- source/ubl-strings.h | 2 ++ ubinstall-gtk-source.glade | 2 +- 7 files changed, 38 insertions(+), 2 deletions(-) diff --git a/locale/ubinstall-gtk.pot b/locale/ubinstall-gtk.pot index 68c41b1..73f1292 100644 --- a/locale/ubinstall-gtk.pot +++ b/locale/ubinstall-gtk.pot @@ -1201,4 +1201,10 @@ msgstr "" msgid "Module:" msgstr "" +#: source/ubl-strings.h:331 +msgid "Yes, I agree to the License Agreement" +msgstr "" +#: source/ubl-strings.h:331 +msgid "No, i do not agree" +msgstr "" diff --git a/locale/ubinstall-gtk_ru.po b/locale/ubinstall-gtk_ru.po index 20d9b39..38b3438 100644 --- a/locale/ubinstall-gtk_ru.po +++ b/locale/ubinstall-gtk_ru.po @@ -3040,3 +3040,11 @@ msgstr "Пакет:" #: source/ubl-strings.h:331 msgid "Module:" msgstr "Модуль:" + +#: source/ubl-strings.h:331 +msgid "Yes, I agree to the License Agreement" +msgstr "Да, я согласен с лицензионным соглашением" + +#: source/ubl-strings.h:331 +msgid "No, i do not agree" +msgstr "Нет, я не согласен" diff --git a/source/ubinstall-gtk-page-switch.c b/source/ubinstall-gtk-page-switch.c index e15313d..e71202a 100644 --- a/source/ubinstall-gtk-page-switch.c +++ b/source/ubinstall-gtk-page-switch.c @@ -107,7 +107,11 @@ void yon_navigation_buttons_set_sensetiveness(main_window *widgets){ case YON_PAGE_LICENCE: gtk_widget_show(widgets->BackButton); gtk_widget_set_sensitive(widgets->BackButton,1); + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->LicenseAgreeRadio))) gtk_widget_set_sensitive(widgets->NextButton,1); + else + gtk_widget_set_sensitive(widgets->NextButton,0); + gtk_widget_set_sensitive(widgets->CancelInstallButton,1); break; case YON_PAGE_INSTALLATION: @@ -443,6 +447,9 @@ void on_page_cancel_clicked(GtkWidget *, main_window *widgets){ pthread_cancel((pthread_t)main_config.install_thread); } } + } else { + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_LICENCE); + on_page_prev_clicked(NULL,widgets); } } diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 190c330..dc003c3 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -1,6 +1,11 @@ #include "ubinstall-gtk.h" config main_config; + +void yon_license_init(main_window *widgets){ + gtk_widget_set_sensitive(widgets->NextButton,0); +} + void yon_open_browser(GtkWidget *, char *link){ GtkWidget *window = yon_ubl_browser_window_open(link,TITLE_LABEL); if (window) @@ -803,6 +808,8 @@ void yon_main_window_create(main_window *widgets){ 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"); + widgets->LicenseAgreeRadio = yon_gtk_builder_get_widget(builder,"LicenseAgreeRadio"); + widgets->LicenseDisgreeRadio = yon_gtk_builder_get_widget(builder,"LicenseDisgreeRadio"); widgets->EnableVNCMenuItem = yon_gtk_builder_get_widget(builder,"EnableVNCMenuItem"); widgets->DocumentationMenuItem = yon_ubl_menu_item_documentation_new(DOCUMENTATION_LABEL); @@ -1063,6 +1070,8 @@ void yon_main_window_create(main_window *widgets){ gtk_menu_shell_append(GTK_MENU_SHELL(menu),widgets->DocumentationMenuItem); gtk_menu_shell_append(GTK_MENU_SHELL(menu),widgets->AboutMenuItem); + g_signal_connect(G_OBJECT(widgets->LicenseAgreeRadio),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->NextButton); + 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); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 13109c8..3be8be8 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -437,6 +437,9 @@ typedef struct { GtkWidget *MainWindow; + GtkWidget *LicenseAgreeRadio; + GtkWidget *LicenseDisgreeRadio; + GtkWidget *StartScenarioButton; GtkWidget *SourceButton; GtkWidget *SkipInstallationButton; @@ -1232,4 +1235,5 @@ void *yon_maximize(main_window *widgets); kernel_addon_row *yon_kernel_addon_row_new(); void yon_kernel_addon_row_setup(kernel_addon_row *row, char *name, char *modules,char *package, char *description); void on_kernel_addon_install_enabled(GtkWidget *, kernel_addon_row *row); -void on_kernel_addon_info(GtkLabel *self); \ No newline at end of file +void on_kernel_addon_info(GtkLabel *self); +void yon_license_init(main_window *widgets); \ No newline at end of file diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 5a3b300..8085f29 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -232,6 +232,8 @@ NULL) #define ROOT_FORCE_CONFIGURATION_MODE_LABEL _("Warning! Application was launched without root. Only configuration mode is allowed.") #define PACKAGE_NOT_FOUND_LABEL _("Package were not found") #define PACKAGE_INFO_LABEL _("Package information") +#define LICENCE_AGREE_LABEL _("Yes, I agree to the License Agreement") +#define LICENCE_DISAGREE_LABEL _("No, i do not agree") // #define _LABEL _("Package:") // #define _LABEL _("Module:") // #define _LABEL _("New section at") diff --git a/ubinstall-gtk-source.glade b/ubinstall-gtk-source.glade index 1a3e61e..ac022cc 100644 --- a/ubinstall-gtk-source.glade +++ b/ubinstall-gtk-source.glade @@ -301,7 +301,7 @@ True False 2 - UBLinux installation + Source