- inline virtual bool hasDefaults() const { return false; }
-
- //! Check if there are changes in the page, compared to the state saved in permanent storage.
- inline bool hasChanged() const { return _changed; }
-
- //! Called immediately before save() is called.
- /** Derived classes should return false if saving is not possible (e.g. the current settings are invalid).
- * \return false, if the SettingsPage cannot be saved in its current state.
- */
- inline virtual bool aboutToSave() { return true; }
-
+ inline virtual bool needsCoreConnection() const { return false; }
+
+ //! The key this settings page stores its values under
+ /** This needs to be overriden to enable automatic loading/saving/hasChanged checking of widgets.
+ * The child widgets' values will be stored in client settings under this key. Every widget that
+ * should be automatically handled needs to have a \c settingsKey property set, and should also provide
+ * a \c defaultValue property.
+ * You can return an empty string (as opposed to a null string) to use the config root as a base, and
+ * you can override this key for individual widgets by prefixing their SettingsKey with /.
+ */
+ inline virtual QString settingsKey() const { return QString(); }
+
+ //! Derived classes need to define this and return true if they have default settings.
+ /** If this method returns true, the "Restore Defaults" button in the SettingsDlg is
+ * enabled. You also need to provide an implementation of defaults() then.
+ *
+ * The default implementation returns false.
+ */
+ inline virtual bool hasDefaults() const { return false; }
+
+ //! Check if there are changes in the page, compared to the state saved in permanent storage.
+ inline bool hasChanged() const { return _changed || _autoWidgetsChanged; }
+
+ //! Called immediately before save() is called.
+ /** Derived classes should return false if saving is not possible (e.g. the current settings are invalid).
+ * \return false, if the SettingsPage cannot be saved in its current state.
+ */
+ inline virtual bool aboutToSave() { return true; }
+
+ //! sets checked state depending on \checked and stores the value for later comparision
+ static void load(QCheckBox *box, bool checked);
+ static bool hasChanged(QCheckBox *box);
+ static void load(QComboBox *box, int index);
+ static bool hasChanged(QComboBox *box);
+ static void load(QSpinBox *box, int value);
+ static bool hasChanged(QSpinBox *box);
+