KMessageBox customizable cancel button

Reinhold Kainhofer reinhold at kainhofer.com
Wed Mar 28 22:57:38 BST 2007


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

Am Mittwoch, 28. März 2007 schrieb Thomas Friedrichsmeier:
> > An API which maybe could be nice would be
> >
> > KMessageBox box(
> >          KMessageBox::YesNoCancel, "Message", "caption",
> > "dontaskagainsave"); box.setYesButton( i18n("Save") );
> > box.setNoButton( i18n("Discard") );
> > box.setCancelButton( i18n("Don't quit") );
> > int result = box.exec();
>
> Well, that's an entirely different beast. And in fact, while *adding* this
> sort of API should be pretty easy, and possible even after KDE4, *changing*
> it would be an enormous task, indeed. One that I certainly won't have the
> time to undertake.

I think it's far more frequent to use the static methods of KMessageBox rather 
than explicitly allocating a KMessageBox object. These methods cannot be 
changed (unless you completely get rid of them, which I don't think is a good 
idea). As a result, the KMessageBox API would be quite inconsistent with the 
static methods containing the texts for the buttons, while the constructors 
don't.

Cheers,
Reinhold

- -- 
- ------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: reinhold at kainhofer.com, http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer maintainer
 * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGCuTWTqjEwhXvPN0RAoO8AKCKBEN0iK4peWTmOIIPWgMzrHqIIwCgkY6B
j/LemPegEAihCwW8MWbAfN4=
=TpmQ
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list