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

List:       kde-core-devel
Subject:    Re: Writing KParts plugins
From:       Simon Hausmann <shaus () helios ! Med ! Uni-Magdeburg ! DE>
Date:       2000-07-03 8:08:49
[Download RAW message or body]



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

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

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