Scheme question re: complex report options
Charles Day
cedayiv at gmail.com
Fri Dec 28 01:11:09 EST 2007
I am trying to set up a new boolean report option (a "Notes" checkbox), but
I only want it to be available when one of the other existing boolean
options ("Memo") is already checked (i.e. the "Notes" checkbox should be
enabled only when "Memo" is checked). Using the make-complex-boolean-option
procedure, I was able to get this behavior working, except for one small
problem. If the user clicks the Apply button, the "Notes" checkbox is no
longer affected by clicking "Memo". The two checkboxes have become
completely independent.
You can see a similar result in GnuCash 2.2.2. Run a Transaction Report,
then click Options. On the General tab, check the Common Currency option.
The Report Currency option (a drop-down) becomes enabled. Click Apply. Now
no amount of clicking or unclicking the Common Currency checkbox will get
the Report Currency drop-down disabled again. It only works properly before
you press Apply.
Am I doing something wrong? Does anyone know how to fix this? Here is the
Scheme code that sets up the dependency between checkboxes:
(gnc:register-trep-option
(gnc:make-complex-boolean-option
gnc:pagename-display (N_ "Memo")
"d" (N_ "Display the memo?") #t
#f
(lambda (x) (gnc-option-db-set-option-selectable-by-name
gnc:*transaction-report-options*
gnc:pagename-display
(N_ "Notes")
x))))
Cheers,
Charles
More information about the gnucash-devel
mailing list