gEDA-dev: Filechooser and component selector code
Peter C.J. Clifton
pcjc2 at cam.ac.uk
Sat Sep 2 07:29:43 EDT 2006
Hi,
I'm continuing work to split the component selector away from the
file-chooser code in gschem. This will allow more divergence between those
functions, and ought to allow better abstracted GTK+ programming.
My roadmap for this is:
1. Split x_fileselect.c into x_fileselect.c, and x_compselect.c,
refactoring without re-writing too much. Unused data-structure members will
be removed. (NEARLY DONE) 2. Re-write x_compselect.c to be a subclassed
GTK+ widget 3. Consider re-writing x_fileselect.c to better abstract gschem
operations from the GTK+ code. 4. Copy x_fileselect.c and adapt for
gattrib. Perhaps ideally, we should have a place in libgeda for standard
"gaf" widgets, dialogs etc.., and this code should be shared there.
Is it common / best practice to subclass a GTK+ file-chooser dialog, or
simply to "use" it from within your code - like is done at the moment?
Would we subclass each special case (Open, Saveas, Saveas with "Discard
changes"), or provide one subclass which has methods to invoke all of them.
As part of the refactor in step 1, I was unable to help myself fixing the
mess of "OPEN SAVEAS SAVEAS_NONE SAVEAS..." flags, leaving only "OPEN,
SAVEAS, SAVEAS_CLOSE" as used in the code. It was only natural at this
point to add the extra "if" statement to fix the "Discard changes" button
is always offered in the save dialogs.
Regards
Peter Clifton
More information about the geda-dev
mailing list