mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
refs #618, allow to modify and validate data when loaded for a view
* allows to reject data considered incorrect * data can be modified and adjusted after loading before displaying
This commit is contained in:
@@ -289,6 +289,19 @@ namespace BlackGui
|
||||
CViewWithDbObjects::customMenu(menu);
|
||||
}
|
||||
|
||||
CStatusMessage CAircraftModelView::validateLoadedData(const CAircraftModelList &models) const
|
||||
{
|
||||
static const CStatusMessage ok(this, CStatusMessage::SeverityInfo, "model validation passed", true);
|
||||
if (models.isEmpty()) { return CStatusMessage(this, CStatusMessage::SeverityInfo, "no data", true); }
|
||||
if (this->m_validation == AllowOnlySingeSimulator)
|
||||
{
|
||||
const CSimulatorInfo sim = models.simulatorsSupported();
|
||||
if (sim.isSingleSimulator()) { return ok; }
|
||||
return CStatusMessage(this, CStatusMessage::SeverityError, "data need to be from one simulator");
|
||||
}
|
||||
return CViewWithDbObjects::validateLoadedData(models);
|
||||
}
|
||||
|
||||
void CAircraftModelView::ps_toggleHighlightStashedModels()
|
||||
{
|
||||
bool h = derivedModel()->highlightModelStrings();
|
||||
|
||||
Reference in New Issue
Block a user