From a21a886e502d2ce8d8917044dbb71c23c3d35151 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Tue, 7 Apr 2026 11:07:04 +0600 Subject: [PATCH 1/6] Added package information to package/modules information windows --- source/ubinstall-gtk-components.c | 11 ++++-- source/ubinstall-gtk-kernel.c | 17 +++++---- source/ubinstall-gtk-packages.c | 18 ++++++++-- source/ubinstall-gtk-startup-apps.c | 2 +- source/ubinstall-gtk-startup-services.c | 2 +- source/ubinstall-gtk-ui-lang.c | 6 ++++ source/ubinstall-gtk.c | 46 +++++++++++++++++++++++++ source/ubinstall-gtk.h | 16 ++++++++- source/ubl-strings.h | 1 + 9 files changed, 103 insertions(+), 16 deletions(-) diff --git a/source/ubinstall-gtk-components.c b/source/ubinstall-gtk-components.c index 9bfe3e0..67fd321 100644 --- a/source/ubinstall-gtk-components.c +++ b/source/ubinstall-gtk-components.c @@ -40,7 +40,6 @@ int yon_kernel_save(main_window *widgets){ if (!main_config.configure_mode){ yon_debug_output("%s\n",yon_config_save_args_simple(main_config.config_load_path,packages_parameter, KERNEL_BOOT_parameter,NULL)); } - return 1; } @@ -181,6 +180,10 @@ int yon_os_components_save(main_window *widgets){ return 1; } +void on_os_components_info(GtkWidget *, char *, os_row *row){ + yon_package_info_window_create(row->modules); +} + os_row *yon_os_row_new(){ os_row *row = new(os_row); GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_os_row); @@ -196,6 +199,7 @@ os_row *yon_os_row_new(){ row->modules=NULL; row->version=NULL; + g_signal_connect(G_OBJECT(row->NameLabel),"activate-link",G_CALLBACK(on_os_components_info),row); row->row = yon_gtk_builder_get_widget(builder,"MainRow"); gtk_widget_show(row->row); @@ -242,6 +246,7 @@ void *yon_modules_list_load(main_window *widgets){ void yon_os_row_setup(os_row *row, char *name, char *version,char *tags, char *description,char *source, char *size){ row->name = yon_char_new(name); row->source = yon_char_new(source); + row->modules = yon_char_new(name); char *description_full = yon_char_new(description); if (yon_char_is_empty(source)||yon_char_check_begins_with(source,"(local)/")){ @@ -250,7 +255,8 @@ void yon_os_row_setup(os_row *row, char *name, char *version,char *tags, char *d gtk_label_set_text(GTK_LABEL(row->SourceLabel),source); } - gtk_label_set_label(GTK_LABEL(row->NameLabel),name); + char *label_markup = yon_char_unite("",name,"",NULL); + gtk_label_set_markup(GTK_LABEL(row->NameLabel),label_markup); gtk_label_set_label(GTK_LABEL(row->VersionLabel),version); gtk_label_set_label(GTK_LABEL(row->DescriptionLabel),description_full); gtk_label_set_label(GTK_LABEL(row->SizeLabel),size); @@ -258,6 +264,7 @@ void yon_os_row_setup(os_row *row, char *name, char *version,char *tags, char *d yon_kernel_row_setup_tags((kernel_row*)row,tags); free(size); free(description_full); + free(label_markup); } gboolean yon_os_component_insert(struct row_data *row_input){ diff --git a/source/ubinstall-gtk-kernel.c b/source/ubinstall-gtk-kernel.c index 657f854..1ea1886 100644 --- a/source/ubinstall-gtk-kernel.c +++ b/source/ubinstall-gtk-kernel.c @@ -18,6 +18,10 @@ gboolean on_kernel_enabled_toggled(GtkWidget *self, GdkEventButton *, kernel_row return 0; } +void on_kernel_info(GtkWidget *, char *, kernel_row *row){ + yon_package_info_window_create(row->package); +} + kernel_row *yon_kernel_row_new(){ kernel_row *row = new(kernel_row); GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_kernel_row); @@ -37,6 +41,7 @@ kernel_row *yon_kernel_row_new(){ g_signal_connect(G_OBJECT(row->InstallCheck),"toggled",G_CALLBACK(on_kernel_install_enabled),row); g_signal_connect(G_OBJECT(row->EnableRadio),"button-release-event",G_CALLBACK(on_kernel_enabled_toggled),row); + g_signal_connect(G_OBJECT(row->NameLabel),"activate-link",G_CALLBACK(on_kernel_info),row); row->row = gtk_list_box_row_new(); gtk_container_add(GTK_CONTAINER(row->row),row->RowBox); @@ -117,13 +122,15 @@ void yon_kernel_row_setup(kernel_row *row, char *name, char *modules,char *packa yon_char_parsed_free(description_wrapped,size); } char *modules_parsed = yon_char_replace(modules," ","\n"); - gtk_label_set_label(GTK_LABEL(row->NameLabel),name); + char *label_markup = yon_char_unite("",name,"",NULL); + gtk_label_set_markup(GTK_LABEL(row->NameLabel),label_markup); gtk_label_set_label(GTK_LABEL(row->ModulesLabel),modules_parsed); gtk_label_set_label(GTK_LABEL(row->DescriptionLabel),description_full); yon_kernel_row_setup_tags(row,tags); free(description_full); free(modules_parsed); + free(label_markup); } void yon_kernel_resize(main_window *widgets){ @@ -262,7 +269,6 @@ void on_kernel_addon_install_enabled(GtkWidget *, kernel_addon_row *row){ } } -void yon_gtk_label_set_font(GtkLabel *label); void yon_gtk_label_set_font(GtkLabel *label){ g_return_if_fail(GTK_IS_LABEL(label)); PangoAttrList *attributes = pango_attr_list_new(); @@ -273,13 +279,6 @@ void yon_gtk_label_set_font(GtkLabel *label){ gtk_label_set_attributes(GTK_LABEL(label),attributes); } -typedef struct { - GtkWidget *MainBox; - GtkWidget *InfoTree; - GtkListStore *InfoList; -} info_element; - -info_element *yon_package_info_element_new(); info_element *yon_package_info_element_new(){ info_element *element = malloc(sizeof(info_element)); memset(element,0,sizeof(info_element)); diff --git a/source/ubinstall-gtk-packages.c b/source/ubinstall-gtk-packages.c index cb2bfaa..cfc79a7 100644 --- a/source/ubinstall-gtk-packages.c +++ b/source/ubinstall-gtk-packages.c @@ -66,6 +66,20 @@ GtkTreeIter *yon_subcategory_check(GtkTreeStore *target, GtkTreeIter *parent_ite return ret_iter; } +void on_software_info(GtkWidget*, main_window *widgets){ + char *packages; + GtkTreeIter iter; + GtkTreeModel *model; + gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->PackagesTree)),&model,&iter); + gtk_tree_model_get(GTK_TREE_MODEL(widgets->PackagesList),&iter,5,&packages,-1); + int size=0; + config_str parsed = yon_char_parse(packages,&size,","); + for (int i=0;iPackagesList,&subcatiter,category_iter); - gtk_tree_store_set(widgets->PackagesList,&subcatiter,1,parsed[1],2,_(parsed[3]),3,0,-1); + gtk_tree_store_set(widgets->PackagesList,&subcatiter,1,parsed[1],2,_(parsed[1]),3,0,-1); gtk_tree_store_append(widgets->PackagesList,&package_iter,&subcatiter); char *full_string = yon_char_unite("",name_render,"\n",_(parsed[3]),NULL); gtk_tree_store_set(widgets->PackagesList,&package_iter,0,!!yon_char_check_elements(config_packages,parsed[2],",")||yon_char_check_elements(modules,parsed[2],","),1,parsed[2],2,full_string,3,1,4,!yon_char_check_elements(modules,parsed[2],","),5,parsed[2],-1); @@ -150,7 +164,7 @@ void yon_packages_tab_init(main_window *widgets){ gtk_tree_store_set(widgets->PackagesList,&subcategory_iter,1,parsed[1],2,_(parsed[1]),3,0,-1); gtk_tree_store_append(widgets->PackagesList,&package_iter,&subcategory_iter); char *full_string = yon_char_unite("",name_render,"\n",_(parsed[3]),NULL); - gtk_tree_store_set(widgets->PackagesList,&package_iter,0,!!yon_char_check_elements(config_packages,parsed[2],",")||yon_char_check_elements(modules,parsed[2],","),1,parsed[2],2,full_string,3,1,4,!yon_char_check_elements(modules,parsed[2],","),-1); + gtk_tree_store_set(widgets->PackagesList,&package_iter,0,!!yon_char_check_elements(config_packages,parsed[2],",")||yon_char_check_elements(modules,parsed[2],","),1,parsed[2],2,full_string,3,1,4,!yon_char_check_elements(modules,parsed[2],","),5,parsed[2],-1); free(full_string); } else { GtkTreeIter package_iter; diff --git a/source/ubinstall-gtk-startup-apps.c b/source/ubinstall-gtk-startup-apps.c index 9549a1b..4150a6f 100644 --- a/source/ubinstall-gtk-startup-apps.c +++ b/source/ubinstall-gtk-startup-apps.c @@ -51,7 +51,7 @@ void yon_startup_apps_init(main_window *widgets){ config_str apps_ret = yon_resource_open_file(apps_list_path,&size); apps_ret = yon_char_parsed_rip(apps_ret,&size,0); if (!size) return; - qsort(apps_ret,(size_t)size,sizeof(char *),(__compar_fn_t)yon_char_parsed_compare); + // qsort(apps_ret,(size_t)size,sizeof(char *),(__compar_fn_t)yon_char_parsed_compare); for (int i=0;iConfigurationModeMenuItem),"Label")); list = g_slist_append(list,g_object_get_data(G_OBJECT(widgets->EnableVNCMenuItem),"Label")); list = g_slist_append(list,g_object_get_data(G_OBJECT(widgets->EnableRDPMenuItem),"Label")); + dictionary *diter = NULL; + for_dictionaries (diter,widgets->PackagesMenu->buttons){ + GtkWidget *label = g_object_get_data(G_OBJECT(diter->data),"Label"); + list = g_slist_append(list,label); + } GSList *iter; for (iter = list; iter; iter = iter->next){ @@ -380,4 +385,5 @@ void yon_update_translation(main_window *widgets){ g_list_free(list); g_list_free(container); } + } \ No newline at end of file diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index bc256c4..ee6d7cf 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -7,6 +7,46 @@ void yon_license_init(main_window *widgets){ gtk_widget_set_sensitive(widgets->NextButton,0); } +yon_window *yon_package_info_window_create(const char *package_str){ + if (yon_char_is_empty(package_str)) return NULL; + yon_window *window = yon_window_new(); + yon_gtk_window_setup(GTK_WINDOW(window->Window),NULL,PACKAGE_INFO_LABEL,icon_path,"info-label"); + int size=0; + char *package = yon_char_new(package_str); + if (strstr(package,",")){ + char *temp = yon_char_replace(package,","," "); + free(package); + package = temp; + } + + GtkWidget *label = NULL; + yon_packages_info *info_struct = yon_packages_get_info_struct(YON_PACKAGES_ALL,package); + if (!info_struct) return NULL; + char* info_string = yon_packages_get_info_string(info_struct); + config_str info = yon_char_parse(info_string,&size,"\n"); + if (size>0){ + info_element *element = yon_package_info_element_new(); + gtk_box_pack_start(GTK_BOX(window->MainBox),element->MainBox,1,1,0); + for (int i=0;iInfoList,&iter); + gtk_list_store_set(element->InfoList,&iter,0,parsed[0],1,!yon_char_is_empty(parsed[1])?_(parsed[1]):"",-1); + + } + } else { + label = gtk_label_new(PACKAGE_NOT_FOUND_LABEL); + yon_gtk_label_set_font(GTK_LABEL(label)); + gtk_widget_show(label); + gtk_box_pack_start(GTK_BOX(window->MainBox),label,0,0,0); + gtk_label_set_xalign(GTK_LABEL(label),0); + } + gtk_widget_show(window->Window); + return window; +} + double yon_password_check_func(yon_password_window *window, const char *password_string){ pwquality_settings_t *settings = pwquality_default_settings(); int strength = pwquality_check(settings,password_string,NULL,NULL,NULL); @@ -904,6 +944,12 @@ void yon_main_window_create(main_window *widgets){ yon_root_button_init(widgets->root_button,GTK_WINDOW(widgets->MainWindow)); } + widgets->PackagesMenu = yon_rmb_menu_setup(widgets->PackagesTree,NULL,NULL,INFO_LABEL,info_icon_path,G_CALLBACK(on_software_info),widgets,NULL); + + dictionary *iter = NULL; + for_dictionaries (iter,widgets->PackagesMenu->buttons){ + yon_gtk_widget_set_translation(g_object_get_data(G_OBJECT(iter->data),"Label")); + } yon_startup_language_init(); yon_locale_init(); yon_main_window_update_locale(widgets); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index fbe142a..f106171 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -49,6 +49,7 @@ #define add_icon_path "com.ublinux.libublsettingsui-gtk3.increase-symbolic" #define active_icon_path "com.ublinux.libublsettingsui-gtk3.active-symbolic" #define inactive_icon_path "com.ublinux.libublsettingsui-gtk3.inactive-symbolic" +#define info_icon_path "com.ublinux.libublsettingsui-gtk3.important-symbolic" #define LocalePath "/usr/share/locale" #define LocaleName "ubinstall-gtk" @@ -826,6 +827,7 @@ typedef struct GtkTreeStore *PackagesList; GtkCellRenderer *PackagesChosenCell; GtkWidget *PackagesTree; + rmb_menu_window *PackagesMenu; // Configuration hub slide section GtkWidget *ConfigHubRebootCombo; @@ -1227,6 +1229,12 @@ typedef struct GtkWidget *TextLabel; } slider_object; +typedef struct { + GtkWidget *MainBox; + GtkWidget *InfoTree; + GtkListStore *InfoList; +} info_element; + void config_init(); main_window *yon_main_window_complete(); ubinstall_language_window *yon_ubinstall_language_new(); @@ -1621,4 +1629,10 @@ gboolean on_kernel_addon_menu_block(GObject *self, GdkEventButton *event); void on_os_components_uncheck_all(GtkWidget *,main_window *widgets); gboolean yon_os_components_load(main_window *widgets); gboolean on_user_autoloin_switch(GtkWidget *, int status, main_window *); -void on_locale_selected(GtkTreeView *self,main_window *widgets); \ No newline at end of file +void on_locale_selected(GtkTreeView *self,main_window *widgets); +yon_window *yon_package_info_window_create(const char *package); +info_element *yon_package_info_element_new(); +void yon_gtk_label_set_font(GtkLabel *label); +void on_kernel_info(GtkWidget *, char *link, kernel_row *row); +void on_os_components_info(GtkWidget *, char *, os_row *row); +void on_software_info(GtkWidget*, main_window *widgets); \ No newline at end of file diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 7ab8b9e..eb3aa7f 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -303,6 +303,7 @@ NULL) #define EDIT_USER_LABEL _("Edit user") #define ACCESSED_LABEL _("Accessed") #define UNACCESSED_LABEL _("Unaccessed") +#define INFO_LABEL _("Package information") // #define _LABEL _("Chosen size:") // #define _LABEL _("Overall size:") From d6de60e97571e57c561a35f2e93c0c8472a95e66 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Tue, 7 Apr 2026 13:52:07 +0600 Subject: [PATCH 2/6] It is possible to run one installer by user at a time --- locale/ubinstall-gtk.pot | 3 +++ locale/ubinstall-gtk_ru.po | 5 ++++- source/ubinstall-gtk.c | 23 +++++++++++++++++++++++ source/ubinstall-gtk.h | 1 + source/ubl-strings.h | 1 + 5 files changed, 32 insertions(+), 1 deletion(-) diff --git a/locale/ubinstall-gtk.pot b/locale/ubinstall-gtk.pot index 07fa82d..ed7007c 100644 --- a/locale/ubinstall-gtk.pot +++ b/locale/ubinstall-gtk.pot @@ -5351,4 +5351,7 @@ msgid "Uncheck all" msgstr "" msgid "Close installer" +msgstr "" + +msgid "Application is already running" msgstr "" \ No newline at end of file diff --git a/locale/ubinstall-gtk_ru.po b/locale/ubinstall-gtk_ru.po index 37bd888..f561ea7 100644 --- a/locale/ubinstall-gtk_ru.po +++ b/locale/ubinstall-gtk_ru.po @@ -5546,4 +5546,7 @@ msgid "Uncheck all" msgstr "Снять всё" msgid "Close installer" -msgstr "Закрыть установщик" \ No newline at end of file +msgstr "Закрыть установщик" + +msgid "Application is already running" +msgstr "Приложение уже запущено" \ No newline at end of file diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index ee6d7cf..d0bc006 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -1028,6 +1028,10 @@ main_window *yon_main_window_complete(){ } int main(int argc, char *argv[]){ + GApplication *app = (GApplication*)gtk_application_new("com.ublinux.ubinstall-gtk",G_APPLICATION_DEFAULT_FLAGS); + GError *err = NULL; + int reg = g_application_register(app,NULL,&err); + int remote = g_application_get_is_remote(app); main_config.argv=argv; main_config.argc = argc; config_str unfound = NULL; @@ -1037,6 +1041,25 @@ int main(int argc, char *argv[]){ textdomain(LocaleName); config_init(); gtk_init(&argc,&argv); + + if (!reg||remote){ + yon_window *window = yon_window_new(); + gtk_widget_set_size_request(window->Window,300,125); + yon_gtk_window_setup(GTK_WINDOW(window->Window),NULL,WARNING_TITLE_LABEL,icon_path,NULL); + GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,5); + GtkWidget *image = gtk_image_new(); + GtkWidget *label = gtk_label_new(ALREADY_RUNNING_LABEL); + gtk_image_set_from_icon_name(GTK_IMAGE(image),warning_icon_path,0); + gtk_image_set_pixel_size(GTK_IMAGE(image),48); + gtk_box_pack_start(GTK_BOX(box),image,1,1,0); + gtk_box_pack_start(GTK_BOX(box),label,1,1,0); + gtk_box_pack_start(GTK_BOX(window->MainBox),box,1,1,0); + gtk_widget_show_all(box); + g_signal_connect(G_OBJECT(window->Window),"destroy",G_CALLBACK(gtk_main_quit),NULL); + gtk_widget_show(window->Window); + gtk_main(); + exit(1); + } yon_ubl_window_init(TITLE_LABEL,"",LocaleName,CssPath,LocaleName,version_application,WIKI_LINK); yon_ubl_setup_arguments(argc,argv,&unfound,&size,ADDITIONAL_ARGS); if (size) { diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index f106171..528e95f 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -50,6 +50,7 @@ #define active_icon_path "com.ublinux.libublsettingsui-gtk3.active-symbolic" #define inactive_icon_path "com.ublinux.libublsettingsui-gtk3.inactive-symbolic" #define info_icon_path "com.ublinux.libublsettingsui-gtk3.important-symbolic" +#define warning_icon_path "com.ublinux.libublsettingsui-gtk3.warning-symbolic" #define LocalePath "/usr/share/locale" #define LocaleName "ubinstall-gtk" diff --git a/source/ubl-strings.h b/source/ubl-strings.h index eb3aa7f..7d6d5dc 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -304,6 +304,7 @@ NULL) #define ACCESSED_LABEL _("Accessed") #define UNACCESSED_LABEL _("Unaccessed") #define INFO_LABEL _("Package information") +#define ALREADY_RUNNING_LABEL _("Application is already running") // #define _LABEL _("Chosen size:") // #define _LABEL _("Overall size:") From 40f1b0203bc26a018618de1b8ac38de6d5f45048 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Tue, 7 Apr 2026 14:43:13 +0600 Subject: [PATCH 3/6] Fixed advanced add button was always shown --- source/ubinstall-gtk-advanced.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/ubinstall-gtk-advanced.c b/source/ubinstall-gtk-advanced.c index 803164e..82b934f 100644 --- a/source/ubinstall-gtk-advanced.c +++ b/source/ubinstall-gtk-advanced.c @@ -46,6 +46,7 @@ void on_advanced_part_remove_part(GtkWidget *self, main_window *widgets){ if (data->partition&&!strcmp(data->partition,target)){ gtk_list_store_set(widgets->PartitionsList,&iter,7,0,-1); free(part); + gtk_widget_show(widgets->AdvancedAddButton); } } } @@ -61,6 +62,7 @@ void on_advanced_part_remove_device(GtkWidget *self, main_window *widgets){ if (!strcmp(data->device,target)){ gtk_widget_destroy(part->MainBox); free(part); + gtk_widget_show(widgets->AdvancedAddButton); } } } @@ -291,6 +293,11 @@ int yon_advanced_part_check_count(main_window *widgets){ GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->AdvancedPartitionAddBox)); int len = g_list_length(list); g_list_free(list); + if (len<1) { + gtk_widget_show(widgets->AdvancedAddButton); + } else { + gtk_widget_hide(widgets->AdvancedAddButton); + } if (len<2) return 1; return 0; } From 3114b6d07e68d06af1310ff95274c8025ae10f52 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Tue, 7 Apr 2026 15:31:38 +0600 Subject: [PATCH 4/6] Fixed region removing --- source/ubinstall-gtk-region.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/source/ubinstall-gtk-region.c b/source/ubinstall-gtk-region.c index e335b74..4437408 100644 --- a/source/ubinstall-gtk-region.c +++ b/source/ubinstall-gtk-region.c @@ -13,11 +13,15 @@ int yon_region_save(main_window *widgets){ yon_ubl_status_highlight_incorrect(widgets->ZoneCombo); return 0; } - const char *region = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->RegionCombo)); - const char *zone = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->ZoneCombo)); - char *final = yon_char_unite(region,"/",zone,NULL); - yon_config_register(zone_parameter,zone_parameter_command,final); - free(final); + if (gtk_switch_get_active(GTK_SWITCH(widgets->RegionSensitiveSwitch))){ + const char *region = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->RegionCombo)); + const char *zone = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->ZoneCombo)); + char *final = yon_char_unite(region,"/",zone,NULL); + yon_config_register(zone_parameter,zone_parameter_command,final); + free(final); + } else { + yon_config_remove_by_key(zone_parameter); + } if (!main_config.configure_mode){ yon_debug_output("%s\n",yon_config_save_args_simple(main_config.config_load_path,zone_parameter,NULL)); } From 97a163f4bb47a8096f9eaa3f83962b34e920239d Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Tue, 7 Apr 2026 15:31:59 +0600 Subject: [PATCH 5/6] Fixed documentation confirmation window title --- source/ubinstall-gtk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index d0bc006..6c9a88a 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -86,8 +86,8 @@ void on_open_documentation_confirmation(GtkWidget *self, char *link){ window->CloseButton = yon_gtk_builder_get_widget(builder,"CancelHelpButton"); window->HeaderLabel = yon_gtk_builder_get_widget(builder,"webHeaderNameLabel"); window->AlwaysOpenCheck = yon_gtk_builder_get_widget(builder,"AlwaysOpenDocumentationCheckbox"); - gtk_label_set_text(GTK_LABEL(window->HeaderLabel),TITLE_LABEL); - gtk_window_set_title(GTK_WINDOW(window->Window),TITLE_LABEL); + gtk_label_set_text(GTK_LABEL(window->HeaderLabel),DOCUMENTATION_LABEL); + gtk_window_set_title(GTK_WINDOW(window->Window),DOCUMENTATION_LABEL); gtk_window_set_icon_name(GTK_WINDOW(window->Window),yon_char_append("com.ublinux.",LocaleName)); gtk_widget_show_all(window->Window); g_signal_connect(G_OBJECT(window->CloseButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); From 66e1593fed9d699f9c821305d4bed5f9d40404ec Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Tue, 7 Apr 2026 18:37:50 +0600 Subject: [PATCH 6/6] Fixed crash --- locale/ubinstall-gtk.pot | 5 ++++- locale/ubinstall-gtk_ru.po | 9 ++++++--- source/ubinstall-gtk-components.c | 16 +++++++++++++--- source/ubinstall-gtk-page-switch.c | 6 +++--- source/ubinstall-gtk-region.c | 12 ------------ source/ubinstall-gtk.c | 1 + source/ubinstall-gtk.h | 4 +++- source/ubl-strings.h | 3 ++- ubinstall-gtk-os-row.glade | 23 +++++++++++++++-------- ubinstall-gtk-source.glade | 4 ++-- ubinstall-gtk.glade | 11 +++++------ 11 files changed, 54 insertions(+), 40 deletions(-) diff --git a/locale/ubinstall-gtk.pot b/locale/ubinstall-gtk.pot index ed7007c..faa09e2 100644 --- a/locale/ubinstall-gtk.pot +++ b/locale/ubinstall-gtk.pot @@ -1947,7 +1947,7 @@ msgid "" "network or the Internet (even over slow connection channels)." msgstr "" -msgid "No modules were found.\nSelect a different installation source." +msgid "No modules were found.\nSelect a different installation sources." msgstr "" msgid "File system label" @@ -5354,4 +5354,7 @@ msgid "Close installer" msgstr "" msgid "Application is already running" +msgstr "" + +msgid "Select installation sources" msgstr "" \ No newline at end of file diff --git a/locale/ubinstall-gtk_ru.po b/locale/ubinstall-gtk_ru.po index f561ea7..02ac4d2 100644 --- a/locale/ubinstall-gtk_ru.po +++ b/locale/ubinstall-gtk_ru.po @@ -2085,9 +2085,9 @@ msgstr "" "Позволяет загрузку системы для бездисковых и обычных рабочих станций через " "локальную сеть или Интернет (даже используя \"слабые\" каналы связи)" -msgid "No modules were found.\nSelect a different installation source." +msgid "No modules were found.\nSelect a different installation sources." msgstr "Модули не найдены.\n" -"Выберите другой источник установки." +"Выберите другие источники установки." msgid "About" msgstr "О программе" @@ -5549,4 +5549,7 @@ msgid "Close installer" msgstr "Закрыть установщик" msgid "Application is already running" -msgstr "Приложение уже запущено" \ No newline at end of file +msgstr "Приложение уже запущено" + +msgid "Select installation sources" +msgstr "Выберите источники для " \ No newline at end of file diff --git a/source/ubinstall-gtk-components.c b/source/ubinstall-gtk-components.c index 67fd321..0407c06 100644 --- a/source/ubinstall-gtk-components.c +++ b/source/ubinstall-gtk-components.c @@ -180,8 +180,9 @@ int yon_os_components_save(main_window *widgets){ return 1; } -void on_os_components_info(GtkWidget *, char *, os_row *row){ +gboolean on_os_components_info(GtkWidget *, GdkEventButton *, os_row *row){ yon_package_info_window_create(row->modules); + return 1; } os_row *yon_os_row_new(){ @@ -190,6 +191,7 @@ os_row *yon_os_row_new(){ row->RowBox = yon_gtk_builder_get_widget(builder,"TableRow"); row->InstallCheck = yon_gtk_builder_get_widget(builder,"InstallCheck"); row->NameLabel = yon_gtk_builder_get_widget(builder,"NameLabel"); + row->NameEvent = yon_gtk_builder_get_widget(builder,"NameEvent"); row->TagsBox = yon_gtk_builder_get_widget(builder,"TagsBox"); row->VersionLabel = yon_gtk_builder_get_widget(builder,"VersionLabel"); row->DescriptionLabel = yon_gtk_builder_get_widget(builder,"DescriptionLabel"); @@ -199,10 +201,9 @@ os_row *yon_os_row_new(){ row->modules=NULL; row->version=NULL; - g_signal_connect(G_OBJECT(row->NameLabel),"activate-link",G_CALLBACK(on_os_components_info),row); + g_signal_connect(G_OBJECT(row->NameEvent),"button-press-event",G_CALLBACK(on_os_components_info),row); row->row = yon_gtk_builder_get_widget(builder,"MainRow"); gtk_widget_show(row->row); - g_object_set_data(G_OBJECT(row->InstallCheck),"kernel_row",row); g_object_set_data(G_OBJECT(row->row),"kernel_row",row); @@ -219,6 +220,9 @@ void *yon_modules_list_load(main_window *widgets){ int parsed_size=0; config_str parsed = NULL; parsed = yon_char_parse(modules[i],&parsed_size,";"); + if (parsed_size<5){ + continue; + } struct row_data *row = malloc(sizeof(struct row_data)); row->version = parsed[3]; row->name = parsed[1]; @@ -290,6 +294,12 @@ gboolean yon_spinner_switch_off(GtkSpinner *target){ gboolean yon_os_components_load(main_window *widgets){ int size=0; GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->OSSoftwareListBox)); + if (!list){ + gtk_widget_show(widgets->OSSoftwareEmptyLabel); + return G_SOURCE_REMOVE; + } else { + gtk_widget_hide(widgets->OSSoftwareEmptyLabel); + } GList *iter; for(iter = list;iter;iter=iter->next){ os_row *row = g_object_get_data(iter->data,"kernel_row"); diff --git a/source/ubinstall-gtk-page-switch.c b/source/ubinstall-gtk-page-switch.c index 6ee374d..986bb7f 100644 --- a/source/ubinstall-gtk-page-switch.c +++ b/source/ubinstall-gtk-page-switch.c @@ -268,7 +268,7 @@ int yon_page_save(main_window *widgets, enum YON_PAGES page){ case YON_PAGE_CONFIG_HUB: return yon_configuration_hub_save(widgets); case YON_PAGE_OS_COMPONENTS: - return yon_os_components_save(widgets); + // return yon_os_components_save(widgets); break; case YON_PAGE_KERNEL: return yon_kernel_save(widgets); @@ -432,8 +432,8 @@ void yon_configuration_mode_check(main_window *widgets){ void yon_page_update(main_window *widgets){ // yon_resize_images_update(widgets); yon_navigation_buttons_set_sensetiveness(widgets); - yon_switch_page_render(widgets); - yon_configuration_mode_check(widgets); + // yon_switch_page_render(widgets); + // yon_configuration_mode_check(widgets); } enum YON_PAGES yon_sections_get_next_page(main_window *widgets){ diff --git a/source/ubinstall-gtk-region.c b/source/ubinstall-gtk-region.c index 4437408..7f9bf58 100644 --- a/source/ubinstall-gtk-region.c +++ b/source/ubinstall-gtk-region.c @@ -126,7 +126,6 @@ void on_map_selection_changed(GtkWidget *,CcTimezoneLocation *location,main_wind char *timezone = (char*)cc_timezone_location_get_zone(location); GtkTreeIter iter; - // int found = 0; for_iter(widgets->RegionTimezoneCompletionList,&iter){ char *render, *tz; gtk_tree_model_get(GTK_TREE_MODEL(widgets->RegionTimezoneCompletionList),&iter,0,&render,1,&tz,-1); @@ -137,21 +136,10 @@ void on_map_selection_changed(GtkWidget *,CcTimezoneLocation *location,main_wind gtk_entry_set_text(GTK_ENTRY(widgets->RegionEntry),render); char *utc = yon_timezone_get_utc(tz); yon_map_status_show(widgets,NULL,MAP_TITLE_LABEL(utc),render); - // found = 1; break; } } - // if (!found){ - // const char *region = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->RegionCombo)); - // const char *zone = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->ZoneCombo)); - // char *timezone = yon_char_unite(region,"/",zone,NULL); - // g_signal_handlers_block_by_func(G_OBJECT(widgets->RegionMapTarget),G_CALLBACK(on_map_selection_changed),widgets); - // cc_timezone_map_set_timezone(CC_TIMEZONE_MAP(widgets->RegionMapTarget),timezone); - // g_signal_handlers_unblock_by_func(G_OBJECT(widgets->RegionMapTarget),G_CALLBACK(on_map_selection_changed),widgets); - // free(timezone); - // } - if (!yon_char_is_empty(region)) free(region); g_signal_handlers_unblock_by_func(G_OBJECT(widgets->ZoneCombo),G_CALLBACK(on_zone_changed),widgets); g_signal_handlers_unblock_by_func(G_OBJECT(widgets->RegionMapTarget),G_CALLBACK(on_map_selection_changed),widgets); diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 6c9a88a..bb6fdc0 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -603,6 +603,7 @@ void yon_main_window_create(main_window *widgets){ widgets->OSSoftwareNameLabel = yon_gtk_builder_get_widget(builder,"OSSoftwareNameLabel"); widgets->OSSoftwareTagsLabel = yon_gtk_builder_get_widget(builder,"OSSoftwareTagsLabel"); widgets->OSSoftwareDescriptionLabel = yon_gtk_builder_get_widget(builder,"OSSoftwareDescriptionLabel"); + widgets->OSSoftwareEmptyLabel = yon_gtk_builder_get_widget(builder,"OSSoftwareEmptyLabel"); widgets->PacmanSoftwareSearchEntry = yon_gtk_builder_get_widget(builder,"PacmanSoftwareSearchEntry"); widgets->PacmanSoftwareStatusImage = yon_gtk_builder_get_widget(builder,"PacmanSoftwareStatusImage"); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 528e95f..fae96a2 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -734,6 +734,7 @@ typedef struct GtkWidget *OSSoftwareNameLabel; GtkWidget *OSSoftwareTagsLabel; GtkWidget *OSSoftwareDescriptionLabel; + GtkWidget *OSSoftwareEmptyLabel; GtkWidget *PacmanSoftwareSearchEntry; GtkWidget *PacmanSoftwareStatusImage; @@ -1061,6 +1062,7 @@ typedef struct char *version; char *tags; char *description; + GtkWidget *NameEvent; } os_row; typedef struct @@ -1635,5 +1637,5 @@ yon_window *yon_package_info_window_create(const char *package); info_element *yon_package_info_element_new(); void yon_gtk_label_set_font(GtkLabel *label); void on_kernel_info(GtkWidget *, char *link, kernel_row *row); -void on_os_components_info(GtkWidget *, char *, os_row *row); +gboolean on_os_components_info(GtkWidget *, GdkEventButton *, os_row *row); void on_software_info(GtkWidget*, main_window *widgets); \ No newline at end of file diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 7d6d5dc..e972d3f 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -479,6 +479,7 @@ NULL) // #define _LABEL _("Source:") // #define _LABEL _("Version:") // #define _LABEL _("Size:") +// #define _LABEL _("Select installation sources") #define slide_1_title _("Product ecosystem") #define slide_1_text _("Developed by a team of professionals and successfully presented on the market.\n\ @@ -586,5 +587,5 @@ For more information, visit our website the \"Support Levels\" section.") #define slide_22_title _("Network Boot") #define slide_22_text _("Allows system booting for diskless and standard workstations over a local network or the Internet (even over slow connection channels).") -#define MAIN_COMPONENTS_NOT_FOUND_LABEL _("No modules were found.\nSelect a different installation source") +#define MAIN_COMPONENTS_NOT_FOUND_LABEL _("No modules were found.\nSelect a different installation sources") #define MAIN_COMPONENTS_ALL_SELECTED_LABEL _("All local modules of the system are selected") \ No newline at end of file diff --git a/ubinstall-gtk-os-row.glade b/ubinstall-gtk-os-row.glade index a4df9df..6234eee 100644 --- a/ubinstall-gtk-os-row.glade +++ b/ubinstall-gtk-os-row.glade @@ -44,16 +44,23 @@ False 7 - + True False - Name - 0 - False - 0 - - - + True + + + True + True + Name + 0 + False + 0 + + + + + False diff --git a/ubinstall-gtk-source.glade b/ubinstall-gtk-source.glade index 192097f..a483fcb 100644 --- a/ubinstall-gtk-source.glade +++ b/ubinstall-gtk-source.glade @@ -51,7 +51,7 @@ True False start - com.ublinux.ubinstall-gtk + com.ublinux.ubinstall-gtk.source 6 @@ -70,7 +70,7 @@ True False - Choose a path for configuration file + Select installation sources 0 diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 001dd0c..506c9d4 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -2105,7 +2105,7 @@ agreement False No modules were found. -Select a different installation source. +Select a different installation sources. center True @@ -7428,9 +7428,7 @@ Select a different installation source. column - - 0 - + 4 3 @@ -7438,7 +7436,9 @@ Select a different installation source. - + + 500 + 2 @@ -14435,7 +14435,6 @@ separately into the selected partition. Cancel True - False True True image7