AUDIT: r17440 - gnucash/trunk/src/gnome - Usability: Price Editor: Previously, nothing happened when a namespace or commodity 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 Jul 30 16:57:30 EDT 2008


Author: cedayiv
Date: 2008-07-30 16:57:30 -0400 (Wed, 30 Jul 2008)
New Revision: 17440
Trac: http://svn.gnucash.org/trac/changeset/17440

Modified:
   gnucash/trunk/src/gnome/dialog-price-edit-db.c
Log:
Usability: Price Editor: Previously, nothing happened when a namespace or commodity 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-price-edit-db.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-price-edit-db.c	2008-07-30 20:54:01 UTC (rev 17439)
+++ gnucash/trunk/src/gnome/dialog-price-edit-db.c	2008-07-30 20:57:30 UTC (rev 17440)
@@ -350,7 +350,27 @@
 row_activated_cb (GtkTreeView *view, GtkTreePath *path,
 		  GtkTreeViewColumn *column, gpointer data)
 {
-  gnc_prices_dialog_edit_clicked (GTK_WIDGET (view), data);
+  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 price.
+       * 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 price, so click the Edit button. */
+      gnc_prices_dialog_edit_clicked(GTK_WIDGET(view), data);
+  }
 }
 
 static void



More information about the gnucash-changes mailing list