Refactor to directly call updates to data models

This commit is contained in:
elecpower
2020-10-02 07:06:00 +10:00
parent 1364a88eb0
commit af4c5524b1
30 changed files with 401 additions and 331 deletions
+2 -3
View File
@@ -56,11 +56,10 @@ GeneralEdit::GeneralEdit(QWidget * parent, RadioData & radioData, Firmware * fir
}
}
RawSourceItemModel *rawSourceModel = new RawSourceItemModel(&generalSettings, nullptr, this);
RawSwitchItemModel *rawSwitchModel = new RawSwitchItemModel(&generalSettings, nullptr, this);
commonItemModels = new CommonItemModels(&generalSettings, nullptr, this);
addTab(new GeneralSetupPanel(this, generalSettings, firmware), tr("Setup"));
addTab(new CustomFunctionsPanel(this, nullptr, generalSettings, firmware, rawSourceModel, rawSwitchModel), tr("Global Functions"));
addTab(new CustomFunctionsPanel(this, nullptr, generalSettings, firmware, commonItemModels), tr("Global Functions"));
addTab(new TrainerPanel(this, generalSettings, firmware), tr("Trainer"));
addTab(new HardwarePanel(this, generalSettings, firmware), tr("Hardware"));
addTab(new CalibrationPanel(this, generalSettings, firmware), tr("Calibration"));
+4 -2
View File
@@ -25,6 +25,8 @@
#include "eeprominterface.h"
#include "genericpanel.h"
class CommonItemModels;
namespace Ui {
class GeneralEdit;
}
@@ -56,7 +58,7 @@ class GeneralEdit : public QDialog
void getGeneralSwitchDefPos(int i, bool val);
void setSwitchDefPos();
void updateVarioPitchRange();
signals:
void modified();
@@ -71,7 +73,7 @@ class GeneralEdit : public QDialog
QVector<GenericPanel *> panels;
void addTab(GenericPanel *panel, QString text);
void closeEvent(QCloseEvent *event);
CommonItemModels *commonItemModels;
};
#endif // _GENERALEDIT_H_