X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fsettingspage.h;h=3ef6d2cc5e16482cf1e4c5c34116a04007b038ca;hp=d3db08a83e792dd9583d1dfc3d8c3f7c84ab93af;hb=4c740970699031a20315c7f5666d1f88c439f739;hpb=61e73ddfdd22418890102c44166483ddb28e1c93 diff --git a/src/uisupport/settingspage.h b/src/uisupport/settingspage.h index d3db08a8..3ef6d2cc 100644 --- a/src/uisupport/settingspage.h +++ b/src/uisupport/settingspage.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel Project * + * Copyright (C) 2005-09 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -40,11 +40,15 @@ class QSpinBox; * its key is treated as a global path starting from the root, rather than from settingsKey(). * A second dynamic property \c defaultValue can be defined in child widgets as well. * + * For widgets requiring special ways for storing and saving, define the property settingsKey and leave it empty. In this + * case, the methods saveAutoWidgetValue() and loadAutoWidgetValue() will be called with the widget's objectName as parameter. + * * SettingsPage manages loading, saving, setting to default and setting the changed state for all automatic child widgets. * Derived classes must be sure to call initAutoWidgets() *after* setupUi(); they also need to call the baseclass implementations * of load(), save() and defaults() (preferably at the end of the derived function, since they call setChangedState(false)). * * The following widgets can be handled for now: + * - QGroupBox (isChecked()) * - QAbstractButton (isChecked(), e.g. for QCheckBox and QRadioButton) * - QLineEdit, QTextEdit (text()) * - QComboBox (currentIndex()) @@ -126,6 +130,8 @@ protected slots: protected: void initAutoWidgets(); + virtual QVariant loadAutoWidgetValue(const QString &widgetName); + virtual void saveAutoWidgetValue(const QString &widgetName, const QVariant &value); signals: //! Emitted whenever the widget state changes.