[gnome-packagekit] gpk-update-viewer: toggle subpackages when toggling the main package



commit a02b4932b8a35829859e11f1cde8ce525051d138
Author: Christopher Aillon <caillon redhat com>
Date:   Thu Feb 24 15:58:02 2011 -0800

    gpk-update-viewer: toggle subpackages when toggling the main package
    
    GNOME Bug 616149

 src/gpk-update-viewer.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/gpk-update-viewer.c b/src/gpk-update-viewer.c
index 395b4ca..1387ab7 100644
--- a/src/gpk-update-viewer.c
+++ b/src/gpk-update-viewer.c
@@ -1509,9 +1509,10 @@ out:
 static void
 gpk_update_viewer_treeview_update_toggled (GtkCellRendererToggle *cell, gchar *path_str, gpointer user_data)
 {
-	GtkTreeIter iter;
+	GtkTreeIter iter, child_iter;
 	GtkTreePath *path = gtk_tree_path_new_from_string (path_str);
 	gboolean update;
+	gboolean child_valid;
 	gchar *package_id;
 	GtkTreeView *treeview;
 	GtkTreeModel *model;
@@ -1533,6 +1534,14 @@ gpk_update_viewer_treeview_update_toggled (GtkCellRendererToggle *cell, gchar *p
 	/* set new value */
 	gtk_tree_store_set (GTK_TREE_STORE(model), &iter, GPK_UPDATES_COLUMN_SELECT, update, -1);
 
+	/* do the same for any children */
+	child_valid = gtk_tree_model_iter_children (model, &child_iter, &iter);
+	while (child_valid) {
+		gtk_tree_store_set (GTK_TREE_STORE(model), &child_iter,
+				    GPK_UPDATES_COLUMN_SELECT, update, -1);
+		child_valid = gtk_tree_model_iter_next (model, &child_iter);
+	}
+
 	/* clean up */
 	gtk_tree_path_free (path);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]