KUtils
KSettings::PluginPage Class Reference
[Settings UI classes, Plugin handling classes]
Convenience KCModule for creating a plugins config page.
More...
#include <pluginpage.h>
Public Member Functions | |
virtual void | defaults () |
virtual void | load () |
PluginPage (KInstance *instance, QWidget *parent=0, const QStringList &args=QStringList()) | |
PluginPage (QWidget *parent=0, const char *name=0, const QStringList &args=QStringList()) | |
KPluginSelector * | pluginSelector () |
virtual void | save () |
~PluginPage () |
Detailed Description
Convenience KCModule for creating a plugins config page.This class makes it very easy to create a plugins configuration page to your program. All you need to do is create a class that is derived from PluginPage and add the appropriate plugin infos to the KPluginSelector. This is done using the pluginSelector() method:
typedef KGenericFactory<MyAppPluginConfig, QWidget> MyAppPluginConfigFactory; K_EXPORT_COMPONENT_FACTORY( kcm_myapppluginconfig, MyAppPluginConfigFactory( "kcm_myapppluginconfig" ) ); MyAppPluginConfig( QWidget * parent, const char *, const QStringList & args ) : PluginPage( MyAppPluginConfigFactory::instance(), parent, args ) { pluginSelector()->addPlugins( KGlobal::instance()->instanceName(), i18n( "General Plugins" ), "General" ); pluginSelector()->addPlugins( KGlobal::instance()->instanceName(), i18n( "Effects" ), "Effects" ); }
All that remains to be done is to create the appropriate .desktop file
[Desktop Entry] Encoding=UTF-8 Icon=plugin Type=Service ServiceTypes=KCModule X-KDE-ModuleType=Library X-KDE-Library=myapppluginconfig X-KDE-FactoryName=MyAppPluginConfigFactory X-KDE-ParentApp=myapp X-KDE-ParentComponents=myapp Name=Plugins Comment=Select and configure your plugins:
- Since:
- 3.2
Definition at line 73 of file pluginpage.h.
Constructor & Destructor Documentation
KSettings::PluginPage::PluginPage | ( | QWidget * | parent = 0 , |
|
const char * | name = 0 , |
|||
const QStringList & | args = QStringList() | |||
) |
Standart KCModule constructor.
Automatically creates the the KPluginSelector widget.
Definition at line 40 of file pluginpage.cpp.
KSettings::PluginPage::PluginPage | ( | KInstance * | instance, | |
QWidget * | parent = 0 , |
|||
const QStringList & | args = QStringList() | |||
) |
Standart KCModule constructor.
Automatically creates the the KPluginSelector widget.
Definition at line 49 of file pluginpage.cpp.
KSettings::PluginPage::~PluginPage | ( | ) |
Definition at line 60 of file pluginpage.cpp.
Member Function Documentation
void KSettings::PluginPage::defaults | ( | ) | [virtual] |
void KSettings::PluginPage::load | ( | ) | [virtual] |
Load the state of the plugins (selected or not) from the KPluginInfo objects.
For KParts plugins everything should work automatically. For your own type of plugins you might need to reimplement the KPluginInfo::pluginLoaded() method. If that doesn't fit your needs you can also reimplement this method.
Reimplemented from KCModule.
Definition at line 70 of file pluginpage.cpp.
KPluginSelector * KSettings::PluginPage::pluginSelector | ( | ) |
void KSettings::PluginPage::save | ( | ) | [virtual] |
Save the state of the plugins to KConfig objects.
Reimplemented from KCModule.
Definition at line 75 of file pluginpage.cpp.
The documentation for this class was generated from the following files: