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.
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() ));
Maybe hacking KIconDialog gives better results. Note that KIconDialog loads
the icons synchronously, the above code asynchronously.
-----BEGIN PGP SIGNATURE-----
-----END PGP SIGNATURE-----
More information about the kde-core-devel