[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: mimetype specific information
From:       Hans Meine <hans_meine () gmx ! net>
Date:       2001-10-29 23:40:20
[Download RAW message or body]

Rolf Magnus <ramagnus@zvw.de> writes:

> On Monday 22 October 2001 19:46, David Faure wrote:
> 
> > Initially I had in mind that this should be a module for kio_file, so that
> > kio_file returns those additional fields via the UDS_* stuff (see previous
> > discussions with Alex Neundorf), but your idea is simpler (which is good!).
> > Let konqueror use those modules directly - if the modules really want to
> > do network transparency, they can still use kio for that (e.g. over
> > smb/ftp).
> 
> So where should this plugin system be added? The file manager view directly or 
> the KMimeType class? Could this be added to the propertyNames() and 
> property() methods of KMimeType or do these serve another purpose? I'm not 
> that much into this yet, but would like to give it a try.

I knew I would want to have the following mail at hand some day.. It
clearly shows how long the discussed feature (actually, only one of
them) already exists..
________________________________________________________________________

From: Simon Hausmann <shaus@helios.Med.Uni-Magdeburg.DE>
Subject: Re: Writing KParts plugins
To: kde-core-devel@max.tat.physik.uni-tuebingen.de
Date: Mon Jul  3 10:08:49 2000 +0200
Resent-From: kde-core-devel@max.tat.physik.uni-tuebingen.de
Reply-To: kde-core-devel@max.tat.physik.uni-tuebingen.de

On Sun, 2 Jul 2000, David Faure wrote:
> On Sun, Jul 02, 2000 at 03:54:16PM +0100, Richard Moore wrote:
> > David Faure wrote:
> > > > For instance I cannot see how to write a plugin that adds a
> > > > page to a properties dialog
> > > That's more Simon's stuff, but look in
> > > koffice/lib/kofficecore/koDocInfoPropsPage or so, for an
> > > example.
> > 
> > Does that apply to Konqueror as well as to KOffice stuff?
> 
> Hmm ? The properties dialog is something completely separate, and
> defined in kdelibs/kfile/kpropsdlg.*
> Simon would be able to tell more, but AFAIK the properties dialog
> queries for services that implement a given service type
> ('properties dialog page' or something) for the mimetype of the
> file, and if found, it will create the additionnal pages for it
> (with a factory, you guessed it).  This has in fact nothing to do
> with KParts plugins at all.

Yep..

All you need to do is to make your KLibFactory based shlib export a
KPropsPage, create a service .desktop file for your properties dialog
plugin and make it implement the KPropsDlg/Plugin servicetype and a
mimetype. Then you'll get the KPropertiesDialog as parent object for your
KPropsPage object. You can then use the dialog() method of
KPropertiesDialog to get a reference to the KDialogBase and then call
addPage to insert your tabs (note the plural :) . Also make sure to emit
the changed() signal whenever the user edited something in your
tabwidgets, in order to make KPropsDlg properly call applyChanges() when
the user presses apply. (-> applyChanges is called on on those plugins
that emitted the signal at least once, in order to avoid unnecessary
applyChanges() calls (->less disk traffic, etc.) .


As David already mentioned: Have a look at the document info properties
dialog plugin in koffice/lib/kofficecore/ :)

Bye,
 Simon
________________________________________________________________________

-- 
Ciao,  /  /
      /--/
     /  / ANS                          .,* Hamburg, Germany *,.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic