• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TDEConfigDialogManager Class Reference

#include <tdeconfigdialogmanager.h>

Inherits TQObject.

Public Slots

void updateSettings ()
 
void updateWidgets ()
 
void updateWidgetsDefault ()
 

Signals

void settingsChanged ()
 
void settingsChanged (TQWidget *widget)
 
void widgetModified ()
 

Public Member Functions

 TDEConfigDialogManager (TQWidget *parent, TDEConfigSkeleton *conf, const char *name=0)
 
 ~TDEConfigDialogManager ()
 
void addWidget (TQWidget *widget)
 
bool hasChanged ()
 
bool isDefault ()
 

Protected Member Functions

void init (bool trackChanges)
 
bool parseChildren (const TQWidget *widget, bool trackChanges)
 
void setProperty (TQWidget *w, const TQVariant &v)
 
TQVariant property (TQWidget *w)
 
void setupWidget (TQWidget *widget, TDEConfigSkeletonItem *item)
 

Protected Attributes

TDEConfigSkeleton * m_conf
 
TQWidget * m_dialog
 
TQSqlPropertyMap * propertyMap
 
TQMap< TQString, TQCString > changedMap
 

Detailed Description

Provides a means of automatically retrieving, saving and resetting TDEConfigSkeleton based settings in a dialog.

The TDEConfigDialogManager 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 TDEConfigSkeleton object plus an additional "kcfg_" prefix. For example a widget named "kcfg_MyOption" would be associated to the configuration entry "MyOption".

TDEConfigDialogManager uses the TQSqlPropertyMap class to determine if it can do anything to a widget. Note that TDEConfigDialogManager doesn't require a database, it simply uses the functionality that is built into the TQSqlPropertyMap class. New widgets can be added to the map using TQSqlPropertyMap::installDefaultMap(). Note that you can't just add any class. The class must have a matching TQ_PROPERTY(...) macro defined.

For example (note that KColorButton is already added and it doesn't need to manually added):

kcolorbutton.h defines the following property:

TQ_PROPERTY( TQColor color READ color WRITE setColor )

To add KColorButton the following code would be inserted in the main.

tdeApp->installKDEPropertyMap();
TQSqlPropertyMap *map = TQSqlPropertyMap::defaultMap();
map->insert("KColorButton", "color");

If you add a new widget to the TQSqlPropertyMap and wish to be notified when it is modified you should add its signal using addWidgetChangedSignal().

Since
3.2
Author
Benjamin C Meyer <ben+tdelibs at meyerhome dot net>
Waldo Bastian basti.nosp@m.an@k.nosp@m.de.or.nosp@m.g

Definition at line 78 of file tdeconfigdialogmanager.h.

Constructor & Destructor Documentation

◆ TDEConfigDialogManager()

TDEConfigDialogManager::TDEConfigDialogManager ( TQWidget *  parent,
TDEConfigSkeleton *  conf,
const char *  name = 0 
)

Constructor.

Parameters
parentDialog widget to manage
confObject that contains settings
name- Object name.

Definition at line 51 of file tdeconfigdialogmanager.cpp.

◆ ~TDEConfigDialogManager()

TDEConfigDialogManager::~TDEConfigDialogManager ( )

Destructor.

Definition at line 62 of file tdeconfigdialogmanager.cpp.

Member Function Documentation

◆ addWidget()

void TDEConfigDialogManager::addWidget ( TQWidget *  widget)

Add additional widgets to manage.

Parameters
widgetAdditional widget to manage, inlcuding all its children

Definition at line 124 of file tdeconfigdialogmanager.cpp.

◆ hasChanged()

bool TDEConfigDialogManager::hasChanged ( )

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

Definition at line 365 of file tdeconfigdialogmanager.cpp.

◆ init()

void TDEConfigDialogManager::init ( bool  trackChanges)
protected
Parameters
trackChanges- If any changes by the widgets should be tracked set true. This causes the emitting the modified() signal when something changes. TODO:
Returns
bool - True if any setting was changed from the default.

Definition at line 67 of file tdeconfigdialogmanager.cpp.

◆ isDefault()

bool TDEConfigDialogManager::isDefault ( )

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

Definition at line 389 of file tdeconfigdialogmanager.cpp.

◆ parseChildren()

bool TDEConfigDialogManager::parseChildren ( const TQWidget *  widget,
bool  trackChanges 
)
protected

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 currentGroup. Also checks if the widget should be disabled because it is set immutable.

Parameters
widget- Parent of the children to look at.
trackChanges- If true then tracks any changes to the children of widget that are known.
Returns
bool - If a widget was set to something other then its default.

Definition at line 153 of file tdeconfigdialogmanager.cpp.

◆ property()

TQVariant TDEConfigDialogManager::property ( TQWidget *  w)
protected

Retrieve a property.

Definition at line 352 of file tdeconfigdialogmanager.cpp.

◆ setProperty()

void TDEConfigDialogManager::setProperty ( TQWidget *  w,
const TQVariant &  v 
)
protected

Set a property.

Definition at line 333 of file tdeconfigdialogmanager.cpp.

◆ settingsChanged [1/2]

void TDEConfigDialogManager::settingsChanged ( )
signal

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

This is only emitted by updateSettings() whenever one or more setting were changed and consequently saved.

◆ settingsChanged [2/2]

void TDEConfigDialogManager::settingsChanged ( TQWidget *  widget)
signal

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

Parameters
widget- The widget group (pass in via addWidget()) that contains the one or more modified setting.
See also
settingsChanged()

◆ setupWidget()

void TDEConfigDialogManager::setupWidget ( TQWidget *  widget,
TDEConfigSkeletonItem *  item 
)
protected

Setup secondary widget properties.

Definition at line 129 of file tdeconfigdialogmanager.cpp.

◆ updateSettings

void TDEConfigDialogManager::updateSettings ( )
slot

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 304 of file tdeconfigdialogmanager.cpp.

◆ updateWidgets

void TDEConfigDialogManager::updateWidgets ( )
slot

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 259 of file tdeconfigdialogmanager.cpp.

◆ updateWidgetsDefault

void TDEConfigDialogManager::updateWidgetsDefault ( )
slot

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 297 of file tdeconfigdialogmanager.cpp.

◆ widgetModified

void TDEConfigDialogManager::widgetModified ( )
signal

If retrieveSettings() 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. hasChanged() will tell you if anything has actually changed from the saved values.

Member Data Documentation

◆ changedMap

TQMap<TQString, TQCString> TDEConfigDialogManager::changedMap
protected

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

Definition at line 224 of file tdeconfigdialogmanager.h.

◆ m_conf

TDEConfigSkeleton* TDEConfigDialogManager::m_conf
protected

TDEConfigSkeleton object used to store settings.

Definition at line 209 of file tdeconfigdialogmanager.h.

◆ m_dialog

TQWidget* TDEConfigDialogManager::m_dialog
protected

Dialog being managed.

Definition at line 214 of file tdeconfigdialogmanager.h.

◆ propertyMap

TQSqlPropertyMap* TDEConfigDialogManager::propertyMap
protected

Pointer to the property map for easy access.

Definition at line 219 of file tdeconfigdialogmanager.h.


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

tdecore

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

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.