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

KUtils

KSettings::Dialog

KSettings::Dialog Class Reference

Generic configuration dialog that works over component boundaries. More...

#include <dialog.h>

Inheritance diagram for KSettings::Dialog:

Inheritance graph
[legend]

List of all members.


Signals

void pluginSelectionChanged ()

Public Member Functions

void addPluginInfos (const QList< KPluginInfo > &plugininfos)
bool allowComponentSelection () const
 Dialog (const QStringList &components, QWidget *parent=0)
 Dialog (QWidget *parent=0)
QList< KPluginInfo > pluginInfos () const
void setAllowComponentSelection (bool allowSelection)
void setComponentBlacklist (const QStringList &blacklist)
void setKCMArguments (const QStringList &arguments)
 ~Dialog ()

Protected Member Functions

void showEvent (QShowEvent *)

Detailed Description

Generic configuration dialog that works over component boundaries.

For more information see KSettings.

This class aims to standardize the use of configuration dialogs in KDE applications. Especially when using KParts and/or Plugins you face problems creating a consistent config dialog.

To show a configuration dialog you only have to call the show method and be done with it. A code example:

You initialize m_cfgdlg with

 m_cfgdlg = new Dialog( this );
If you use a KPart that was not especially designed for your app you can use the second constructor:
 QStringList kpartslist;
 for( all my kparts )
   kpartslist += m_mypart->componentData().componentName();
 m_cfgdlg = new Dialog( kpartslist, this );
and the action for the config dialog is connected to the show slot:
 KStandardAction::preferences( m_cfgdlg, SLOT( show() ), actionCollection() );

If you need to be informed when the config was changed and applied in the dialog you might want to take a look at Dispatcher.

For more information see KSettings.

Author:
Matthias Kretz <kretz@kde.org>

Definition at line 73 of file dialog.h.


Constructor & Destructor Documentation

KSettings::Dialog::Dialog ( QWidget *  parent = 0  )  [explicit]

Construct a new Preferences Dialog for the application.

It uses all KCMs with X-KDE-ParentApp set to KGlobal::mainComponent().componentName().

Parameters:
content Select whether you want a static or configurable config dialog.
parent The parent is only used as the parent for the dialog - centering the dialog over the parent widget.

Definition at line 46 of file dialog.cpp.

KSettings::Dialog::Dialog ( const QStringList &  components,
QWidget *  parent = 0 
) [explicit]

Construct a new Preferences Dialog with the pages for the selected instance names.

For example if you want to have the configuration pages for the kviewviewer KPart you would pass a QStringList consisting of only the name of the part "kviewviewer".

Parameters:
components A list of the names of the components that your config dialog should merge the config pages in.
parent The parent is only used as the parent for the dialog - centering the dialog over the parent widget.

Definition at line 51 of file dialog.cpp.

KSettings::Dialog::~Dialog (  ) 

Definition at line 58 of file dialog.cpp.


Member Function Documentation

void KSettings::Dialog::addPluginInfos ( const QList< KPluginInfo > &  plugininfos  ) 

If you use a Configurable dialog you need to pass KPluginInfo objects that the dialog should configure.

bool KSettings::Dialog::allowComponentSelection (  )  const

Definition at line 67 of file dialog.cpp.

KPluginInfo::List KSettings::Dialog::pluginInfos (  )  const

Returns a list of all KPluginInfo objects the dialog uses.

Definition at line 106 of file dialog.cpp.

void KSettings::Dialog::pluginSelectionChanged (  )  [signal]

If you use the dialog in Configurable mode and want to be notified when the user changes the plugin selections use this signal.

It's emitted if the selection has changed and the user pressed Apply or Ok. In the slot you would then load and unload the plugins as requested.

void KSettings::Dialog::setAllowComponentSelection ( bool  allowSelection  ) 

Tells the dialog whether the entries in the listview are all static or whether it should add checkboxes to select which parts of the optional functionality should be active or not.

Note that this function only works before showing the dialog for the first time.

Defaults to false.

Parameters:
allowSelection true The user can select what functionality he wants.
allowSelection false While running no entries are added or deleted

Definition at line 62 of file dialog.cpp.

void KSettings::Dialog::setComponentBlacklist ( const QStringList &  blacklist  ) 

Set the blacklisted component list.

Any KCM that lists one of the components in the given blacklist is not loaded even if it would fit otherwise. This is a way to explicitly prevent loading of certain KControlModules.

Note that this function only works before showing the KSettings::Dialog for the first time.

Parameters:
blacklist the list of components that prevent a KCM from being loaded

Definition at line 78 of file dialog.cpp.

void KSettings::Dialog::setKCMArguments ( const QStringList &  arguments  ) 

Sets the argument list that is given to all the KControlModule's when they are created.

Use this if you have KControlModule's that need special arguments to work

Note that this function only works before showing the KSettings::Dialog for the first time.

Parameters:
arguments The list of arguments passed to each KCM

Definition at line 72 of file dialog.cpp.

void KSettings::Dialog::showEvent ( QShowEvent *   )  [protected]

Reimplemented to lazy create the dialog on first show.

Definition at line 111 of file dialog.cpp.


The documentation for this class was generated from the following files:
  • dialog.h
  • dialog.cpp

KUtils

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal