r23752 - gnucash/trunk/src/gnome - Change double-click behaviour on account hierarchy

Geert Janssens gjanssens at code.gnucash.org
Fri Jan 24 09:01:50 EST 2014


Author: gjanssens
Date: 2014-01-24 09:01:49 -0500 (Fri, 24 Jan 2014)
New Revision: 23752
Trac: http://svn.gnucash.org/trac/changeset/23752

Modified:
   gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.c
Log:
Change double-click behaviour on account hierarchy

- placeholder accounts will expand/collapse
- all other account types will open the register

This is a partial fix for bug 721026 and will
alleviate the biggest frustration experienced there

Modified: gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.c	2014-01-24 13:36:22 UTC (rev 23751)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.c	2014-01-24 14:01:49 UTC (rev 23752)
@@ -868,19 +868,25 @@
     model = gtk_tree_view_get_model(treeview);
     if (gtk_tree_model_get_iter(model, &iter, path))
     {
-        if (gtk_tree_model_iter_has_child(model, &iter))
+        Account *account = gnc_tree_view_account_get_account_from_path (GNC_TREE_VIEW_ACCOUNT(treeview), path);
+        if (xaccAccountGetPlaceholder (account))
         {
-            /* There are children,
-             * just expand or collapse the row. */
-            if (gtk_tree_view_row_expanded(treeview, path))
-                gtk_tree_view_collapse_row(treeview, path);
-            else
-                gtk_tree_view_expand_row(treeview, path, FALSE);
+            /* This is a placeholder account. Only only show/hide
+             * subaccount list if there is one.
+             */
+            if (gtk_tree_model_iter_has_child(model, &iter))
+            {
+                /* There are children,
+                 * just expand or collapse the row. */
+                if (gtk_tree_view_row_expanded(treeview, path))
+                    gtk_tree_view_collapse_row(treeview, path);
+                else
+                    gtk_tree_view_expand_row(treeview, path, FALSE);
+            }
         }
         else
         {
-            /* It's an account without any children, so open its register */
-            Account *account = gnc_tree_view_account_get_account_from_path (GNC_TREE_VIEW_ACCOUNT(treeview), path);
+            /* No placeholder account, so open its register */
 #ifdef REGISTER2_ENABLED
             gppat_open2_account_common (page, account, FALSE);
 #else



More information about the gnucash-changes mailing list