Init COM values from ownAircraft context

This commit is contained in:
Klaus Basan
2014-11-20 23:01:09 +01:00
committed by Roland Winklmeier
parent a07ecfb49b
commit cd2c7c12a7
2 changed files with 6 additions and 3 deletions

View File

@@ -56,6 +56,12 @@ namespace BlackGui
void CCockpitComComponent::runtimeHasBeenSet()
{
Q_ASSERT(this->getIContextOwnAircraft());
Q_ASSERT(this->getIContextAudio());
// init from aircraft
CAircraft ownAircraft = this->getOwnAircraft();
this->ps_updateCockpitFromContext(ownAircraft, "dummyInitialValues");
// SELCAL pairs in cockpit
this->ui->frp_ComPanelSelcalBottom->clear();
@@ -73,12 +79,10 @@ namespace BlackGui
connect(this->ui->frp_ComPanelSelcalBottom, &CSelcalCodeSelector::valueChanged, this, &CCockpitComComponent::ps_guiChangedSelcal);
// hook up with changes from own aircraft context
Q_ASSERT(this->getIContextOwnAircraft());
this->connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CCockpitComComponent::ps_updateCockpitFromContext);
this->connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedSelcal, this, &CCockpitComComponent::ps_onChangedSelcal);
// hook up with audio context
Q_ASSERT(this->getIContextAudio());
this->connect(this->getIContextAudio(), &IContextAudio::changedVoiceRooms, this, &CCockpitComComponent::ps_onChangedVoiceRoomStatus);
}

View File

@@ -87,7 +87,6 @@ namespace BlackGui
// manually setting size, all other approaches failed
this->window()->resize(defaultSizeShown);
this->m_sizeFloatingShown = this->window()->size();
}
}
else