KUtils
KSettings::Dialog Class Reference
[Main classes, Settings UI classes]
Generic configuration dialog that even works over component boundaries.
More...
#include <dialog.h>
Public Types | |
enum | ContentInListView { Static, Configurable } |
Public Slots | |
void | show () |
Signals | |
void | pluginSelectionChanged () |
Public Member Functions | |
void | addPluginInfos (const QValueList< KPluginInfo * > &plugininfos) |
KCMultiDialog * | dialog () |
Dialog (const QStringList &components, ContentInListView content, QWidget *parent=0, const char *name=0) | |
Dialog (const QStringList &components, QWidget *parent=0, const char *name=0) | |
Dialog (ContentInListView content=Static, QWidget *parent=0, const char *name=0) | |
Dialog (QWidget *parent=0, const char *name=0) | |
~Dialog () | |
Protected Slots | |
void | configureTree () |
void | updateTreeList () |
Detailed Description
Generic configuration dialog that even 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( Dialog::Static, this );
QStringList kpartslist; for( all my kparts ) kpartslist += m_mypart->instance().instanceName(); m_cfgdlg = new Dialog( kpartslist, this );
KStdAction::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.
- Since:
- 3.2
Definition at line 73 of file dialog.h.
Member Enumeration Documentation
Tells the dialog whether the entries in the listview are all static or whether it should add a Configure.
.. button to select which parts of the optional functionality should be active or not.
Constructor & Destructor Documentation
KSettings::Dialog::Dialog | ( | QWidget * | parent = 0 , |
|
const char * | name = 0 | |||
) |
Construct a new Preferences Dialog for the application.
It uses all KCMs with X-KDE-ParentApp set to KGlobal::instance()->instanceName().
- Parameters:
-
parent The parent is only used as the parent for the dialog - centering the dialog over the parent widget. name name
Definition at line 358 of file dialog.cpp.
KSettings::Dialog::Dialog | ( | ContentInListView | content = Static , |
|
QWidget * | parent = 0 , |
|||
const char * | name = 0 | |||
) |
Construct a new Preferences Dialog for the application.
It uses all KCMs with X-KDE-ParentApp set to KGlobal::instance()->instanceName().
- 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. name name
Definition at line 367 of file dialog.cpp.
KSettings::Dialog::Dialog | ( | const QStringList & | components, | |
QWidget * | parent = 0 , |
|||
const char * | name = 0 | |||
) |
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. name name
Definition at line 377 of file dialog.cpp.
KSettings::Dialog::Dialog | ( | const QStringList & | components, | |
ContentInListView | content, | |||
QWidget * | parent = 0 , |
|||
const char * | name = 0 | |||
) |
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. 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. name name
Definition at line 387 of file dialog.cpp.
KSettings::Dialog::~Dialog | ( | ) |
Definition at line 397 of file dialog.cpp.
Member Function Documentation
void KSettings::Dialog::addPluginInfos | ( | const QValueList< KPluginInfo * > & | plugininfos | ) |
If you use a Configurable dialog you need to pass KPluginInfo objects that the dialog should configure.
Definition at line 402 of file dialog.cpp.
void KSettings::Dialog::configureTree | ( | ) | [protected, slot] |
Definition at line 606 of file dialog.cpp.
KCMultiDialog * KSettings::Dialog::dialog | ( | ) |
Definition at line 421 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::show | ( | void | ) | [slot] |
Show the config dialog.
The slot immediatly returns since the dialog is non-modal.
Definition at line 413 of file dialog.cpp.
void KSettings::Dialog::updateTreeList | ( | ) | [protected, slot] |
Definition at line 621 of file dialog.cpp.
The documentation for this class was generated from the following files: