Further (XML)GUI issues
Vladimir Prus
ghost at cs.msu.su
Thu May 1 10:52:18 UTC 2008
On Thursday 01 May 2008 14:44:42 Alexander Dymo wrote:
> On Thursday 01 May 2008 09:44:49 you wrote:
> > It appears that the only solution is for plugin to provide as many
> > xmlguiclients as necessary, on demand?
> Yes, the question is only which API to provide. I'm thinking about something
> like
> 1) void IPlugin::setUpGui(KParts::MainWindow *w)
> where plugin would create guiclient, fill its action collection and use
> w->guiFactory()->addClient(...)
>
> 2) KXMLGUIClient *IPlugin::createGuiClient()
> where plugin would just create guiclient and return it and shell would use
> this function on demand.
>
> What I don't know is how to state the function contract (in the code) - that
> XMLGUIClient has to be created each time we ask plugin about it. Second
> function states the contract in the name so I like it better.
Me too.
>
>
> > > > 2. What code is responsible for saving the position of toolbars? For
> > > > me, the size and position of both main and debugger toolbars appear to
> > > > be changing randomly at times.
> > >
> > > KDevelop::MainWindow::loadSettings and ::saveSettings
> > > They eventually call KMainWindow::applyMainWindowSettings /
> > > saveMainWindowSettings. If something here doesn't work - that's because
> > > kdelibs code is broken.
> >
> > Brave :-) No, it's was a sublime problem, which I've fixed now.
> Where? :)
In particular, in MainWindow::setArea. Here's the comment in my local copy that
should explain something:
void MainWindow::setArea(Area *area)
{
bool differentArea = (area != d->area);
/* All views will be removed from dock area now. However, this does
not mean those are removed from area, so prevent slotDockShown
from recording those views as no longer shown in the area. */
d->ignoreDockShown = true;
/* Currently, area restore is three-step process.
1. Create main windows and areas. This calls setArea along the way.
2. Load plugins.
3. Load area settings and for each changed area, call setArea to
rebuild it.
During (1), toolbars provided by plugins are not yet present, so
their state is not restored. Absent the check above, the call
to setArea in (3) will save current settings that don't include
anything for plugin-contributed plugins. As result, the state
of plugin toolbars won't be saved in any way.
Probably, we better introduce separate 'reloadArea' method to be
used during area restore, instead of using setArea. */
if (differentArea)
saveSettings();
....
}
Now, it's not me to made loading of areas call setArea with the same area,
but in any case that's not a problem of kdelibs.
There's another problem with restoring mainwindow size, which origin I don't
know yet, and where kdelibs *might* be guilty, yet.
- Volodya
More information about the KDevelop-devel
mailing list