Coupling of preferences internal references and UI rendering

Derek Atkins warlord at MIT.EDU
Tue Mar 2 11:11:59 EST 2010


Jeff Kletsky <gnucash at allycomm.com> writes:

> When I look at the code for setting preferences, such as in
> src/business/business-utils/business-prefs.scm
> it appears to me that there is a "hard link" between the access to the
> preference and the UI rendering
>
> (define (book-options-generator options)
>   (define (reg-option new-option)
>     (gnc:register-option options new-option))
>
>   (reg-option
>    (gnc:make-string-option
>     gnc:*business-label* gnc:*company-name*
>     "a" (N_ "The name of your business") ""))
>
> As I understand it, the combination of gnc:*business-label*
> gnc:*company-name* is used to identify the preference in the code, as
> well as identifying it to be rendered on the gnc:*business-label* tab.

That is correct, the layout of dynamic options is tied to the page.

> Once an option like this is created, is there any way to have it
> appear (in the future) on a different tab, without having to change
> all the code references to the preference?

Nope.  And if you do move it then it will lose access to previous
settings of the option.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-devel mailing list