From a8ab7e88ca35facf9ce5084887dd6cf08d48f1df Mon Sep 17 00:00:00 2001 From: Charles Day Date: Wed, 30 Jul 2008 20:54:01 +0000 Subject: [PATCH] Usability: Price Editor: Sort price trees on the commodity column by default. This allows for a consistent default sort even if commodities are removed from and re-added to the model. This can happen, for example, when a namespace or commodity is changed in another place (like the Security Editor) and gets removed and then re-added to the commodity db. BP git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17439 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/gnome-utils/gnc-tree-view-price.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gnome-utils/gnc-tree-view-price.c b/src/gnome-utils/gnc-tree-view-price.c index ef7ce89302..7cd04ad0da 100644 --- a/src/gnome-utils/gnc-tree-view-price.c +++ b/src/gnome-utils/gnc-tree-view-price.c @@ -471,6 +471,12 @@ gnc_tree_view_price_new (QofBook *book, gnc_tree_view_configure_columns(view); + /* Sort on the commodity column by default. This allows for a consistent + * sort if commodities are removed and re-added from the model. */ + gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(s_model), + GNC_TREE_MODEL_PRICE_COL_COMMODITY, + GTK_SORT_ASCENDING); + gtk_widget_show(GTK_WIDGET(view)); LEAVE(" %p", view); return GTK_TREE_VIEW(view);