diff --git a/src/blackgui/components/cockpitcomcomponent.cpp b/src/blackgui/components/cockpitcomcomponent.cpp index 069b23696..14e9d1f4f 100644 --- a/src/blackgui/components/cockpitcomcomponent.cpp +++ b/src/blackgui/components/cockpitcomcomponent.cpp @@ -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); } diff --git a/src/blackgui/components/cockpitcomponent.cpp b/src/blackgui/components/cockpitcomponent.cpp index 6244d0838..2cde9a016 100644 --- a/src/blackgui/components/cockpitcomponent.cpp +++ b/src/blackgui/components/cockpitcomponent.cpp @@ -87,7 +87,6 @@ namespace BlackGui // manually setting size, all other approaches failed this->window()->resize(defaultSizeShown); this->m_sizeFloatingShown = this->window()->size(); - } } else