GdlDock: Change in "layout_changed" semantics



Hi people,

I've just committed a patch to gdl which improves layout model handling
for GdlDock.  Now, the dock emits "layout_changed" signal for every
change in its layout, no matter if it's because of a user action or not
(previously, it was only emitted as a result of a user action).  This
allows the layout manager UI to present the real state of the dock in
its items list.

For example, if you load a plugin in anjuta2 which adds a dock item, the
new item appears immediately in the layout dialog.  Likewise, if you
unload the plugin, the item will be removed from the list.  Also, the
global locked property is now updated when any item is locked/unlocked. 
In short, the current implementation acts more like a true model of the
dock.

The new semantics of the "layout_changed" signal has a disadvantage: it 
can be emitted while you are still building the dock layout, and thus
overwrite the stored default layout if you load it before you are
finished constructing your UI.  This is easy to overcome though.  You
just need to load your layouts from the xml file after you add all the
items to the dock, and also be sure you don't save the layouts before
you loaded the file.  For example,

1. create the dock and the dock layout
2. add all the dock items
3. load the xml layouts file
4. load your preferred layout
5. connect to the layout manager "dirty" property notification to save
the layout file

Please let me know if you have any difficulties with the new
implementation.

Regards,
Gustavo




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