2008/3/15, Aubanel MONNIER <aubanel@...400...>:


2008/3/14, bulia byak <buliabyak@...400...>:
On Fri, Mar 14, 2008 at 11:59 AM, Aubanel MONNIER <aubanel@...400...> wrote:
> OK, just committed something using this kind of code and making use of prefs
> so anyone can add sensible defaults to preferences-skeletton.


Some comments:

max_presets="7" - why so few? If I'm doing serious work I may have
dozens of my own presets. It's like the maximum number of recent
documents in File menu - most other apps have 4 or 5 which alone makes
them nearly useless for serious work. Inkscape has 36, and even that
only because otherwise the submenu wouldn't fit into the screen :)

that's temporary, I need  a way to query the preferences for the number of sub-prefs in a group. That should'nt be too hard.

It's misleading when it claims that I have "Dip pen" active when I
didn't choose it, or have already changed some parameters. It must
show no preset by default, until I choose one. Here's what I propose:

- remove the "Profiles:" label
- add a new item to the top of menu: "No preset", which will be chosen
by default and will also serve to explain the purpose of this control

- when I change something and it does not match the current present,
let this control sense that and switch to No preset automatically

That's one of the possibility I envisionned, so OK, I'll do that 

- eventually, add "New preset" (with a dialog popping up for typing a
name) and "Delete preset" (disabled if no preset is current) to the
bottom of the menu

I'm not a great fan of popups but I guess that's the easiest to implement.

--
bulia byak
Inkscape. Draw Freely.
http://www.inkscape.org


Ok, I'v been fiddling with that and I'm quite stuck with some limitations of the prefs API.
I need a way to get each children without knowing it's id (I did that with reprs ans XML::Nodes but that break encapsulation, should I add a function in the prefs API that returns a GSList of strings for the ids of the children to be queried later by the pref API ?)
I need a way to create a child preference. I have difficulies in making that work too, I tried something like:
Node *parent=the_parent;
Node new_child=parent->document()->createElement("group");
but that does not seem to work. Any hint ?
About breaking encapsulation, I'm not sure of what I must do, because the xml/nodes.h interface is already included in toolbox.cpp and it requires to add non-frequently used elsewhere functions into prefs and introduces additional memory considerations (should I free or should I go ? ) on the GSList. OTOH breaking encapsulation is bad for the day we change the prefs implementation.

Another different topic, I need a way to be notified that a setting has been changed from the toolbox. I such a signal existing somewhere ?

Tank you for any direction,
Cheers,
Aubanel.