GNOME Bugzilla – Bug 745354
Find dialog should more easily allow certain complex searches
Last modified: 2018-06-29 23:38:56 UTC
This describes an enhancement to the "Find Transactions" dialog that I have implemented but not yet checked in. I'm entering it to document what I've done and solicit comments. I often want to search for the same text in any of the Notes, Memo, or Description fields of a transaction. This is cumbersome since I have to enter three separate selectors with essentially the same contents in the find dialog and remember to change the default from "all criteria" to "any criteria". To make this easier to do I've extended the Find Transactions dialog to allow a single criterion to expand to a more complex search. Currently each criterion in the dialog corresponds to a single query term. With this change it can correspond to an arbitrary "and" or "or" of several query terms. Internally this is done by changing GNCSearchParam to be a base class with two subclasses, GNCSearchParamSimple and GNCSearchParamCompound. The former is like the old GNCSearchParam class while the latter specifies a list of GNCSearchParam's (simple or compound) to be anded or ored together. All of them must be the same type since there is only one input field to be used for all of them. GNCSearchParam objects are currently used for two purposes: to specify the search terms and to specify the columns to be displayed in things the reconcile and find bills dialogs. The latter use requires a GNCSearchParamSimple, the new form can only be used to specify a search term. So far I've only used this for one purpose: to define a new criterion in the Find Transactions dialog called "Description, Notes, or Memo" which looks for the given text in any of those three fields. Unless someone can think of a reason not to, I'll push this change in a few days. Do people think it is appropriate for the maint branch, or is it too big a change for that?
This change was included in version 2.6.5.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=745354. Please update any external references or bookmarks.