Refactor to Model level ui datamodels for sources, switches and curves
This commit is contained in:
@@ -26,7 +26,8 @@
|
||||
|
||||
constexpr char MIMETYPE_TIMER[] = "application/x-companion-timer";
|
||||
|
||||
class RawSwitchFilterItemModel;
|
||||
class RawSwitchItemModel;
|
||||
class RawItemFilteredModel;
|
||||
|
||||
namespace Ui {
|
||||
class Setup;
|
||||
@@ -39,7 +40,7 @@ class TimerPanel : public ModelPanel
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings, Firmware * firmware, QWidget *prevFocus, RawSwitchFilterItemModel * switchModel);
|
||||
TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings, Firmware * firmware, QWidget *prevFocus, RawItemFilteredModel * switchModel);
|
||||
virtual ~TimerPanel();
|
||||
|
||||
virtual void update();
|
||||
@@ -50,6 +51,11 @@ class TimerPanel : public ModelPanel
|
||||
void on_value_editingFinished();
|
||||
void on_minuteBeep_toggled(bool checked);
|
||||
void on_name_editingFinished();
|
||||
void onModelDataAboutToBeUpdated();
|
||||
void onModelDataUpdateComplete();
|
||||
|
||||
signals:
|
||||
void nameChanged();
|
||||
|
||||
private:
|
||||
TimerData & timer;
|
||||
@@ -125,7 +131,7 @@ class SetupPanel : public ModelPanel
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware);
|
||||
SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware, RawSwitchItemModel * rawSwitchItemModel);
|
||||
virtual ~SetupPanel();
|
||||
|
||||
virtual void update();
|
||||
@@ -133,7 +139,7 @@ class SetupPanel : public ModelPanel
|
||||
signals:
|
||||
void extendedLimitsToggled();
|
||||
void updated();
|
||||
void timerUpdated();
|
||||
void updateDataModels();
|
||||
|
||||
private slots:
|
||||
void on_name_editingFinished();
|
||||
@@ -163,6 +169,7 @@ class SetupPanel : public ModelPanel
|
||||
void cmTimerPaste();
|
||||
void cmTimerMoveDown();
|
||||
void cmTimerMoveUp();
|
||||
void onTimerNameChanged();
|
||||
|
||||
private:
|
||||
Ui::Setup *ui;
|
||||
@@ -183,6 +190,7 @@ class SetupPanel : public ModelPanel
|
||||
bool moveTimerDownAllowed() const;
|
||||
bool moveTimerUpAllowed() const;
|
||||
void swapTimerData(int idx1, int idx2);
|
||||
};
|
||||
RawItemFilteredModel * rawSwitchFilteredModel;
|
||||
};
|
||||
|
||||
#endif // _SETUP_H_
|
||||
|
||||
Reference in New Issue
Block a user