\section{KConfig\-Dialog\-Manager Class Reference}
\label{classKConfigDialogManager}\index{KConfigDialogManager@{KConfigDialogManager}}
Provides a means of automatically retrieving, saving and resetting {\bf KConfig\-Skeleton}{\rm (p.\,\pageref{classKConfigSkeleton})} based settings in a dialog.  


{\tt \#include $<$kconfigdialogmanager.h$>$}

Inheritance diagram for KConfig\-Dialog\-Manager:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=77pt]{classKConfigDialogManager__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KConfig\-Dialog\-Manager:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=269pt]{classKConfigDialogManager__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Slots}
\begin{CompactItemize}
\item 
void {\bf update\-Settings} ()
\item 
void {\bf update\-Widgets} ()
\item 
void {\bf update\-Widgets\-Default} ()
\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf settings\-Changed} ()
\item 
void {\bf settings\-Changed} ({\bf QWidget} $\ast$widget)
\item 
void {\bf widget\-Modified} ()
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KConfig\-Dialog\-Manager} ({\bf QWidget} $\ast${\bf parent}, {\bf KConfig\-Skeleton} $\ast$conf, const char $\ast${\bf name}=0)
\item 
{\bf $\sim$KConfig\-Dialog\-Manager} ()
\item 
void {\bf add\-Widget} ({\bf QWidget} $\ast$widget)
\item 
bool {\bf has\-Changed} ()
\item 
bool {\bf is\-Default} ()
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
void {\bf init} (bool track\-Changes)
\item 
bool {\bf parse\-Children} (const {\bf QWidget} $\ast$widget, bool track\-Changes)
\item 
void {\bf set\-Property} ({\bf QWidget} $\ast$w, const {\bf QVariant} \&v)
\item 
{\bf QVariant} {\bf property} ({\bf QWidget} $\ast$w)
\item 
void {\bf setup\-Widget} ({\bf QWidget} $\ast$widget, {\bf KConfig\-Skeleton\-Item} $\ast$item)
\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf KConfig\-Skeleton} $\ast$ {\bf m\_\-conf}
\item 
{\bf QWidget} $\ast$ {\bf m\_\-dialog}
\item 
{\bf QSql\-Property\-Map} $\ast$ {\bf property\-Map}
\item 
{\bf QMap}$<$ {\bf QString}, {\bf QCString} $>$ {\bf changed\-Map}
\end{CompactItemize}


\subsection{Detailed Description}
Provides a means of automatically retrieving, saving and resetting {\bf KConfig\-Skeleton}{\rm (p.\,\pageref{classKConfigSkeleton})} based settings in a dialog. 

The KConfig\-Dialog\-Manager class provides a means of automatically retrieving, saving and resetting basic settings. It also can emit signals when settings have been changed (settings were saved) or modified (the user changes a checkbox from on to off).

The names of the widgets to be managed have to correspond to the names of the configuration entries in the {\bf KConfig\-Skeleton}{\rm (p.\,\pageref{classKConfigSkeleton})} object plus an additional \char`\"{}kcfg\_\-\char`\"{} prefix. For example a widget named \char`\"{}kcfg\_\-My\-Option\char`\"{} would be associated to the configuration entry \char`\"{}My\-Option\char`\"{}.

KConfig\-Dialog\-Manager uses the {\bf QSql\-Property\-Map} class to determine if it can do anything to a widget. Note that KConfig\-Dialog\-Manager doesn't require a database, it simply uses the functionality that is built into the {\bf QSql\-Property\-Map} class. New widgets can be added to the map using {\bf QSql\-Property\-Map::install\-Default\-Map()}. Note that you can't just add any class. The class must have a matching Q\_\-PROPERTY(...) macro defined.

For example (note that {\bf KColor\-Button} is already added and it doesn't need to manually added):

kcolorbutton.h defines the following property: 

\footnotesize\begin{verbatim} Q_PROPERTY( QColor color READ color WRITE setColor )
\end{verbatim}
\normalsize


To add {\bf KColor\-Button} the following code would be inserted in the main.



\footnotesize\begin{verbatim} kapp->installKDEPropertyMap();
 QSqlPropertyMap *map = QSqlPropertyMap::defaultMap();
 map->insert("KColorButton", "color");
\end{verbatim}
\normalsize


If you add a new widget to the {\bf QSql\-Property\-Map} and wish to be notified when it is modified you should add its signal using add\-Widget\-Changed\-Signal().

\begin{Desc}
\item[Since:]3.2 \end{Desc}
\begin{Desc}
\item[Author:]Benjamin C Meyer $<$ben+kdelibs at meyerhome dot net$>$ 

Waldo Bastian $<${\tt bastian@kde.org}$>$ \end{Desc}




Definition at line 78 of file kconfigdialogmanager.h.

\subsection{Constructor \& Destructor Documentation}
\index{KConfigDialogManager@{KConfig\-Dialog\-Manager}!KConfigDialogManager@{KConfigDialogManager}}
\index{KConfigDialogManager@{KConfigDialogManager}!KConfigDialogManager@{KConfig\-Dialog\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KConfig\-Dialog\-Manager::KConfig\-Dialog\-Manager ({\bf QWidget} $\ast$ {\em parent}, {\bf KConfig\-Skeleton} $\ast$ {\em conf}, const char $\ast$ {\em name} = {\tt 0})}\label{classKConfigDialogManager_a0}


Constructor. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em parent}]Dialog widget to manage \item[{\em conf}]Object that contains settings \item[{\em name}]- Object name. \end{description}
\end{Desc}


Definition at line 51 of file kconfigdialogmanager.cpp.

References QSql\-Property\-Map::default\-Map(), init(), m\_\-conf, m\_\-dialog, and property\-Map.\index{KConfigDialogManager@{KConfig\-Dialog\-Manager}!~KConfigDialogManager@{$\sim$KConfigDialogManager}}
\index{~KConfigDialogManager@{$\sim$KConfigDialogManager}!KConfigDialogManager@{KConfig\-Dialog\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KConfig\-Dialog\-Manager::$\sim${\bf KConfig\-Dialog\-Manager} ()}\label{classKConfigDialogManager_a1}


Destructor. 



Definition at line 62 of file kconfigdialogmanager.cpp.

\subsection{Member Function Documentation}
\index{KConfigDialogManager@{KConfig\-Dialog\-Manager}!settingsChanged@{settingsChanged}}
\index{settingsChanged@{settingsChanged}!KConfigDialogManager@{KConfig\-Dialog\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KConfig\-Dialog\-Manager::settings\-Changed ()\hspace{0.3cm}{\tt  [signal]}}\label{classKConfigDialogManager_l0}


One or more of the settings have been saved (such as when the user clicks on the Apply button). 

This is only emitted by {\bf update\-Settings()}{\rm (p.\,\pageref{classKConfigDialogManager_i0})} whenever one or more setting were changed and consequently saved. 

Referenced by update\-Settings().\index{KConfigDialogManager@{KConfig\-Dialog\-Manager}!settingsChanged@{settingsChanged}}
\index{settingsChanged@{settingsChanged}!KConfigDialogManager@{KConfig\-Dialog\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KConfig\-Dialog\-Manager::settings\-Changed ({\bf QWidget} $\ast$ {\em widget})\hspace{0.3cm}{\tt  [signal]}}\label{classKConfigDialogManager_l1}


TODO: Verify One or more of the settings have been changed. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em widget}]- The widget group (pass in via {\bf add\-Widget()}{\rm (p.\,\pageref{classKConfigDialogManager_a2})}) that contains the one or more modified setting. \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf settings\-Changed()}{\rm (p.\,\pageref{classKConfigDialogManager_l0})} \end{Desc}
\index{KConfigDialogManager@{KConfig\-Dialog\-Manager}!widgetModified@{widgetModified}}
\index{widgetModified@{widgetModified}!KConfigDialogManager@{KConfig\-Dialog\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KConfig\-Dialog\-Manager::widget\-Modified ()\hspace{0.3cm}{\tt  [signal]}}\label{classKConfigDialogManager_l2}


If retrieve\-Settings() was told to track changes then if any known setting was changed this signal will be emitted. 

Note that a settings can be modified several times and might go back to the original saved state. {\bf has\-Changed()}{\rm (p.\,\pageref{classKConfigDialogManager_a3})} will tell you if anything has actually changed from the saved values. 

Referenced by parse\-Children(), and update\-Widgets().\index{KConfigDialogManager@{KConfig\-Dialog\-Manager}!addWidget@{addWidget}}
\index{addWidget@{addWidget}!KConfigDialogManager@{KConfig\-Dialog\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KConfig\-Dialog\-Manager::add\-Widget ({\bf QWidget} $\ast$ {\em widget})}\label{classKConfigDialogManager_a2}


Add additional widgets to manage. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em widget}]Additional widget to manage, inlcuding all its children \end{description}
\end{Desc}


Definition at line 124 of file kconfigdialogmanager.cpp.

References parse\-Children().\index{KConfigDialogManager@{KConfig\-Dialog\-Manager}!hasChanged@{hasChanged}}
\index{hasChanged@{hasChanged}!KConfigDialogManager@{KConfig\-Dialog\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KConfig\-Dialog\-Manager::has\-Changed ()}\label{classKConfigDialogManager_a3}


Returns whether the current state of the known widgets are different from the state in the config object. 



Definition at line 366 of file kconfigdialogmanager.cpp.

References endl(), KConfig\-Skeleton::find\-Item(), m\_\-conf, KConfig\-Skeleton\-Item::property(), and property().

Referenced by is\-Default().\index{KConfigDialogManager@{KConfig\-Dialog\-Manager}!isDefault@{isDefault}}
\index{isDefault@{isDefault}!KConfigDialogManager@{KConfig\-Dialog\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KConfig\-Dialog\-Manager::is\-Default ()}\label{classKConfigDialogManager_a4}


Returns whether the current state of the known widgets are the same as the default state in the config object. 



Definition at line 390 of file kconfigdialogmanager.cpp.

References has\-Changed(), m\_\-conf, and KConfig\-Skeleton::use\-Defaults().\index{KConfigDialogManager@{KConfig\-Dialog\-Manager}!updateSettings@{updateSettings}}
\index{updateSettings@{updateSettings}!KConfigDialogManager@{KConfig\-Dialog\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KConfig\-Dialog\-Manager::update\-Settings ()\hspace{0.3cm}{\tt  [slot]}}\label{classKConfigDialogManager_i0}


Traverse the specified widgets, saving the settings of all known widgets in the settings object. 

Example use: User clicks Ok or Apply button in a configure dialog. 

Definition at line 305 of file kconfigdialogmanager.cpp.

References endl(), KConfig\-Skeleton::find\-Item(), m\_\-conf, KConfig\-Skeleton\-Item::property(), property(), KConfig\-Skeleton\-Item::set\-Property(), settings\-Changed(), and KConfig\-Skeleton::write\-Config().\index{KConfigDialogManager@{KConfig\-Dialog\-Manager}!updateWidgets@{updateWidgets}}
\index{updateWidgets@{updateWidgets}!KConfigDialogManager@{KConfig\-Dialog\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KConfig\-Dialog\-Manager::update\-Widgets ()\hspace{0.3cm}{\tt  [slot]}}\label{classKConfigDialogManager_i1}


Traverse the specified widgets, sets the state of all known widgets according to the state in the settings object. 

Example use: Initialisation of dialog. Example use: User clicks Reset button in a configure dialog. 

Definition at line 260 of file kconfigdialogmanager.cpp.

References QObject::block\-Signals(), endl(), QWidget::find(), KConfig\-Skeleton::find\-Item(), KConfig\-Skeleton\-Item::is\-Immutable(), m\_\-conf, property(), KConfig\-Skeleton\-Item::property(), QWidget::set\-Enabled(), set\-Property(), QObject::signals\-Blocked(), QTimer::single\-Shot(), and widget\-Modified().

Referenced by update\-Widgets\-Default().\index{KConfigDialogManager@{KConfig\-Dialog\-Manager}!updateWidgetsDefault@{updateWidgetsDefault}}
\index{updateWidgetsDefault@{updateWidgetsDefault}!KConfigDialogManager@{KConfig\-Dialog\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KConfig\-Dialog\-Manager::update\-Widgets\-Default ()\hspace{0.3cm}{\tt  [slot]}}\label{classKConfigDialogManager_i2}


Traverse the specified widgets, sets the state of all known widgets according to the default state in the settings object. 

Example use: User clicks Defaults button in a configure dialog. 

Definition at line 298 of file kconfigdialogmanager.cpp.

References m\_\-conf, update\-Widgets(), and KConfig\-Skeleton::use\-Defaults().\index{KConfigDialogManager@{KConfig\-Dialog\-Manager}!init@{init}}
\index{init@{init}!KConfigDialogManager@{KConfig\-Dialog\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KConfig\-Dialog\-Manager::init (bool {\em track\-Changes})\hspace{0.3cm}{\tt  [protected]}}\label{classKConfigDialogManager_b0}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em track\-Changes}]- If any changes by the widgets should be tracked set true. This causes the emitting the modified() signal when something changes. TODO: \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]bool - True if any setting was changed from the default. \end{Desc}


Definition at line 67 of file kconfigdialogmanager.cpp.

References changed\-Map, QMap::insert(), m\_\-dialog, and parse\-Children().

Referenced by KConfig\-Dialog\-Manager().\index{KConfigDialogManager@{KConfig\-Dialog\-Manager}!parseChildren@{parseChildren}}
\index{parseChildren@{parseChildren}!KConfigDialogManager@{KConfig\-Dialog\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KConfig\-Dialog\-Manager::parse\-Children (const {\bf QWidget} $\ast$ {\em widget}, bool {\em track\-Changes})\hspace{0.3cm}{\tt  [protected]}}\label{classKConfigDialogManager_b1}


Recursive function that finds all known children. 

Goes through the children of widget and if any are known and not being ignored, stores them in current\-Group. Also checks if the widget should be disabled because it is set immutable. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em widget}]- Parent of the children to look at. \item[{\em track\-Changes}]- If true then tracks any changes to the children of widget that are known. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]bool - If a widget was set to something other then its default. \end{Desc}


Definition at line 153 of file kconfigdialogmanager.cpp.

References changed\-Map, QObject::connect(), QPtr\-List\-Iterator::current(), QCombo\-Box::editable(), QMap::end(), endl(), QMap::find(), KConfig\-Skeleton::find\-Item(), QObject::is\-Widget\-Type(), m\_\-conf, setup\-Widget(), and widget\-Modified().

Referenced by add\-Widget(), and init().\index{KConfigDialogManager@{KConfig\-Dialog\-Manager}!setProperty@{setProperty}}
\index{setProperty@{setProperty}!KConfigDialogManager@{KConfig\-Dialog\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KConfig\-Dialog\-Manager::set\-Property ({\bf QWidget} $\ast$ {\em w}, const {\bf QVariant} \& {\em v})\hspace{0.3cm}{\tt  [protected]}}\label{classKConfigDialogManager_b2}


Set a property. 



Definition at line 334 of file kconfigdialogmanager.cpp.

References QCombo\-Box::editable(), property\-Map, QButton\-Group::set\-Button(), QCombo\-Box::set\-Current\-Text(), and QSql\-Property\-Map::set\-Property().

Referenced by update\-Widgets().\index{KConfigDialogManager@{KConfig\-Dialog\-Manager}!property@{property}}
\index{property@{property}!KConfigDialogManager@{KConfig\-Dialog\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QVariant} KConfig\-Dialog\-Manager::property ({\bf QWidget} $\ast$ {\em w})\hspace{0.3cm}{\tt  [protected]}}\label{classKConfigDialogManager_b3}


Retrieve a property. 



Definition at line 353 of file kconfigdialogmanager.cpp.

References QCombo\-Box::current\-Text(), QCombo\-Box::editable(), QSql\-Property\-Map::property(), property\-Map, and QButton\-Group::selected\-Id().

Referenced by has\-Changed(), update\-Settings(), and update\-Widgets().\index{KConfigDialogManager@{KConfig\-Dialog\-Manager}!setupWidget@{setupWidget}}
\index{setupWidget@{setupWidget}!KConfigDialogManager@{KConfig\-Dialog\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KConfig\-Dialog\-Manager::setup\-Widget ({\bf QWidget} $\ast$ {\em widget}, {\bf KConfig\-Skeleton\-Item} $\ast$ {\em item})\hspace{0.3cm}{\tt  [protected]}}\label{classKConfigDialogManager_b4}


Setup secondary widget properties. 



Definition at line 129 of file kconfigdialogmanager.cpp.

References QWhats\-This::add(), QString::is\-Empty(), and QVariant::is\-Valid().

Referenced by parse\-Children().

\subsection{Member Data Documentation}
\index{KConfigDialogManager@{KConfig\-Dialog\-Manager}!m_conf@{m\_\-conf}}
\index{m_conf@{m\_\-conf}!KConfigDialogManager@{KConfig\-Dialog\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KConfig\-Skeleton}$\ast$ {\bf KConfig\-Dialog\-Manager::m\_\-conf}\hspace{0.3cm}{\tt  [protected]}}\label{classKConfigDialogManager_p0}


{\bf KConfig\-Skeleton}{\rm (p.\,\pageref{classKConfigSkeleton})} object used to store settings. 



Definition at line 209 of file kconfigdialogmanager.h.

Referenced by has\-Changed(), is\-Default(), KConfig\-Dialog\-Manager(), parse\-Children(), update\-Settings(), update\-Widgets(), and update\-Widgets\-Default().\index{KConfigDialogManager@{KConfig\-Dialog\-Manager}!m_dialog@{m\_\-dialog}}
\index{m_dialog@{m\_\-dialog}!KConfigDialogManager@{KConfig\-Dialog\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QWidget}$\ast$ {\bf KConfig\-Dialog\-Manager::m\_\-dialog}\hspace{0.3cm}{\tt  [protected]}}\label{classKConfigDialogManager_p1}


Dialog being managed. 



Definition at line 214 of file kconfigdialogmanager.h.

Referenced by init(), and KConfig\-Dialog\-Manager().\index{KConfigDialogManager@{KConfig\-Dialog\-Manager}!propertyMap@{propertyMap}}
\index{propertyMap@{propertyMap}!KConfigDialogManager@{KConfig\-Dialog\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QSql\-Property\-Map}$\ast$ {\bf KConfig\-Dialog\-Manager::property\-Map}\hspace{0.3cm}{\tt  [protected]}}\label{classKConfigDialogManager_p2}


Pointer to the property map for easy access. 



Definition at line 219 of file kconfigdialogmanager.h.

Referenced by KConfig\-Dialog\-Manager(), property(), and set\-Property().\index{KConfigDialogManager@{KConfig\-Dialog\-Manager}!changedMap@{changedMap}}
\index{changedMap@{changedMap}!KConfigDialogManager@{KConfig\-Dialog\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QMap}$<${\bf QString}, {\bf QCString}$>$ {\bf KConfig\-Dialog\-Manager::changed\-Map}\hspace{0.3cm}{\tt  [protected]}}\label{classKConfigDialogManager_p3}


Map of the classes and the signals that they emit when changed. 



Definition at line 224 of file kconfigdialogmanager.h.

Referenced by init(), and parse\-Children().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kconfigdialogmanager.h\item 
kconfigdialogmanager.cpp\end{CompactItemize}
