mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 01:45:38 +08:00
Matcher settings as dialog so they can be changed in mapping tool model matcher for testing
This commit is contained in:
@@ -32,22 +32,45 @@ namespace BlackGui
|
||||
connect(ui->pb_Reload, &QPushButton::released, this, &CSettingsMatchingComponent::onReloadPressed);
|
||||
connect(ui->pb_MatchingAgain, &QPushButton::released, this, &CSettingsMatchingComponent::onMatchingsAgainPressed);
|
||||
|
||||
// also used in mapping tool, must also work without contexts
|
||||
IContextSimulator *simContext = simulatorContext();
|
||||
if (simContext)
|
||||
{
|
||||
connect(simContext, &IContextSimulator::matchingSetupChanged, this, &CSettingsMatchingComponent::onSetupChanged, Qt::QueuedConnection);
|
||||
this->deferredReload(5000);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->showButtons(false);
|
||||
}
|
||||
this->deferredReload(5000);
|
||||
}
|
||||
|
||||
CSettingsMatchingComponent::~CSettingsMatchingComponent()
|
||||
{ }
|
||||
|
||||
CAircraftMatcherSetup CSettingsMatchingComponent::getMatchingSetup() const
|
||||
{
|
||||
return ui->form_Matching->value();
|
||||
}
|
||||
|
||||
void CSettingsMatchingComponent::setMatchingSetup(const CAircraftMatcherSetup &setup)
|
||||
{
|
||||
ui->form_Matching->setValue(setup);
|
||||
}
|
||||
|
||||
void CSettingsMatchingComponent::showButtons(bool show)
|
||||
{
|
||||
ui->fr_Buttons->setVisible(show);
|
||||
// ui->pb_MatchingAgain->setVisible(show);
|
||||
// ui->pb_Reload->setVisible(show);
|
||||
// ui->pb_Save->setVisible(show);
|
||||
}
|
||||
|
||||
void CSettingsMatchingComponent::onSavePressed() const
|
||||
{
|
||||
IContextSimulator *simContext = simulatorContext();
|
||||
if (!simContext) { return; }
|
||||
const CAircraftMatcherSetup setup = ui->editor_MatchingForm->value();
|
||||
const CAircraftMatcherSetup setup = ui->form_Matching->value();
|
||||
simContext->setMatchingSetup(setup);
|
||||
}
|
||||
|
||||
@@ -72,12 +95,12 @@ namespace BlackGui
|
||||
|
||||
void CSettingsMatchingComponent::deferredReload(int deferMs)
|
||||
{
|
||||
IContextSimulator *simContext = simulatorContext();
|
||||
if (!simContext) { return; }
|
||||
if (deferMs < 1)
|
||||
{
|
||||
IContextSimulator *simContext = simulatorContext();
|
||||
if (!simContext) { return; }
|
||||
const CAircraftMatcherSetup setup = simContext->getMatchingSetup();
|
||||
ui->editor_MatchingForm->setValue(setup);
|
||||
ui->form_Matching->setValue(setup);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user