diff --git a/locale/ubinstall-gtk.pot b/locale/ubinstall-gtk.pot index 147cc43..9f20241 100644 --- a/locale/ubinstall-gtk.pot +++ b/locale/ubinstall-gtk.pot @@ -5324,4 +5324,8 @@ msgstr "" #: source/libublsettingsui-gtk3.h:675 msgid "Grant root access" +msgstr "" + +#: source/libublsettingsui-gtk3.h:675 +msgid "Uncheck all" msgstr "" \ No newline at end of file diff --git a/locale/ubinstall-gtk_ru.po b/locale/ubinstall-gtk_ru.po index 2042adb..03348b7 100644 --- a/locale/ubinstall-gtk_ru.po +++ b/locale/ubinstall-gtk_ru.po @@ -5519,4 +5519,8 @@ msgstr "Вьетнамский (Франция)" #: source/libublsettingsui-gtk3.h:675 msgid "Grant root access" -msgstr "Предоставить root-доступ" \ No newline at end of file +msgstr "Предоставить root-доступ" + +#: source/libublsettingsui-gtk3.h:675 +msgid "Uncheck all" +msgstr "Снять всё" \ No newline at end of file diff --git a/source/ubinstall-gtk-components.c b/source/ubinstall-gtk-components.c index 0b1f27a..88d724c 100644 --- a/source/ubinstall-gtk-components.c +++ b/source/ubinstall-gtk-components.c @@ -308,6 +308,24 @@ void yon_os_components_init(main_window *widgets){ } } +void on_software_uncheck_all(GtkWidget *, main_window *widgets){ + int active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->AdditionalComponentsUncheckAllCheck)); + switch(active){ + case 1:{ + GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->AdditionalComponentsList)); + GList *iter; + for(iter = list;iter;iter=iter->next){ + os_row *row = g_object_get_data(iter->data,"kernel_row"); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(row->InstallCheck),0); + } + } break; + } + gtk_widget_hide(widgets->AdditionalComponentsUncheckAllCheck); + g_signal_handlers_block_by_func(G_OBJECT(widgets->AdditionalComponentsUncheckAllCheck),on_software_uncheck_all,widgets); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AdditionalComponentsUncheckAllCheck),0); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->AdditionalComponentsUncheckAllCheck),on_software_uncheck_all,widgets); +} + int yon_software_save(main_window *widgets){ GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->AdditionalComponentsList)); GList *iter; @@ -355,6 +373,7 @@ int yon_software_check_packages_size(GtkWidget *, main_window *widgets){ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(row->InstallCheck))){ long cur_size = yon_packages_get_installed_size(YON_PACKAGES_ALL,row->name); pacman_size += cur_size; + gtk_widget_show(widgets->AdditionalComponentsUncheckAllCheck); } } } diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index b9399bd..a2c1fb9 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -517,6 +517,7 @@ void yon_main_window_create(main_window *widgets){ widgets->AdditionalComponentsList = yon_gtk_builder_get_widget(builder,"AdditionalComponentsList"); widgets->AdditionalComponentsOverallSizeLabel = yon_gtk_builder_get_widget(builder,"AdditionalComponentsOverallSizeLabel"); + widgets->AdditionalComponentsUncheckAllCheck = yon_gtk_builder_get_widget(builder,"AdditionalComponentsUncheckAllCheck"); widgets->InstallationProgress = yon_gtk_builder_get_widget(builder,"InstallationProgress"); widgets->InstallationLabel = yon_gtk_builder_get_widget(builder,"InstallationLabel"); @@ -700,7 +701,7 @@ void yon_main_window_create(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->SamePlaceDeviceTree),"cursor-changed",G_CALLBACK(on_device_selection_changed),widgets); g_signal_connect(G_OBJECT(widgets->UserdataDevicesTree),"cursor-changed",G_CALLBACK(on_device_selection_changed),widgets); - + g_signal_connect(G_OBJECT(widgets->AdditionalComponentsUncheckAllCheck),"toggled",G_CALLBACK(on_software_uncheck_all),widgets); // g_signal_connect(G_OBJECT(gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(widgets->NextInstallationSizeSpin))),"value-changed",G_CALLBACK(yon_size_changed),widgets); g_signal_connect(G_OBJECT(widgets->NextInstallationSizeSpin),"value-changed",G_CALLBACK(yon_size_changed),widgets); g_signal_connect(G_OBJECT(widgets->UserdataFormatSizeSpin),"value-changed",G_CALLBACK(yon_size_changed),widgets); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index c8e6d68..0998cbf 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -623,6 +623,7 @@ typedef struct GtkWidget *AdditionalComponentsList; GtkWidget *AdditionalComponentsOverallSizeLabel; + GtkWidget *AdditionalComponentsUncheckAllCheck; GtkWidget *GrubInstallRadio; GtkWidget *GrubUpdateRadio; @@ -1574,4 +1575,5 @@ void yon_user_admin_check(GtkWidget *self, main_window *widgets); void yon_gtk_widget_set_translation(GtkWidget *target); void on_bootloader_user_edit(GtkWidget *, main_window *widgets); void on_bootloader_admin_toggled(GtkWidget *, char *path, main_window *widgets); -void on_bootloader_user_remove(GtkWidget *, main_window *widgets); \ No newline at end of file +void on_bootloader_user_remove(GtkWidget *, main_window *widgets); +void on_software_uncheck_all(GtkWidget *, main_window *widgets); \ No newline at end of file diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 81240a6..cfecdff 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -141,6 +141,7 @@ NULL) #define ERROR_LABEL _("Error has occured while installation process") #define LOG_VIEW_LABEL _("Log exploration") +#define UNCHECK_ALL_LABEL _("Uncheck all") #define CONFIGURATION_TITLE_LABEL _("Configuration") #define CONFIGURATION_FINISH_HEAD_LABEL _("Installer configuration has been finished") diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index ca8bbe7..1dc74a9 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -3300,6 +3300,19 @@ Select a different installation source. True False 5 + + + Uncheck all + True + False + True + + + False + True + 0 + + True