GnuCash
Contact   Instructions
Bug 797158 - gnc:make-account-sel-limited-option is not working
Summary: gnc:make-account-sel-limited-option is not working
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: User Interface General (show other bugs)
Version: git-maint
Hardware: PC Linux
: Normal normal
Target Milestone: ---
Assignee: ui
QA Contact: ui
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-29 01:52 EDT by Christopher Lam
Modified: 2019-07-25 09:17 EDT (History)
4 users (show)

See Also:


Attachments

Description Christopher Lam 2019-03-29 01:52:39 EDT
This one is for @gjanssens I'm afraid.

gnc:make-account-sel-limited-option is not working.

Test: run owner-report.scm (eg. Vendor Report) in a book with >1 A/Payable account.

Note the default General/Account is the 1st AP account.

Try change to 2nd AP account.

The report *can* pick up the 2nd AP account, however it's not saved somewhere internally. i.e. opening report options again shows the 1st AP account is still presented.

I really cannot find anything wrong in gnc:make-account-sel-limited-option to cause it to fail. This gnc:make-account-sel-limited-option is very similar to gnc:make-account-list-limited-option and functionally they're identical.

Something is making gnc:make-account-sel-limited-option reset to the default option when it shouldn't.
Comment 1 Christopher Lam 2019-03-31 01:35:53 EDT
Ok the scheme code is fine.

It's the C part which is not willing to display the pre-existing value.

As a test try hello-world.scm from https://github.com/Gnucash/gnucash/pull/477 and set value for the make-account-sel-limited-option option; it accepts value, loads/saves correctly... however the UI *refuses to display* the current value.
Comment 2 Bob 2019-07-24 12:39:48 EDT
Christopher,

The problem is on line 2699 of dialog-options.c

Change the line to...

gnc_option_set_ui_value(option, FALSE);

have no idea why it is set to TRUE and how long the comment has been there so give it a try, if OK you may consider removing the comment also.

Not sure if that option type is used in other reports, may be you could see and prove that changing the above does not effect any thing else.

Also I copied the hello-world.scm file as suggested to test and it showed the problem but could you give it a scan on all the tooltips, there are many duplicates maybe from cutting and pasting, for example pixmap comes up as commodity.
Comment 3 Christopher Lam 2019-07-25 05:43:46 EDT
@Bob bingo, as always, thank you :) this was annoying me enough to work on eradicating this option from reports; I'm nearly finished with aging.scm and owner-report.scm which are the sole users.

The hello-world.scm was supercharged in a deliberately sloppy way; it was mainly being used as a test-bed for testing saving report-options. I'm not sure whether this branch will be used eventually, so I'd leave this unchanged for now. Even if the branch is used, I'd remove it.

Thank you for finding this annoyance!

Note You need to log in before you can comment on or make changes to this bug.