[Companion] Refactor FlightModePanel and TimerPanel to use shared RawSwitch data models instead of one per instance.

This commit is contained in:
Max Paperno
2018-07-12 13:20:07 -04:00
parent 81c33b6432
commit 70aa7c6ad8
4 changed files with 52 additions and 51 deletions
+3 -3
View File
@@ -37,14 +37,14 @@ class TimerPanel : public ModelPanel
Q_OBJECT
public:
TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings, Firmware * firmware, QWidget *prevFocus);
TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings, Firmware * firmware, QWidget *prevFocus, RawSwitchFilterItemModel * switchModel);
virtual ~TimerPanel();
virtual void update();
QWidget * getLastFocus();
private slots:
void on_mode_currentIndexChanged(int index);
void onModeChanged(int index);
void on_value_editingFinished();
void on_minuteBeep_toggled(bool checked);
void on_name_editingFinished();
@@ -52,7 +52,6 @@ class TimerPanel : public ModelPanel
private:
TimerData & timer;
Ui::Timer * ui;
RawSwitchFilterItemModel * rawSwitchItemModel;
};
class ModulePanel : public ModelPanel
@@ -126,6 +125,7 @@ class SetupPanel : public ModelPanel
signals:
void extendedLimitsToggled();
void updated();
private slots:
void on_name_editingFinished();