• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KUtils

Classes | Public Types | Signals | Public Member Functions | List of all members
KPluginSelector Class Reference

#include <kpluginselector.h>

Inheritance diagram for KPluginSelector:
Inheritance graph
[legend]

Classes

class  Private
 

Public Types

enum  PluginLoadMethod { ReadConfigFile = 0, IgnoreConfigFile }
 

Signals

void changed (bool hasChanged)
 
void configCommitted (const QByteArray &componentName)
 

Public Member Functions

 KPluginSelector (QWidget *parent=0)
 
 ~KPluginSelector ()
 
void addPlugins (const QString &componentName, const QString &categoryName=QString(), const QString &categoryKey=QString(), KSharedConfig::Ptr config=KSharedConfig::Ptr())
 
void addPlugins (const KComponentData &instance, const QString &categoryName=QString(), const QString &categoryKey=QString(), const KSharedConfig::Ptr &config=KSharedConfig::Ptr())
 
void addPlugins (const QList< KPluginInfo > &pluginInfoList, PluginLoadMethod pluginLoadMethod=ReadConfigFile, const QString &categoryName=QString(), const QString &categoryKey=QString(), const KSharedConfig::Ptr &config=KSharedConfig::Ptr())
 
void defaults ()
 
bool isDefault () const
 
void load ()
 
void save ()
 
void updatePluginsState ()
 

Detailed Description

A widget to select what plugins to load and configure the plugins.

It shows the list of available plugins

Since the user needs a way to know what a specific plugin does every plugin sould install a desktop file containing a name, comment and category field. The category is useful for applications that can use different kinds of plugins like a playlist, skin or visualization

The location of these desktop files is the share/apps/<instancename>/<plugindir> directory. But if you need you may use a different directory

You can add plugins from different KConfig[group], by just calling all times you want addPlugins method with the correct parameters

Additionally, calls to constructor with same categoryName, will add new items to the same category, even if plugins are from different categories

Author
Matthias Kretz kretz.nosp@m.@kde.nosp@m..org
Rafael Fernández López eresl.nosp@m.ibre.nosp@m.@kde..nosp@m.org

Definition at line 58 of file kpluginselector.h.

Member Enumeration Documentation

enum KPluginSelector::PluginLoadMethod
Enumerator
ReadConfigFile 
IgnoreConfigFile 

Definition at line 64 of file kpluginselector.h.

Constructor & Destructor Documentation

KPluginSelector::KPluginSelector ( QWidget *  parent = 0)

Create a new KPluginSelector.

Definition at line 247 of file kpluginselector.cpp.

KPluginSelector::~KPluginSelector ( )

Destructor.

Definition at line 286 of file kpluginselector.cpp.

Member Function Documentation

void KPluginSelector::addPlugins ( const QString &  componentName,
const QString &  categoryName = QString(),
const QString &  categoryKey = QString(),
KSharedConfig::Ptr  config = KSharedConfig::Ptr() 
)

Add a list of KParts plugins.

The information about the plugins will be loaded from the share/apps/<instancename>/kpartplugins directory

Parameters
componentNameThe name of the KComponentData of the plugin's parent.
categoryNameThe translated name of the category. This is the name that is shown in the title. If the category did exist before because of another call to addPlugins, then they will be shown in that category. If categoryName is a new one, then a new category will be shown on the plugin window, and the list of plugins added to it
categoryKeyWhen you have different categories of KParts plugins you distinguish between the plugins using the Category key in the .desktop file. Use this parameter to select only those KParts plugins with the Category key == categoryKey. If categoryKey is not set the Category key is ignored and all plugins are shown. Not match case
configThe KConfig object that holds the state of the plugins being enabled or not. By default it should be componentData.config(). It is recommended to always pass a KConfig object if you use KSettings::PluginPage since you never know from where the page will be called (think global config app). For example KViewCanvas passes KConfig( "kviewcanvas" )

Definition at line 293 of file kpluginselector.cpp.

void KPluginSelector::addPlugins ( const KComponentData &  instance,
const QString &  categoryName = QString(),
const QString &  categoryKey = QString(),
const KSharedConfig::Ptr &  config = KSharedConfig::Ptr() 
)

Add a list of KParts plugins.

Convenience method for the one above. If not set explicitly, config is set to componentData.config()

Definition at line 317 of file kpluginselector.cpp.

void KPluginSelector::addPlugins ( const QList< KPluginInfo > &  pluginInfoList,
PluginLoadMethod  pluginLoadMethod = ReadConfigFile,
const QString &  categoryName = QString(),
const QString &  categoryKey = QString(),
const KSharedConfig::Ptr &  config = KSharedConfig::Ptr() 
)

Add a list of non-KParts plugins.

Parameters
pluginInfoListA list of KPluginInfo objects containing the necessary information for the plugins you want to add to the list
pluginLoadMethodIf KPluginSelector will try to load the state of the plugin when loading the dialog from the configuration file or not. This is useful if for some reason you called the setPluginEnabled() for each plugin individually before loading the dialog, and don't want KPluginSelector to override them when loading
categoryNameThe translated name of the category. This is the name that is shown in the title. If the category did exist before because of another call to addPlugins, then they will be shown in that category. If categoryName is a new one, then a new category will be shown on the plugin window, and the list of plugins added to it
categoryKeyWhen you have different categories of KParts plugins you distinguish between the plugins using the Category key in the .desktop file. Use this parameter to select only those KParts plugins with the Category key == categoryKey. If categoryKey is not set the Category key is ignored and all plugins are shown. Not match case
configThe KConfig object that holds the state of the plugins being enabled or not. By default it will use KGlobal::config(). It is recommended to always pass a KConfig object if you use KSettings::PluginPage since you never know from where the page will be called (think global config app). For example KViewCanvas passes KConfig("kviewcanvas")
Note
All plugins that were set a config group using setConfig() method will load and save their information from there. For those that weren't any config object, config will be used

Definition at line 325 of file kpluginselector.cpp.

void KPluginSelector::changed ( bool  hasChanged)
signal

Tells you whether the configuration is changed or not.

void KPluginSelector::configCommitted ( const QByteArray &  componentName)
signal

Emitted after the config of an embedded KCM has been saved.

The argument is the name of the parent component that needs to reload its config

void KPluginSelector::defaults ( )

Change to applications defaults.

See also
isDefault()

Definition at line 366 of file kpluginselector.cpp.

bool KPluginSelector::isDefault ( ) const

Returns true if the plugin selector does not have any changes to application defaults.

See also
defaults()
Since
4.3

Definition at line 377 of file kpluginselector.cpp.

void KPluginSelector::load ( )

Load the state of the plugins (selected or not) from the KPluginInfo objects.

Definition at line 341 of file kpluginselector.cpp.

void KPluginSelector::save ( )

Save the configuration.

Definition at line 353 of file kpluginselector.cpp.

void KPluginSelector::updatePluginsState ( )

Updates plugins state (enabled or not)

This method won't save anything on any configuration file. It will just be useful if you added plugins with the method:

void addPlugins(const QList<KPluginInfo> &pluginInfoList,
const QString &categoryName = QString(),
const QString &categoryKey = QString(),
const KSharedConfig::Ptr &config = KSharedConfig::Ptr());

To sum up, this method will update your plugins state depending if plugins are ticked or not on the KPluginSelector dialog, without saving anything anywhere

Definition at line 390 of file kpluginselector.cpp.


The documentation for this class was generated from the following files:
  • kpluginselector.h
  • kpluginselector.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:35 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KUtils

Skip menu "KUtils"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal