.TH "KConfigDialog" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KConfigDialog \- Standard KDE configuration dialog class.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kconfigdialog.h>\fP
.PP
Inherits \fBKDialogBase\fP.
.PP
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBwidgetModified\fP ()"
.br
.ti -1c
.RI "void \fBsettingsChanged\fP ()"
.br
.ti -1c
.RI "void \fBsettingsChanged\fP (const char *dialogName)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKConfigDialog\fP (\fBQWidget\fP *parent, const char *name, \fBKConfigSkeleton\fP *config, \fBDialogType\fP dialogType=IconList, int dialogButtons=Default|Ok|Apply|Cancel|Help, \fBButtonCode\fP defaultButton=Ok, bool modal=false)"
.br
.ti -1c
.RI "\fB~KConfigDialog\fP ()"
.br
.ti -1c
.RI "void \fBaddPage\fP (\fBQWidget\fP *page, const \fBQString\fP &itemName, const \fBQString\fP &pixmapName, const \fBQString\fP &header=QString::null, bool manage=true)"
.br
.ti -1c
.RI "void \fBaddPage\fP (\fBQWidget\fP *page, \fBKConfigSkeleton\fP *config, const \fBQString\fP &itemName, const \fBQString\fP &pixmapName, const \fBQString\fP &header=QString::null)"
.br
.ti -1c
.RI "virtual void \fBshow\fP ()"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBKConfigDialog\fP * \fBexists\fP (const char *name)"
.br
.ti -1c
.RI "static bool \fBshowDialog\fP (const char *name)"
.br
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "virtual void \fBupdateSettings\fP ()"
.br
.ti -1c
.RI "virtual void \fBupdateWidgets\fP ()"
.br
.ti -1c
.RI "virtual void \fBupdateWidgetsDefault\fP ()"
.br
.ti -1c
.RI "void \fBupdateButtons\fP ()"
.br
.ti -1c
.RI "void \fBsettingsChangedSlot\fP ()"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual bool \fBhasChanged\fP ()"
.br
.ti -1c
.RI "virtual bool \fBisDefault\fP ()"
.br
.in -1c
.SH "Detailed Description"
.PP 
Standard KDE configuration dialog class. 

The KConfigDialog class provides an easy and uniform means of displaying a settings dialog using \fBKDialogBase\fP, \fBKConfigDialogManager\fP and a \fBKConfigSkeleton\fP derived settings class.
.PP
KConfigDialog handles the enabling and disabling of buttons, creation of the dialog, and deletion of the widgets. Because of \fBKConfigDialogManager\fP, this class also manages: restoring the settings, reseting them to the default values, and saving them. This requires that the names of the widgets corresponding to configuration entries have to have the same name plus an additional 'kcfg_' prefix. For example the widget named 'kcfg_MyOption' would be associated with the configuration entry 'MyOption'.
.PP
Here is an example usage of KConfigDialog:
.PP
.PP
.nf
 void KCoolApp::showSettings(){
   if(KConfigDialog::showDialog('settings'))
     return;
   KConfigDialog *dialog = new KConfigDialog(this, 'settings', MySettings::self(), KDialogBase::IconList);
   dialog->addPage(new General(0, 'General'), i18n('General') );
   dialog->addPage(new Appearance(0, 'Style'), i18n('Appearance') );
   connect(dialog, SIGNAL(settingsChanged()), mainWidget, SLOT(loadSettings()));
   connect(dialog, SIGNAL(settingsChanged()), this, SLOT(loadSettings()));
   dialog->show();
 }
.fi
.PP
.PP
Other than the above code, each class that has settings in the dialog should have a loadSettings() type slot to read settings and perform any necessary changes.
.PP
Please note that using the setMainWidget method inherited from \fBKDialogBase\fP currently yields broken behaviour at runtime; use \fBaddPage()\fP instead.
.PP
\fBSee also:\fP
.RS 4
\fBKConfigSkeleton\fP 
.RE
.PP
\fBAuthor:\fP
.RS 4
Waldo Bastian <bastian@kde.org> 
.RE
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 72 of file kconfigdialog.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KConfigDialog::KConfigDialog (\fBQWidget\fP * parent, const char * name, \fBKConfigSkeleton\fP * config, \fBDialogType\fP dialogType = \fCIconList\fP, int dialogButtons = \fCDefault|Ok|Apply|Cancel|Help\fP, \fBButtonCode\fP defaultButton = \fCOk\fP, bool modal = \fCfalse\fP)"
.PP
\fBParameters:\fP
.RS 4
\fIparent\fP - The parent of this object. Even though the class deletes itself the parent should be set so the dialog can be centered with the application on the screen.
.br
\fIname\fP - The name of this object. The name is used in determining if there can be more than one dialog at a time. Use names such as: 'Font Settings' or 'Color Settings' and not just 'Settings' in applications where there is more than one dialog.
.br
\fIdialogType\fP - Type used in creating the dialog. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKDialogBase\fP
.RE
.PP
\fBParameters:\fP
.RS 4
\fIconfig\fP - Config object containing settings.
.br
\fIdialogButtons\fP - Buttons that should show up on the dialog.
.br
\fIdefaultButton\fP default button that is choosen by hitting the enter key.
.br
\fImodal\fP - Whether the dialog should be modal. To prevent more than one non-modal settings dialog from showing the static function \fBshowDialog()\fP can be used in determining if the settings dialog already exists before creating a new KConfigDialog object. 
.RE
.PP

.PP
Definition at line 49 of file kconfigdialog.cpp.
.PP
References KDialogBase::applyClicked(), KDialogBase::defaultClicked(), KDialogBase::enableButton(), QAsciiDict::insert(), KDialogBase::okClicked(), QCString::sprintf(), updateButtons(), updateSettings(), and updateWidgetsDefault().
.SS "KConfigDialog::~\fBKConfigDialog\fP ()"
.PP
Deconstructor, removes name from the list of open dialogs. 
.PP
Deletes private class. 
.PP
\fBSee also:\fP
.RS 4
\fBexists()\fP 
.RE
.PP

.PP
Definition at line 80 of file kconfigdialog.cpp.
.PP
References QAsciiDict::remove().
.SH "Member Function Documentation"
.PP 
.SS "void KConfigDialog::widgetModified ()\fC [signal]\fP"
.PP
A widget in the dialog was modified. 
.PP
Referenced by updateButtons().
.SS "void KConfigDialog::settingsChanged ()\fC [signal]\fP"
.PP
One or more of the settings have been permanently changed such as if the user clicked on the Apply or Ok button. 
.PP
Referenced by settingsChangedSlot().
.SS "void KConfigDialog::settingsChanged (const char * dialogName)\fC [signal]\fP"
.PP
One or more of the settings have been permanently changed such as if the user clicked on the Apply or Ok button. 
.PP
This signal is useful when using KConfigDialog to configure items in a list. When emitted the main class would then know what item in the list was actually changed. 
.PP
\fBParameters:\fP
.RS 4
\fIdialogName\fP the name of the dialog. 
.RE
.PP

.SS "void KConfigDialog::addPage (\fBQWidget\fP * page, const \fBQString\fP & itemName, const \fBQString\fP & pixmapName, const \fBQString\fP & header = \fCQString::null\fP, bool manage = \fCtrue\fP)"
.PP
Adds page to the dialog and to \fBKConfigDialogManager\fP. 
.PP
When an application is done adding pages \fBshow()\fP should be called to display the dialog. Note that after you call \fBshow()\fP you can not add any more pages to the dialog. 
.PP
\fBParameters:\fP
.RS 4
\fIpage\fP - Pointer to the page that is to be added to the dialog. This object is reparented. 
.br
\fIitemName\fP - Name of the page. 
.br
\fIpixmapName\fP - Name of the pixmap that should be used if needed. 
.br
\fIheader\fP - Header text use in the list modes. Ignored in Tabbed mode. If empty, the itemName text is used when needed. 
.br
\fImanage\fP - Whether \fBKConfigDialogManager\fP should manage the page or not. 
.RE
.PP

.PP
Definition at line 86 of file kconfigdialog.cpp.
.SS "void KConfigDialog::addPage (\fBQWidget\fP * page, \fBKConfigSkeleton\fP * config, const \fBQString\fP & itemName, const \fBQString\fP & pixmapName, const \fBQString\fP & header = \fCQString::null\fP)"
.PP
Adds page to the dialog that is managed by a custom \fBKConfigDialogManager\fP. 
.PP
This is useful for dialogs that contain settings spread over more than one configuration file and thus have/need more than one \fBKConfigSkeleton\fP. When an application is done adding pages \fBshow()\fP should be called to display the dialog. Note that after you call \fBshow()\fP you can not add any more pages to the dialog. 
.PP
\fBParameters:\fP
.RS 4
\fIpage\fP - Pointer to the page that is to be added to the dialog. This object is reparented. 
.br
\fIconfig\fP - Config object containing corresponding settings. 
.br
\fIitemName\fP - Name of the page. 
.br
\fIpixmapName\fP - Name of the pixmap that should be used if needed. 
.br
\fIheader\fP - Header text use in the list modes. Ignored in Tabbed mode. If empty, the itemName text is used when needed. 
.RE
.PP

.PP
Definition at line 97 of file kconfigdialog.cpp.
.SS "\fBKConfigDialog\fP * KConfigDialog::exists (const char * name)\fC [static]\fP"
.PP
See if a dialog with the name 'name' already exists. 
.PP
\fBSee also:\fP
.RS 4
\fBshowDialog()\fP 
.RE
.PP
\fBParameters:\fP
.RS 4
\fIname\fP - Dialog name to look for. 
.RE
.PP
\fBReturns:\fP
.RS 4
Pointer to widget or NULL if it does not exist. 
.RE
.PP

.PP
Definition at line 161 of file kconfigdialog.cpp.
.PP
References QAsciiDict::find().
.PP
Referenced by showDialog().
.SS "bool KConfigDialog::showDialog (const char * name)\fC [static]\fP"
.PP
Attempts to show the dialog with the name 'name'. 
.PP
\fBSee also:\fP
.RS 4
\fBexists()\fP 
.RE
.PP
\fBParameters:\fP
.RS 4
\fIname\fP - The name of the dialog to show. 
.RE
.PP
\fBReturns:\fP
.RS 4
True if the dialog 'name' exists and was shown. 
.RE
.PP

.PP
Definition at line 166 of file kconfigdialog.cpp.
.PP
References exists(), and show().
.SS "void KConfigDialog::show ()\fC [virtual]\fP"
.PP
Show the dialog. 
.PP
Reimplemented from \fBQDialog\fP.
.PP
Definition at line 214 of file kconfigdialog.cpp.
.PP
References QMap::begin(), KDialogBase::enableButton(), QMap::end(), hasChanged(), isDefault(), QDialog::show(), and updateWidgets().
.PP
Referenced by showDialog().
.SS "void KConfigDialog::updateSettings ()\fC [protected, virtual, slot]\fP"
.PP
Update the settings from the dialog. 
.PP
Virtual function for custom additions.
.PP
Example use: User clicks Ok or Apply button in a configure dialog. 
.PP
Definition at line 246 of file kconfigdialog.cpp.
.PP
Referenced by KConfigDialog().
.SS "void KConfigDialog::updateWidgets ()\fC [protected, virtual, slot]\fP"
.PP
Update the dialog based on the settings. 
.PP
Virtual function for custom additions.
.PP
Example use: Initialisation of dialog. Example use: User clicks Reset button in a configure dialog. 
.PP
Definition at line 250 of file kconfigdialog.cpp.
.PP
Referenced by show().
.SS "void KConfigDialog::updateWidgetsDefault ()\fC [protected, virtual, slot]\fP"
.PP
Update the dialog based on the default settings. 
.PP
Virtual function for custom additions.
.PP
Example use: User clicks Defaults button in a configure dialog. 
.PP
Definition at line 254 of file kconfigdialog.cpp.
.PP
Referenced by KConfigDialog().
.SS "virtual bool KConfigDialog::hasChanged ()\fC [inline, protected, virtual]\fP"
.PP
Returns whether the current state of the dialog is different from the current configutation. 
.PP
Virtual function for custom additions. 
.PP
Definition at line 233 of file kconfigdialog.h.
.PP
Referenced by show(), and updateButtons().
.SS "virtual bool KConfigDialog::isDefault ()\fC [inline, protected, virtual]\fP"
.PP
Returns whether the current state of the dialog is the same as the default configuration. 
.PP
Definition at line 239 of file kconfigdialog.h.
.PP
Referenced by show(), and updateButtons().
.SS "void KConfigDialog::updateButtons ()\fC [protected, slot]\fP"
.PP
Updates the Apply and Default buttons. 
.PP
Definition at line 174 of file kconfigdialog.cpp.
.PP
References QMap::begin(), KDialogBase::enableButton(), QMap::end(), hasChanged(), isDefault(), and widgetModified().
.PP
Referenced by KConfigDialog(), and settingsChangedSlot().
.SS "void KConfigDialog::settingsChangedSlot ()\fC [protected, slot]\fP"
.PP
Some setting was changed. 
.PP
Emit the signal with the dialogs name 
.PP
Definition at line 206 of file kconfigdialog.cpp.
.PP
References settingsChanged(), and updateButtons().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
