After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 420342 - remember register filter and ordering settings
remember register filter and ordering settings
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Register
git-master
Other All
: Normal enhancement
: ---
Assigned To: David Hampton
Chris Shoemaker
: 392049 528341 539574 567565 588615 592659 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-03-19 23:43 UTC by Joel SCHAAL
Modified: 2018-06-29 21:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Save Filter patch (28.71 KB, patch)
2011-10-02 14:10 UTC, Bob
needs-work Details | Review
Save Filter patch (39.71 KB, patch)
2011-10-08 16:42 UTC, Bob
committed Details | Review
Patch to save sort and updated filter (27.42 KB, patch)
2011-10-24 13:34 UTC, Bob
committed Details | Review

Description Joel SCHAAL 2007-03-19 23:43:29 UTC
When I start GnuCash, I have the account tree opened and all the account registers  opened in the previous session. So far so good. But it is a little annoyance to have to reselect the previously selected filters (no reconciled transactions, for example) and reordering. Could it be possible to save the complete state of an account register (not only its open status) on close ? Or maybe have a default order and/or a default filter associated to an account directly in its (advanced) properties ? That way, when an account is opened these options are immediately applied.

Other information:
I'm not sure whether it's a bug or I haven't found an option, but I searched in the help, the gconf options, the WishList wiki and the Bug List but have not found anything solving my problem. Thank you in advance for your time and consideration.
Comment 1 Josh Sled 2007-03-20 14:24:29 UTC
Confirmed.  This straddles enhancement and minor, but I agree with severity:minor.
Comment 2 Christian Stimming 2007-03-27 09:03:11 UTC
*** Bug 392049 has been marked as a duplicate of this bug. ***
Comment 3 Nathan Kunkee 2008-01-15 19:19:51 UTC
I'd like to add that time range options for the current year/quarter/month would be nice.
Comment 4 Jon Schewe 2009-07-09 23:21:45 UTC
It would be _really_ nice to have this. I would like to be able to have filter settings saved for each account. I'd really like to have reconciled transactions turned off by default.
Comment 5 Jon Schewe 2009-07-10 13:03:56 UTC
Is there any opinion on if this information should be saved in ~/.gnucash/books or in the actual register file itself?
Comment 6 Christian Stimming 2009-09-15 12:53:35 UTC
*** Bug 539574 has been marked as a duplicate of this bug. ***
Comment 7 Christian Stimming 2009-09-15 12:54:29 UTC
*** Bug 567565 has been marked as a duplicate of this bug. ***
Comment 8 Christian Stimming 2009-09-15 12:54:40 UTC
*** Bug 528341 has been marked as a duplicate of this bug. ***
Comment 9 Matthijs Kooijman 2010-11-23 15:51:57 UTC
I guess this should be saved in the actual register file, since this really needs to be per-account, not a global saved filter. Also, on a recent discussion on the mailing list regarding this feature, I've suggested that automatically saving all filtering and ordering settings for an account will probably surprise users. Instead, adding an extra "Remember filter settings for this account" checkbox will probably make sense (and something similar for sorting).
Comment 10 Jon Schewe 2010-11-23 19:43:47 UTC
That sounds reasonable. I can imagine some accounts that I don't want to save the filters for.
Comment 11 rv.guillemot 2010-11-24 19:48:26 UTC
A "Per account setting".
Wow, it would be great.
-----
A french user
Comment 12 Christian Stimming 2011-01-11 12:12:12 UTC
*** Bug 588615 has been marked as a duplicate of this bug. ***
Comment 13 Don Langhorne 2011-01-30 15:43:59 UTC
I'd like to add my support for this feature.  At some point past transactions are simply not needed and it slows down navigating through the ledger/register.  I would say the simplest solution would be to make an option that can be set either per account or even for the whole file to have filters that can allow for filtering either a date certain, a certain time period in the past (like 3 months prior to todays date) or even filtering out reconciled transactions.
Comment 14 Bob 2011-10-02 14:10:06 UTC
Created attachment 198015 [details] [review]
Save Filter patch

I had a look at this, missed the bounty on it but no matter.

This patch against svn allows the filter status for accounts to be saved as a kvp called filter. Changed the dialog to include a tick box to enable the save otherwise it works as before. I see no point in saving any thing on the date page as I think this will be far to problematic in normal use.

There are two points I am unsure of:
1) What is an LD_SUBACCOUNT, have been unable to test the switch case for this.
2) I added the gnc_ppr_update_status_query at line 597 to enable the saved filter on load but not sure if it is the correct location.

