From 5899974158ba41c2a758dd9b0dedd3b424176296 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Tue, 16 Dec 2025 13:16:38 +0000 Subject: [PATCH] WIP task #45 --- source/CMakeLists.txt | 2 +- source/ubinstall-gtk-packages.c | 15 +++++++++------ ubinstall-gtk.glade | 22 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index eb5a90b..91569dc 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -143,7 +143,7 @@ set(SOURCE_FILES ubinstall-gtk-configuration-mode.c ubinstall-gtk-decorations.c ubinstall-gtk-log.c - ubinstall-gtk-password.c + # ubinstall-gtk-password.c ubinstall-gtk-saving.c ubinstall-gtk-standard.c ubinstall-gtk-install-start.c diff --git a/source/ubinstall-gtk-packages.c b/source/ubinstall-gtk-packages.c index 04655a5..5390f1a 100644 --- a/source/ubinstall-gtk-packages.c +++ b/source/ubinstall-gtk-packages.c @@ -16,8 +16,8 @@ GtkTreeIter *yon_category_check(GtkTreeStore *target,char *category){ GtkTreeIter *yon_subcategory_check(GtkTreeStore *target, GtkTreeIter *parent_iter, char *category){ GtkTreeIter iter; GtkTreeIter *ret_iter = NULL; - gtk_tree_model_iter_children(target,&iter,parent_iter); - for(int valid = 1; valid; valid = gtk_tree_model_iter_next(target,&iter)){ + gtk_tree_model_iter_children(GTK_TREE_MODEL(target),&iter,parent_iter); + for(int valid = 1; valid; valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(target),&iter)){ char *cur_category; gtk_tree_model_get(GTK_TREE_MODEL(target),&iter,0,&cur_category,-1); if (!strcmp(cur_category,category)){ @@ -51,16 +51,19 @@ void yon_packages_tab_init(main_window *widgets){ void yon_on_packages_chosen(GtkTreeStore *, char *path, main_window *widgets){ GtkTreeIter iter, chiter; - gtk_tree_model_get_iter_from_string(widgets->PackagesList,&iter,path); + gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(widgets->PackagesList),&iter,path); GtkTreePath *cur_path = gtk_tree_model_get_path(GTK_TREE_MODEL(widgets->PackagesList),&iter); int depth = gtk_tree_path_get_depth(cur_path); if (depth<2){ + GtkTreeIter *cur_parent, *cur_iter; + cur_parent = gtk_tree_iter_copy(&iter); + cur_iter = gtk_tree_iter_copy(&chiter); switch(depth){ case 0: - gtk_tree_model_iter_children(GTK_TREE_MODEL(widgets->PackagesList),&chiter,&iter); - + gtk_tree_model_iter_children(GTK_TREE_MODEL(widgets->PackagesList),cur_iter,&iter); + __attribute__((fallthrough)); case 1: - gtk_tree_model_iter_children(GTK_TREE_MODEL(widgets->PackagesList),&chiter,&iter); + gtk_tree_model_iter_children(GTK_TREE_MODEL(widgets->PackagesList),cur_iter,cur_parent); } diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 506799a..33e8e88 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -153,6 +153,7 @@ True False + @@ -6336,6 +6337,27 @@ agreement 4 + + + True + True + + + True + True + Packages + + + + + + + + True + True + 5 + + 16