AUDIT: r17469 - gnucash/trunk/src/gnome - Usability: Security Editor: Previously, nothing happened when a namespace row was activated. Now these rows will expand or collapse. It is often easier to double-click the row than hunt for the expander.

Charles Day cedayiv at cvs.gnucash.org
Wed Aug 13 13:47:08 EDT 2008


Author: cedayiv
Date: 2008-08-13 13:47:08 -0400 (Wed, 13 Aug 2008)
New Revision: 17469
Trac: http://svn.gnucash.org/trac/changeset/17469

Modified:
   gnucash/trunk/src/gnome/dialog-commodities.c
Log:
Usability: Security Editor: Previously, nothing happened when a namespace row was activated. Now these rows will expand or collapse. It is often easier to double-click the row than hunt for the expander.
BP


Modified: gnucash/trunk/src/gnome/dialog-commodities.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-commodities.c	2008-08-13 17:44:11 UTC (rev 17468)
+++ gnucash/trunk/src/gnome/dialog-commodities.c	2008-08-13 17:47:08 UTC (rev 17469)
@@ -92,7 +92,27 @@
 row_activated_cb (GtkTreeView *view, GtkTreePath *path,
                   GtkTreeViewColumn *column, CommoditiesDialog *cd)
 {
-  edit_clicked (cd);
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+
+  g_return_if_fail(view);
+
+  model = gtk_tree_view_get_model(view);
+  if (gtk_tree_model_get_iter(model, &iter, path))
+  {
+    if (gtk_tree_model_iter_has_child(model, &iter))
+    {
+      /* There are children, so it's not a commodity.
+       * Just expand or collapse the row. */
+      if (gtk_tree_view_row_expanded(view, path))
+        gtk_tree_view_collapse_row(view, path);
+      else
+        gtk_tree_view_expand_row(view, path, FALSE);
+    }
+    else
+      /* It's a commodity, so click the Edit button. */
+      edit_clicked(cd);
+  }
 }
 
 static void



More information about the gnucash-changes mailing list