From a3d5f2afe6fc0fcc2c1235f9841ce0919842ac66 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Thu, 26 Mar 2026 10:50:18 +0600 Subject: [PATCH] Added new db status buttons --- source/ubinstall-gtk-components.c | 2 + source/ubinstall-gtk-packages.c | 1 + source/ubinstall-gtk-users.c | 27 +++-- source/ubinstall-gtk.c | 16 +++ source/ubinstall-gtk.h | 10 ++ source/ubl-strings.h | 4 +- ubinstall-gtk.glade | 179 +++++++++++++++++++++++++++++- 7 files changed, 226 insertions(+), 13 deletions(-) diff --git a/source/ubinstall-gtk-components.c b/source/ubinstall-gtk-components.c index 31b59da..94c5416 100644 --- a/source/ubinstall-gtk-components.c +++ b/source/ubinstall-gtk-components.c @@ -466,6 +466,7 @@ gboolean yon_software_insert(struct row_data *row_input){ } void yon_software_init(main_window *widgets){ + on_status_update(NULL,widgets); if (!main_config.configure_mode){ yon_config_update_by_args(packages_parameter,NULL); } @@ -538,6 +539,7 @@ int yon_pacman_software_save(main_window *widgets){ } void yon_pacman_init(main_window *widgets){ + on_status_update(NULL,widgets); if (!main_config.configure_mode){ yon_config_update_by_args(packages_parameter,NULL); } diff --git a/source/ubinstall-gtk-packages.c b/source/ubinstall-gtk-packages.c index 3f5352b..64a7e5f 100644 --- a/source/ubinstall-gtk-packages.c +++ b/source/ubinstall-gtk-packages.c @@ -63,6 +63,7 @@ GtkTreeIter *yon_subcategory_check(GtkTreeStore *target, GtkTreeIter *parent_ite } void yon_packages_tab_init(main_window *widgets){ + on_status_update(NULL,widgets); if (!main_config.configure_mode){ yon_config_update_by_args(packages_parameter,NULL); } diff --git a/source/ubinstall-gtk-users.c b/source/ubinstall-gtk-users.c index df8239c..8b146c3 100644 --- a/source/ubinstall-gtk-users.c +++ b/source/ubinstall-gtk-users.c @@ -21,17 +21,22 @@ int yon_users_save(main_window *widgets){ GList *users = gtk_container_get_children(GTK_CONTAINER(widgets->UserAddBox)); GList *iter; - for (iter=users;iter;iter=iter->next){ - yon_user_struct *user = g_object_get_data(G_OBJECT(iter->data),"yon_user_struct"); - if (user){ - if (!yon_user_save(user)){ - yon_ubl_status_box_spawn(GTK_CONTAINER(main_config.status_box),_EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); - - return 0; + if (!users){ + yon_config_register(DEFAULTUSER_parameter,DEFAULTUSER_parameter_command,"root"); + } else { + for (iter=users;iter;iter=iter->next){ + yon_user_struct *user = g_object_get_data(G_OBJECT(iter->data),"yon_user_struct"); + if (user){ + if (!yon_user_save(user)){ + yon_ubl_status_box_spawn(GTK_CONTAINER(main_config.status_box),_EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + + return 0; + } } } - } + yon_config_remove_by_args(DEFAULTUSER_parameter); + } if (!main_config.configure_mode){ int users_size; config_str users = yon_config_get_all_keys_by_key(USERADD_parameter_search,&users_size); @@ -182,13 +187,17 @@ void yon_user_init(main_window *widgets){ int users_size; config_str users = yon_config_get_all_by_key(USERADD_parameter_search,&users_size); if (!users_size){ + char *default_user = config(DEFAULTUSER_parameter); + char *default_passwd = config(DEFAULTPASSWD_parameter); yon_user_struct *user = yon_user_struct_new(); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(user->AdminCheck),1); g_signal_connect(G_OBJECT(user->AdminCheck),"clicked",G_CALLBACK(yon_user_admin_check),widgets); g_object_set_data(G_OBJECT(user->MainBox),"widgets",widgets); gtk_box_pack_start(GTK_BOX(widgets->UserAddBox),user->MainBox,0,0,0); gtk_entry_set_text(GTK_ENTRY(user->UsernameEntry),ADMINISTRATOR_LABEL); - gtk_entry_set_text(GTK_ENTRY(user->LoginEntry),"superadmin"); + gtk_entry_set_text(GTK_ENTRY(user->LoginEntry),default_user); + gtk_entry_set_text(GTK_ENTRY(user->PasswordEntry),default_passwd); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(user->AdminCheck),1); } for (int i=0;iKernelPacmanStatusImage),inactive_icon_path,GTK_ICON_SIZE_BUTTON); gtk_image_set_from_icon_name(GTK_IMAGE(widgets->KernelAddonPacmanStatusImage),inactive_icon_path,GTK_ICON_SIZE_BUTTON); gtk_image_set_from_icon_name(GTK_IMAGE(widgets->PacmanSoftwareStatusImage),inactive_icon_path,GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name(GTK_IMAGE(widgets->AdditionalComponentsStatusImage),inactive_icon_path,GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name(GTK_IMAGE(widgets->PackagesStatusImage),inactive_icon_path,GTK_ICON_SIZE_BUTTON); gtk_label_set_text(GTK_LABEL(widgets->KernelPacmanStatusLabel),UNACCESSED_LABEL); gtk_label_set_text(GTK_LABEL(widgets->PacmanSoftwareStatusLabel),UNACCESSED_LABEL); gtk_label_set_text(GTK_LABEL(widgets->KernelAddonPacmanStatusLabel),UNACCESSED_LABEL); + gtk_label_set_text(GTK_LABEL(widgets->AdditionalComponentsStatusLabel),UNACCESSED_LABEL); + gtk_label_set_text(GTK_LABEL(widgets->PackagesStatusLabel),UNACCESSED_LABEL); } else { gtk_image_set_from_icon_name(GTK_IMAGE(widgets->KernelPacmanStatusImage),active_icon_path,GTK_ICON_SIZE_BUTTON); gtk_image_set_from_icon_name(GTK_IMAGE(widgets->KernelAddonPacmanStatusImage),active_icon_path,GTK_ICON_SIZE_BUTTON); gtk_image_set_from_icon_name(GTK_IMAGE(widgets->PacmanSoftwareStatusImage),active_icon_path,GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name(GTK_IMAGE(widgets->AdditionalComponentsStatusImage),active_icon_path,GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name(GTK_IMAGE(widgets->PackagesStatusImage),active_icon_path,GTK_ICON_SIZE_BUTTON); gtk_label_set_text(GTK_LABEL(widgets->KernelPacmanStatusLabel),ACCESSED_LABEL); gtk_label_set_text(GTK_LABEL(widgets->PacmanSoftwareStatusLabel),ACCESSED_LABEL); gtk_label_set_text(GTK_LABEL(widgets->KernelAddonPacmanStatusLabel),ACCESSED_LABEL); + gtk_label_set_text(GTK_LABEL(widgets->AdditionalComponentsStatusLabel),ACCESSED_LABEL); + gtk_label_set_text(GTK_LABEL(widgets->PackagesStatusLabel),ACCESSED_LABEL); } } @@ -516,6 +524,9 @@ void yon_main_window_create(main_window *widgets){ widgets->KeyboardScrollLockSwitch = yon_gtk_builder_get_widget(builder,"KeyboardScrollLockSwitch"); widgets->KeyboardNumLockCombo = yon_gtk_builder_get_widget(builder,"KeyboardNumLockCombo"); + widgets->AdditionalComponentsStatusImage = yon_gtk_builder_get_widget(builder,"AdditionalComponentsStatusImage"); + widgets->AdditionalComponentsStatusLabel = yon_gtk_builder_get_widget(builder,"AdditionalComponentsStatusLabel"); + widgets->AdditionalComponentsStatusButton = yon_gtk_builder_get_widget(builder,"AdditionalComponentsStatusButton"); 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"); @@ -608,6 +619,9 @@ void yon_main_window_create(main_window *widgets){ widgets->AutoHostnameCheck=yon_gtk_builder_get_widget(builder,"AutoHostnameCheck"); widgets->AdvancedVirtualDeviceLabel = yon_gtk_builder_get_widget(builder,"AdvancedVirtualDeviceLabel"); + widgets->PackagesStatusImage = yon_gtk_builder_get_widget(builder,"PackagesStatusImage"); + widgets->PackagesStatusLabel = yon_gtk_builder_get_widget(builder,"PackagesStatusLabel"); + widgets->PackagesStatusButton = yon_gtk_builder_get_widget(builder,"PackagesStatusButton"); widgets->PackagesTree = yon_gtk_builder_get_widget(builder,"PackagesTree"); widgets->PackagesChosenCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"PackagesChosenCell")); widgets->PackagesList = GTK_TREE_STORE(gtk_builder_get_object(builder,"Packages")); @@ -645,6 +659,8 @@ void yon_main_window_create(main_window *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); + g_signal_connect(G_OBJECT(widgets->PackagesStatusButton),"clicked",G_CALLBACK(on_status_update),widgets); + g_signal_connect(G_OBJECT(widgets->AdditionalComponentsStatusButton),"clicked",G_CALLBACK(on_status_update),widgets); g_signal_connect(G_OBJECT(widgets->KernelPacmanStatusButton),"clicked",G_CALLBACK(on_status_update),widgets); g_signal_connect(G_OBJECT(widgets->KernelAddonPacmanStatusButton),"clicked",G_CALLBACK(on_status_update),widgets); g_signal_connect(G_OBJECT(widgets->PacmanSoftwareStatusButton),"clicked",G_CALLBACK(on_status_update),widgets); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index d50b76c..a9a9c41 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -267,6 +267,10 @@ layout && /description:/ {\ #define finish_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[finish]" #define admuid_parameter "ADMUID" #define admuid_parameter_command "ubconfig --source global get [users] ADMUID" +#define DEFAULTUSER_parameter "AUTOINSTALL[ubconfig set [users] DEFAULTUSER]" +#define DEFAULTUSER_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL['ubconfig set [users] DEFAULTUSER']" +#define DEFAULTPASSWD_parameter "AUTOINSTALL[ubconfig set [users] DEFAULTPASSWD]" +#define DEFAULTPASSWD_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL['ubconfig set [users] DEFAULTPASSWD']" #define SYSTEM_LANG_parameter "AUTOINSTALL['ubconfig set [locale] LANG']" #define SYSTEM_LANG_parameter_command "ubconfig --source global get autoinstall AUTOINSTALL['ubconfig set [locale] LANG']" @@ -628,6 +632,9 @@ typedef struct GtkWidget *AboutMenuItem; GtkWidget *DocumentationMenuItem; + GtkWidget *AdditionalComponentsStatusImage; + GtkWidget *AdditionalComponentsStatusLabel; + GtkWidget *AdditionalComponentsStatusButton; GtkWidget *AdditionalComponentsList; GtkWidget *AdditionalComponentsOverallSizeLabel; GtkWidget *AdditionalComponentsUncheckAllCheck; @@ -801,6 +808,9 @@ typedef struct GtkWidget *PrevInstallationSliderImage; GtkWidget *NextInstallationSliderImage; + GtkWidget *PackagesStatusImage; + GtkWidget *PackagesStatusLabel; + GtkWidget *PackagesStatusButton; GtkTreeStore *PackagesList; GtkCellRenderer *PackagesChosenCell; GtkWidget *PackagesTree; diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 3d93fd7..2649b8b 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -151,8 +151,8 @@ NULL) #define CONFIGURATION_SAVE_LABEL _("You can safely exit configurator or return and create new configuration file.") #define SCROLL_TO_END_LABEL _("Scroll to the end") -#define ADMINISTRATOR_LABEL _("Empty default user") -// #define ADMINISTRATOR_LABEL _("Administrator") +// #define ADMINISTRATOR_LABEL _("Empty default user") +#define ADMINISTRATOR_LABEL _("Administrator") #define DEFAULT_LOCALES_LABEL _("English, U.S.A.; Russian, Russia") #define READ_INSTALL_LOG_LABEL _("Read installation log") diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 402dced..d38df19 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -602,6 +602,16 @@ False com.ublinux.libublsettingsui-gtk3.sync-symbolic + + True + False + com.ublinux.libublsettingsui-gtk3.sync-symbolic + + + True + False + com.ublinux.libublsettingsui-gtk3.sync-symbolic + True False @@ -3381,6 +3391,72 @@ Select a different installation source. 0 + + + True + False + 5 + + + True + False + Repository status: + + + False + True + 0 + + + + + True + False + + + + False + True + 1 + + + + + True + False + Accessed + + + False + True + 2 + + + + + True + True + True + image46 + + + + False + True + 3 + + + + + False + True + 1 + + True @@ -3442,7 +3518,7 @@ Select a different installation source. True True - 1 + 2 @@ -3509,7 +3585,7 @@ Select a different installation source. False True - 2 + 3 @@ -7265,6 +7341,72 @@ Select a different installation source. 0 + + + True + False + 5 + + + True + False + Repository status: + + + False + True + 0 + + + + + True + False + + + + False + True + 1 + + + + + True + False + Accessed + + + False + True + 2 + + + + + True + True + True + image47 + + + + False + True + 3 + + + + + False + True + 1 + + True @@ -8655,6 +8797,9 @@ or continue working in the system Live environment. True DevicesList 0 + + + Device @@ -8755,6 +8900,9 @@ or continue working in the system Live environment. True PartitionsList 0 + + + Section @@ -9413,6 +9561,9 @@ or continue working in the system Live environment. True DevicesList 0 + + + Device @@ -9513,6 +9664,9 @@ or continue working in the system Live environment. True PartitionsList 0 + + + Section @@ -10175,6 +10329,9 @@ separately into the selected partition. True DevicesList 0 + + + @@ -10293,6 +10450,9 @@ separately into the selected partition. True PartitionsList 0 + + + @@ -11680,6 +11840,9 @@ separately into the selected partition. True DevicesList 0 + + + Device @@ -11780,6 +11943,9 @@ separately into the selected partition. True PartitionsList 0 + + + Section @@ -12134,6 +12300,9 @@ separately into the selected partition. True DevicesList 0 + + + Device @@ -12234,6 +12403,9 @@ separately into the selected partition. True PartitionsList 0 + + + Section @@ -12581,6 +12753,9 @@ separately into the selected partition. True DevicesList 0 + + + Device