Re: Milestones document



> 
> On Mon, 6 Dec 1999, NotZed wrote:
> > On that note, writing prefs dialogues and config saving sux bigtime -
> > so much bloat for so little functionality, but anyway.
> 
> Check out app/preferences.c in Dia. I'm pretty proud of that piece of 
> code.

Well this at least addresses one problem the other code doesn't - packing
the data from a preferences screen in a way you can actually use 
(without having to look up everything through an indirect handle).

Still, the layout is a bit basic, interfacing with libglade would be
nicer (and pretty easy).

I think the system needs to have 3 basic layers (which dia's code
basically does):

1. Interface, using libglade, and maybe some mechanism to control
   how it works (like disabling groups of options depending on others
   etc).  This is initialised and builds the structure in layer 3.
2. A packed binary structure, used by the application to control its
   preferences.  Makes it trivial to revert local changes and so forth
   too.
3. A way to save and load those options in the packed binary format to the
   current config, and/or session, etc.

The packed binary structure could use bitmasks (not bitfields) for
storing checkboxes efficiently (so they can be de/encoded by a driver),
en/decode enumerations from options boxes for you, and work out how to
get/set a 'string' from whatever input boxes do strings.  And could be
driven from a simple table, generated at build time (or maybe
generated runtime, but then you can't use your binary structure).

Anyway, I think i'm gonna do something like this for g-t, and see how
it goes.

 Michael



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]