This same setup could be used to save the field sort order of an account if individual account setting are to be saved but not sure if this should be a global setting in gconf.
Comment 15 Geert Janssens 2011-10-08 10:54:55 UTC
Comment on attachment 198015 [details] [review]
Save Filter patch

Thank you for your patch.

Like you, I'm not sure what LD_SUBACCOUNT is used for. I think this has to to with the option to open an account register for the subaccounts of a certain account. You can do this by going to the Accounts overview page, right-click on any account and then select "Open Subaccounts".

This will open a register in "transaction view" and the name of the register will be <Account name>+ (note the "+").

I think your switch case breaks the filter for this action. You add a + sign to your filter string if the register is of type LD_SUBACCOUNT. As a result the strtoll will fail and the filter is always empty.

I propose you remove the switch case and simply return either a valid filter string or NULL instead of "" (g_strdup handles NULL just fine). This is slightly more efficient.

Then in gnc_plugin_page_register_new_common you can simply check if the returned filter string isn't NULL before converting to a hex number. This is also faster than having to pass by strcmp.

Other than that your patch seems to be fine.
Comment 16 Bob 2011-10-08 16:42:34 UTC
Created attachment 198612 [details] [review]
Save Filter patch

Changed the patch as suggested, still needed to test for the right account type otherwise it would fail in scheduled transaction editor but have used an if statement to test for both account types and also changed the dialog glade file to make it look better.

As a result of you telling me about the sub account option, don't know why I missed that one as I thought I looked every where, I have also changed slightly the tab color procedure I did ages ago to work the same way which now makes it work on sub accounts.
Comment 17 Geert Janssens 2011-10-14 17:46:26 UTC
Comment on attachment 198612 [details] [review]
Save Filter patch

Committed as r21421. Thank you very much.
Comment 18 Geert Janssens 2011-10-14 18:01:36 UTC
I've committed your patch as it is, because it is already sufficient to close this enhancement request if we want to. 

I'd like to add some small notes though I forgot about earlier:

(In reply to comment #14)
> This patch against svn allows the filter status for accounts to be saved as a
> kvp called filter. Changed the dialog to include a tick box to enable the save
> otherwise it works as before.
I wonder if we shouldn't also save the state of the save tick box itself. I now find myself in the situation that I have saved a filter setting, and want to change it again later on and have to manually tick the box again.

The way it's currently implemented could also lead to some confusion: suppose I have changed the filter and marked it for saving. How do I remove the saved filter again ?

I don't have the perfect answer to these questions by the way, I'm just wondering out loud in an attempt to come to the best possible user experience.

> I see no point in saving any thing on the date
> page as I think this will be far to problematic in normal use.
> 
I wonder why this would be problematic in normal use ? I can imagine a scenario where I would only want to see the entries in an account for the current year because the earlier years have been closed from an accounting point of view. Would it be complicated to implement a save feature for the date tab as well ?

> There are two points I am unsure of:
> 1) What is an LD_SUBACCOUNT, have been unable to test the switch case for this.
> 2) I added the gnc_ppr_update_status_query at line 597 to enable the saved
> filter on load but not sure if it is the correct location.
> 
1) has been addressed I think.
2) it seems to work fine like this, so I assume this is one good location to enable the saved filter.

> This same setup could be used to save the field sort order of an account if
> individual account setting are to be saved but not sure if this should be a
> global setting in gconf.

Personally, I would prefer to use what you have done now for sort order as well.
- This gives more consistency in the two options
- I don't necessarily want to sort all my accounts in the same order
On the other hand, I don't know of a scenario in which I would want to save the sort order on an account. When I sort that's usually temporary. Of course several of the earlier comments on this bug suggest some people would like to have the option to save the order of accounts.
Comment 19 Bob 2011-10-15 15:25:44 UTC
I will have a think about the points raised and have a look at saving the sort order the same way.
Comment 20 Bob 2011-10-24 13:34:18 UTC
Created attachment 199814 [details] [review]
Patch to save sort and updated filter

I have added the same routines to save the sort order and updated the filter patch to include the dates.

Some Notes...

The save tick boxes will remain ticked as long as the saved entry is not the default so on restart the tick box will be unticked or it is unticked manually.

The start date and end date is only saved if the respective choose date option is active, any other option will cause the date to be reset to default.
Comment 21 Geert Janssens 2011-10-28 12:33:51 UTC
Comment on attachment 199814 [details] [review]
Patch to save sort and updated filter

Committed in r21499, thank you very much.
Comment 22 Geert Janssens 2012-06-29 14:50:41 UTC
*** Bug 592659 has been marked as a duplicate of this bug. ***
Comment 23 John Ralls 2018-06-29 21:30:10 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=420342. Please update any external references or bookmarks.