From kde-core-devel Thu Apr 29 23:11:30 2004 From: David Faure Date: Thu, 29 Apr 2004 23:11:30 +0000 To: kde-core-devel Subject: Re: Icon choosing in kedittoolbar Message-Id: <200404300111.30736.faure () kde ! org> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=108328029705534 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_iuYkArHXo7R6wxF" --Boundary-00=_iuYkArHXo7R6wxF Content-Type: text/plain; charset="iso-8859-1"; boundary="" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Friday 30 April 2004 00:53, David Faure wrote: > Well you apparently need to fix much more than that, in particular letting > the normal xmlgui plugging mechanism do its work (you're creating a real toolbar, > so AFAICS it should work, if xmlguifactory can find the action). Just to prove that it works indeed: proof-of-concept patch attached. Note the TODO, and note that you'll have to fix slotRemoveToolbar to fix the crash on exit :). And you can probably clean up a lot of slotConfigureToolbars(). But the point is that it works fine that way, with no manual plugging, the toolbars appear and the edittoolbar dialog works as you expect. -- David Faure, faure@kde.org, sponsored by Trolltech to work on KDE, Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org). --Boundary-00=_iuYkArHXo7R6wxF Content-Type: text/x-diff; charset="iso-8859-1"; name="quanta.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="quanta.diff" Index: quanta.cpp =================================================================== RCS file: /home/kde/kdewebdev/quanta/src/quanta.cpp,v retrieving revision 1.523 diff -u -p -r1.523 quanta.cpp --- quanta.cpp 28 Apr 2004 11:30:43 -0000 1.523 +++ quanta.cpp 29 Apr 2004 23:06:10 -0000 @@ -1630,6 +1630,7 @@ QWidget* QuantaApp::createContainer( QWi QuantaToolBar *tb = new QuantaToolBar(w, element.attribute("name"), true, true); tb->loadState(element); tb->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); +#if 0 KAction *action; QDomNode node = element.firstChild(); while (!node.isNull()) @@ -1639,6 +1640,7 @@ QWidget* QuantaApp::createContainer( QWi action = actionCollection()->action(node.toElement().attribute("name") ); if (action) { + kdDebug() << k_funcinfo << "manually plugging action " << action->name() << endl; action->plug(tb); } } @@ -1651,6 +1653,7 @@ QWidget* QuantaApp::createContainer( QWi tb->insertLineSeparator(); node = node.nextSibling(); } +#endif //kdDebug(24000) << "QuantaToolBar minimumSizeHeight :" << tb->minimumSizeHint().height() << endl; if (tb->minimumSizeHint().height() > 30) { @@ -2095,6 +2098,11 @@ void QuantaApp::slotLoadToolbarFile(cons } } + // Make all actions available to the guiclient + // (TODO rewrite in a less-deprecated way....) + // (Note that insert() isn't deprecated anymore, that was temporary) + *(toolbarGUI->actionCollection()) += *actionCollection(); + guiFactory()->addClient(toolbarGUI); //Plug in the actions & build the menu --Boundary-00=_iuYkArHXo7R6wxF--