From cd2c7c12a7503666f2d58622d84ef04ca4e1a59f Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Thu, 20 Nov 2014 23:01:09 +0100 Subject: [PATCH] Init COM values from ownAircraft context --- src/blackgui/components/cockpitcomcomponent.cpp | 8 ++++++-- src/blackgui/components/cockpitcomponent.cpp | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) 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