summaryrefslogtreecommitdiffstats
path: root/libsettings/include/settingsobject.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-07-16 00:30:32 +0200
committerPetr Mrázek <peterix@gmail.com>2013-07-16 00:30:32 +0200
commite2ee6d6d254285284f07b07cb60409fbda0bf7ad (patch)
tree30810ad496b34ae949aba3a72efb0a0363e8b718 /libsettings/include/settingsobject.h
parentb5450042b5f9ddaad7585f644591b7d009aeb5cb (diff)
downloadMultiMC-e2ee6d6d254285284f07b07cb60409fbda0bf7ad.tar
MultiMC-e2ee6d6d254285284f07b07cb60409fbda0bf7ad.tar.gz
MultiMC-e2ee6d6d254285284f07b07cb60409fbda0bf7ad.tar.lz
MultiMC-e2ee6d6d254285284f07b07cb60409fbda0bf7ad.tar.xz
MultiMC-e2ee6d6d254285284f07b07cb60409fbda0bf7ad.zip
Finalize the instance settings dialog, add setting reset mechanism
Diffstat (limited to 'libsettings/include/settingsobject.h')
-rw-r--r--libsettings/include/settingsobject.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/libsettings/include/settingsobject.h b/libsettings/include/settingsobject.h
index 23f0d644..a2f03699 100644
--- a/libsettings/include/settingsobject.h
+++ b/libsettings/include/settingsobject.h
@@ -100,6 +100,11 @@ public:
*/
virtual bool set(const QString &id, QVariant value);
+ /*!
+ * \brief Reverts the setting with the given ID to default.
+ * \param id The ID of the setting to reset.
+ */
+ virtual void reset(const QString &id) const;
/*!
* \brief Gets a QList with pointers to all of the registered settings.
@@ -125,6 +130,14 @@ signals:
*/
void settingChanged(const Setting &setting, QVariant value);
+ /*!
+ * \brief Signal emitted when one of this SettingsObject object's settings resets.
+ * This is usually just connected directly to each Setting object's
+ * settingReset() signals.
+ * \param setting A reference to the Setting object that changed.
+ */
+ void settingReset(const Setting &setting);
+
protected slots:
/*!
* \brief Changes a setting.
@@ -136,6 +149,15 @@ protected slots:
*/
virtual void changeSetting(const Setting &setting, QVariant value) = 0;
+ /*!
+ * \brief Resets a setting.
+ * This slot is usually connected to each Setting object's
+ * settingReset() signal. The signal is emitted, causing this slot
+ * to update the setting's value in the config file.
+ * \param setting A reference to the Setting object that changed.
+ */
+ virtual void resetSetting(const Setting &setting) = 0;
+
protected:
/*!
* \brief Connects the necessary signals to the given Setting.