--===============0501335334== Content-Type: multipart/signed; boundary="nextPart2307961.mmF6bnb5MI"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart2307961.mmF6bnb5MI Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi all, on Wednesday 07 December 2005 14:36, Bram Biesbrouck wrote: > Hi, > > Can anyone tell me what's the best way to enable or disable actions from > (deep) within a program's code? Currently, I'm using this: > > KMainWindow* kmwin =3D dynamic_cast(topLevelWidget()); > if (kmwin) > kmwin->action("justAnAction")->setEnabled(true); > > I'm aware this doesn't always work if the topLevelWidget isn't a > KMainWindow, but it does in my case. > But it doesn't look that pretty and it isn't very manageable. Maybe > using state changes, but that doesn't change the fact the mainWin is > accessed from all over the program. > > any thoughts? Maybe [1] gives you some ideas on how to solve this problem. [1] http://developer.kde.org/documentation/tutorials/xmlui/notes.html =2D-=20 Regards Thomas Baumgart thb@net-bembel.de Check the KMyMoney open source http://www.net-bembel.de/ project at http://kmymoney2.sf.net/ public key available under thb@net-bembel.de at http://www.keyserver.net GPG-FP: E55E D592 F45F 116B 8429 4F99 9C59 DB40 B75D D3BA =2D------------------------------------------------------------ 'I used that other operating system* (now to be considered open source? ) for some years' - anonymous source =2D------------------------------------------------------------ --nextPart2307961.mmF6bnb5MI Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: http://www.net-bembel.de/ iD8DBQBDlyZenFnbQLdd07oRArFpAJ98tpf2TV0Ht9rQgkm5mwVpZno7oQCgwoTX 2lW4J9cR3rOKzB9Vqyy+cdM= =vS20 -----END PGP SIGNATURE----- --nextPart2307961.mmF6bnb5MI-- --===============0501335334== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --===============0501335334==--