Some refactoring in SettingsDlg
[irwi] / src / settingsdlg.h
index aec925a..6197989 100644 (file)
@@ -2,12 +2,16 @@
 #define SETTINGSDLG_H
 
 #include <QDialog>
+#include <QSettings>
+
+#include "remote.h"
 
 class QWidget;
 class QHBoxLayout;
 class QVBoxLayout;
 class QPushButton;
 class QLabel;
+class Remote;
 
 class SettingsDlg : public QDialog
 {
@@ -16,22 +20,34 @@ public:
     SettingsDlg(QWidget *parent = 0);
     ~SettingsDlg();
 
-public slots:
-    void updateRemoteName();
-
 private slots:
     void showAdvSettingsDlg();
     void showSelectRemoteDlg();
     void showAboutDlg();
+    void setRemote(Remote);
+    void setRemote(const QString &name);
+    void updateRemoteInfo();
+    void rateUpClicked();
+    void rateDownClicked();
+
+private:
+    void enableRateBtns(bool enable = true);
+    void processRemoteChange();
+    void processRatingSent();
 
 private:
-    QVBoxLayout *layout;
-    QHBoxLayout *btnLayout;
-    QHBoxLayout *remoteNameLayout;
-    QPushButton *advSettingsBtn;
-    QPushButton *selectRemoteBtn;
-    QPushButton *aboutBtn;
-    QLabel *remoteNameLabel;
+    Remote m_remote;
+
+    QVBoxLayout *m_layout;
+    QHBoxLayout *m_btnLayout;
+    QHBoxLayout *m_remoteNameLayout;
+    QPushButton *m_advSettingsBtn;
+    QPushButton *m_selectRemoteBtn;
+    QPushButton *m_rateUpBtn;
+    QPushButton *m_rateDownBtn;
+    QPushButton *m_aboutBtn;
+    QLabel *m_remoteNameLabel;
+    QLabel *m_ratingLabel;
 };
 
 #endif