Commit some preliminary work on the settingspage stuff.
[quassel.git] / src / uisupport / settingspage.h
similarity index 83%
rename from src/qtui/settingspage.h
rename to src/uisupport/settingspage.h
index 49c4c6b..91171df 100644 (file)
@@ -31,7 +31,7 @@ class SettingsPage : public QWidget {
     SettingsPage(const QString &category, const QString &name, QWidget *parent = 0);
     virtual ~SettingsPage() {};
     virtual QString category() const;
-    virtual QString name() const;
+    virtual QString title() const;
 
     virtual bool hasChanged() const = 0;
 
@@ -40,9 +40,19 @@ class SettingsPage : public QWidget {
     virtual void load() = 0;
     virtual void defaults() = 0;
 
+  protected slots:
+    //! Calling this slot is equivalent to emitting changed(true).
+    void changed();
+
+  protected:
+    //! This should be called whenever the widget state changes from unchanged to change or the other way round.
+    void changeState(bool hasChanged = true);
+
   signals:
-    void changed(bool hasChanged = true);
+    void changed(bool hasChanged);
 
+  private:
+    QString _category, _title;
 };
 
 #endif