Icon choosing in kedittoolbar

Andras Mantia amantia at kde.org
Wed Apr 28 14:40:38 BST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 28 April 2004 13:39, David Faure wrote:
> On Wednesday 28 April 2004 12:25, Andras Mantia wrote:
> > Not related to your implementation but to toolbar editing. I've
> > implemented some time ago the ability to edit a toolbar from the
> > RMB menu in Quanta, and a new ctor for KEditToolbar was introduced
> > by that time, which takes a defaultToolbar argument to specify the
> > toolbar that you are editing.
> >  The idea is to use such an implementation globally, so when you
> > use RMB->Configure Toolbars... the edit toolbar dialog will show
> > the toolbar that you have clicked on, not the first one in the
> > list. If you think it makes sense, I volunteer to implement.
>
> Sure, that makes sense. Especially if all toolbars are still in the
> combo, so this is only about pre-selecting one.

After looking at the code, I don't think that it's possible to solve in 
a BC way. The Configure Toolbars item appears if the main application 
uses the standard configure toolbars action, so the invocation of the 
KEditToolbar is done in the main application and there is no difference 
between calling the action from the main menu or from the context menu. 
My solution would be:
- - add a static method and variable to KEditToolbar to store the current 
toolbars name. This variable is set from 
KToolBar::slotContextAboutToShow and reset to QString::null in 
KToolBar::slotContextAboutToHide
- - if the old ctor of KEditToolbar is used (without the defaultToolbar 
argument), the default toolbar is set to this member variable (if it 
was QString::null, there is no change compared to the current behavior, 
so everything is fine if the action is called from other place than the 
toolbar context menu).

Introducing a static method is not a problem, but how can I deal with 
the static variable to maintain BC? Or should I introduce a global 
variable?

Andras

- -- 
Quanta Plus developer - http://quanta.sourceforge.net
K Desktop Environment - http://www.kde.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAj7RbTQdfac6L/08RAj5IAKCEH0UWmYpeM0eReEI/jQ3SYdrx8QCgmgb9
QegDZFE0FqYfB8gj2909O+4=
=kSk7
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list