GNOME Bugzilla – Bug 115066
"Search For" dialog shows all when criteria is left as default
Last modified: 2018-06-29 20:33:42 UTC
When "Search For" dialog is shown, it is intuitive to immediately hit find to show all. Could this be implmented please?
I think a better solution is a "find all" button.. But I'll see about string-searches coping with empty input.
how do we vote on bugs? I would *really* love to see this.
you vote by submitting code ;)
See also bug#101456
Aha, I have a patch for this in bug 101456 - see attachment 97818 [details] [review]. I'll attach it here too if necessary...
Created attachment 103126 [details] [review] patch to allow empty list of search criterion, or empty search string in search dialogs Attached patch from the other bug here, now hopefully it will make it in... here is a summary of the explanation from the other bug This enables removing all search criteria, in which case all results will be returned. It also removes the check to ensure that the search string is not empty, if the search type is "contains". As you would logically expect, all strings contain the empty string. So now you can simply click "Find" (or press Alt-F) from the default search criteria (usually contains with an empty string on some field) and all records will be returned. It should work from any standard GnuCash search dialog. Patch attached against GnuCash 2.2.1, tested on Fedora on the busines dialogs - Customers, Invoices, Bills, etc I've also checked that applies cleanly on trunk as of today...
Created attachment 104813 [details] [review] First try Allow to remove all elements which results in an "empty" new/refinement/... search matching all available items. In that case grey out the match-type combo in the upper right corner and add a label "Match all entries" where the criteria list used to sit. Opinions? Especially, how should the criteria list look alike after search_clear_criteria()?
Created attachment 104814 [details] [review] Second try, trivial optimization
Created attachment 104815 [details] [review] Third try, arrrgh (saved wrong buffer)
Re comment #9: Just curious as to how this varies from my original patch - I see you have better ways of checking if a list is empty, and obviously have done more on the UI. I also had a change to search-string.c to handle empty search strings as it didn't make sense to me to disallow searching for "contains an empty string" since this should obviously match all strings - what do you think of that?
Personally, I do not like searching for empty strings at all, so I grabbed your original patch and added a little more UI, just as you said.
Looks good to me. r17705, awaiting back-port.
*** Bug 562134 has been marked as a duplicate of this bug. ***
Committed to 2.2 branch, r17754. Thanks a lot!
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=115066. Please update any external references or bookmarks.