Finally! The new identities plus a nice shiny settingspage for editing them are done!
[quassel.git] / src / uisupport / settingspage.h
index 926d4d7..247efb1 100644 (file)
@@ -32,16 +32,23 @@ class SettingsPage : public QWidget {
     virtual ~SettingsPage() {};
     virtual QString category() const;
     virtual QString title() const;
+    virtual bool hasDefaults() const;
 
-    virtual bool hasChanged() const = 0;
+    bool hasChanged() const;
+
+    //! 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.
+     */
+    virtual bool aboutToSave();
 
   public slots:
     virtual void save() = 0;
     virtual void load() = 0;
-    virtual void defaults() = 0;
+    virtual void defaults();
 
   protected slots:
-    //! Calling this slot is equivalent to emitting changed(true).
+    //! Calling this slot is equivalent to calling changeState(true).
     void changed();
 
   protected:
@@ -49,6 +56,7 @@ class SettingsPage : public QWidget {
     void changeState(bool hasChanged = true);
 
   signals:
+    //! Emitted whenever the widget state changes.
     void changed(bool hasChanged);
 
   private: