How to properly save/restore toolbar UI state
Alexander Dymo
alexander.dymo at gmail.com
Fri Dec 31 15:03:18 UTC 2010
2010/12/5 Andreas Pakulat <apaku at gmx.de>:
> On 04.12.10 22:18:27, Milian Wolff wrote:
>> Did you ever think of properly saving and restoring the UI state of toolviews?
Yes.
>> If not, what do you think should I do to fix this?
> I think the only way to do this is adding a new interface which has a
> save/restore function taking a KConfigGroup. Then toolview factory would
> always return this interface. Or you put a save/restore on the factory
> providing the QWidget of the toolview instance and a kconfiggroup. Then
> the factory could internally cast the widget to the right type and
> query/set the config stuff.
>
> Though when to do the save and restore, I have no idea...
For documents:
- restore: on creation (usually when the first view is opened)
- store: anytime you need, and on deletion (usually when the first
view is closed)
- both document store/restore should be global, kdevelop-wide
For views:
- restore: when view is displayed in a area (there's a widget to work
with at this point)
- store: anytime you need, and before widget deletion (usually when
view is closed)
- both view store/restore should be area-dependent, view index in area dependent
There should be API to store()/restore() in Sublime::Document and
Sublime::View. In current architecture, there should be callback in
toolview factory as well. None of that is done of course.
More information about the KDevelop-devel
mailing list