aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-07-10 14:44:01 +0000
committerChristian Grothoff <christian@grothoff.org>2013-07-10 14:44:01 +0000
commit740d5d09795fd087c11c7a4281d29425cc5ae866 (patch)
treece0fbea1855816113d5bfee181fb8abbd7efb388
parentd71fceb3b4332ce852b43964cd8c8bb5593aefc0 (diff)
downloadgnunet-gtk-740d5d09795fd087c11c7a4281d29425cc5ae866.tar.gz
gnunet-gtk-740d5d09795fd087c11c7a4281d29425cc5ae866.zip
-keep selection and expansion after editing
-rw-r--r--src/setup/gnunet-setup-gns.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/setup/gnunet-setup-gns.c b/src/setup/gnunet-setup-gns.c
index 1ee8531d..5fddfaa3 100644
--- a/src/setup/gnunet-setup-gns.c
+++ b/src/setup/gnunet-setup-gns.c
@@ -1462,6 +1462,9 @@ zone_iteration_proc (void *cls,
1462 GtkEntry *pseu_entry; 1462 GtkEntry *pseu_entry;
1463 struct GNUNET_HashCode name_hash; 1463 struct GNUNET_HashCode name_hash;
1464 struct RecordInfo *ri; 1464 struct RecordInfo *ri;
1465 GtkTreeSelection *sel;
1466 GtkTreeIter sel_iter;
1467 GtkTreePath *sel_path;
1465 1468
1466 if ((NULL == zone_key) && (NULL == name)) 1469 if ((NULL == zone_key) && (NULL == name))
1467 { 1470 {
@@ -1485,6 +1488,11 @@ zone_iteration_proc (void *cls,
1485 GNUNET_CRYPTO_hash (name, 1488 GNUNET_CRYPTO_hash (name,
1486 strlen (name), 1489 strlen (name),
1487 &name_hash); 1490 &name_hash);
1491 sel = gtk_tree_view_get_selection (tv);
1492 if (gtk_tree_selection_get_selected (sel, NULL, &sel_iter))
1493 sel_path = gtk_tree_model_get_path (tm, &sel_iter);
1494 else
1495 sel_path = NULL;
1488 ri = GNUNET_CONTAINER_multihashmap_get (n2r, &name_hash); 1496 ri = GNUNET_CONTAINER_multihashmap_get (n2r, &name_hash);
1489 if (NULL != ri) 1497 if (NULL != ri)
1490 { 1498 {
@@ -1616,6 +1624,12 @@ zone_iteration_proc (void *cls,
1616 GNUNET_free (type_str); 1624 GNUNET_free (type_str);
1617 GNUNET_free (val); 1625 GNUNET_free (val);
1618 } 1626 }
1627 if (NULL != sel_path)
1628 {
1629 gtk_tree_selection_select_path (sel, sel_path);
1630 gtk_tree_view_expand_to_path (tv, sel_path);
1631 gtk_tree_path_free (sel_path);
1632 }
1619} 1633}
1620 1634
1621 1635