Dave Peticolas <[EMAIL PROTECTED]> writes:
> I would like to change the way the options dialog works in gnome.
> Specifically, it should:
>
> 1. Allow the user to change the options in the 'upper' part
> of the dialog, without setting them, but perhaps validating
> them using a scheme callback.
>
> 2. Keep a list of the 'changed' items and, when the user
> clicks 'ok' or 'apply', tell scheme to change them.
> I think the ui should only tell scheme to change items
> that the ui has validated. This allows the ui to control
> when 'error' messages are shown.
This sounds good, with the caveat that perhaps the scheme code should
be in control of *how* the error messages are displayed (at least
generating their contents). This could be done from the scheme
validation callback perhaps.
> Then, the ui can decide how best to display the preferences and
> allow the user to change them in that ui's idiom. The guile side
> wouldn't need to have ui pointers at all.
I agree with everything you said, presuming I understood it
adequately. The current code was intended to be a first pass. I
think all your modifications would be appropriate. Also, I think I
posted this to the list a while back, but you might want to look at
what the scwm people are doing. They have a fully blown mechanism for
this sort of thing which includes self-documentation.
http://scwm.mit.edu/#preferences
Note that in case it's not clear from the current GnuCash code, the
eventual goal is that whenever a preference is different from our
system default, and has been modified by the user, a command to
restore its current value should be saved in the user's
~/.gnucash/config.auto file, with documentation, either on shutdown or
maybe whenever "apply/OK" is clicked.
So we'll eventually need a function that traverses the tree of config
options, looks for the ones that need their state saved, and then
spits out the right code to re-set them on restart. Something like
this:
;; Description: blah blah blah...
;; Type: boolean
;; Default: #f
(gnc:set-preference gnc:*double-entry-restriction* #t)
etc.
--
Rob Browning <[EMAIL PROTECTED]> PGP=E80E0D04F521A094 532B97F5D64E3930
--
Gnucash Developer's List
To unsubscribe send empty email to: [EMAIL PROTECTED]