KIconDialog

Carsten Pfeiffer carpdjih at mailbox.tu-berlin.de
Tue Dec 17 23:57:11 GMT 2002


-----BEGIN PGP SIGNED MESSAGE-----

On Tuesday 17 December 2002 21:39, Rob Kaper wrote:
> I've got a question about KIconDialog. Would it be possible (and desirable)
> to extend it so that a user can only choose between a set of application
> provided paths?
>
> I need to let the user chose from a set of icons in Atlantik to be used as
> avatar/token. He should only be able to chose from the real icon set
> though, so all other clients have that icon as well.
>
> KIconDialog currently gives the user too much freedom.. or should I use the
> icon file view for this sort of stuff?

I remember the KIconDialog classes being hard to extend, with sideeffects here 
and there.... I think I fixed most of the problems, but your requirements may 
bring up new ones.

I think you want the directory listing and the displaying and selection of 
files in those directories.

That's basically

KURL startDir = "file:/....";
KDirOperator *operator = new KDirOperator( startDir, this );
connect( operator, SIGNAL( fileSelected( const KFileItem * )),
         SLOT( slotIconSelected( const KFileItem * )));
KFileIconView *view = new KFileIconView( operator );
operator->setView( view );
connect( operator, SIGNAL( finishedLoading() ),
         view, SLOT( showPreviews() ));
operator->show();

Maybe hacking KIconDialog gives better results. Note that KIconDialog loads 
the icons synchronously, the above code asynchronously.

Cheers
Carsten Pfeiffer
-----BEGIN PGP SIGNATURE-----

iQEVAwUBPf+52aWgYMJuwmZtAQEotQgAwYPNZxtoPDPgDyOQyv4psLrbgSnmbAgr
fFlchcO1zxXEwgvUDSRQTfEJr+TwmssiUUhXP2GjOeFC2rI/zDm9On2oUvNDEvmD
onuaI4fJJm2iHkFV2FrcK1Lw3w1kTqK1qn3Dz9W2j1mzR+yCG+VHhCIUG2LGNxJh
drXmERY2qDLkVx5mx8zayDCoK1wnJbsFOSrHYNxmRGKaUx+L5FbrW+EKGfDXj3rN
yaytBsC6KHGukSOMK1EVIi6jDipl5N6C47jEgbOqOaxRftXReeNmRl/Ax2SBgxs1
PYFMK6t2PKXomhecnVwgiXlSNHYQSO8LjGBFktBqJfLbd029uo+8xg==
=y+LO
-----END PGP SIGNATURE-----





More information about the kde-core-devel mailing list