mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
refs #485, removal of CEnableForRuntime
This commit is contained in:
committed by
Mathew Sutcliffe
parent
158efe819a
commit
3829aaeae8
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "mainkeypadareacomponent.h"
|
||||
#include "ui_mainkeypadareacomponent.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackcore/contextaudio.h"
|
||||
#include "blackcore/contextnetwork.h"
|
||||
#include "blackcore/contextownaircraft.h"
|
||||
@@ -54,6 +55,11 @@ namespace BlackGui
|
||||
|
||||
// command line
|
||||
this->connect(this->ui->le_CommandLineInput, &QLineEdit::returnPressed, this, &CMainKeypadAreaComponent::ps_commandEntered);
|
||||
|
||||
connect(sGui->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CMainKeypadAreaComponent::ps_connectionStatusChanged);
|
||||
connect(sGui->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CMainKeypadAreaComponent::ps_ownAircraftCockpitChanged);
|
||||
connect(sGui->getIContextAudio(), &IContextAudio::changedMute, this, &CMainKeypadAreaComponent::ps_muteChanged);
|
||||
connect(this, &CMainKeypadAreaComponent::commandEntered, sGui->getCoreFacade(), &CCoreFacade::parseCommandLine);
|
||||
}
|
||||
|
||||
CMainKeypadAreaComponent::~CMainKeypadAreaComponent()
|
||||
@@ -72,7 +78,7 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
foreach(int floatingIndex, floatingIndexes)
|
||||
foreach (int floatingIndex, floatingIndexes)
|
||||
{
|
||||
QPushButton *pb = this->mainInfoAreaToButton(static_cast<CMainInfoAreaComponent::InfoArea>(floatingIndex));
|
||||
if (pb) {pb->setChecked(true); }
|
||||
@@ -81,18 +87,6 @@ namespace BlackGui
|
||||
Q_UNUSED(dockedIndexes);
|
||||
}
|
||||
|
||||
void CMainKeypadAreaComponent::runtimeHasBeenSet()
|
||||
{
|
||||
Q_ASSERT(this->getIContextOwnAircraft());
|
||||
Q_ASSERT(this->getIContextNetwork());
|
||||
Q_ASSERT(this->getIContextAudio());
|
||||
|
||||
connect(this->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CMainKeypadAreaComponent::ps_connectionStatusChanged);
|
||||
connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CMainKeypadAreaComponent::ps_ownAircraftCockpitChanged);
|
||||
connect(this->getIContextAudio(), &IContextAudio::changedMute, this, &CMainKeypadAreaComponent::ps_muteChanged);
|
||||
connect(this, &CMainKeypadAreaComponent::commandEntered, this->getRuntime(), &CCoreFacade::parseCommandLine);
|
||||
}
|
||||
|
||||
void CMainKeypadAreaComponent::ps_buttonSelected()
|
||||
{
|
||||
QPushButton *senderButton = static_cast<QPushButton *>(QObject::sender());
|
||||
@@ -106,7 +100,7 @@ namespace BlackGui
|
||||
senderButton->setChecked(true); // re-check if got unchecked, we use checked buttons like normal buttons
|
||||
return;
|
||||
}
|
||||
else if (senderButton == this->ui->pb_CockpitIdent && this->getIContextOwnAircraft())
|
||||
else if (senderButton == this->ui->pb_CockpitIdent && sGui->getIContextOwnAircraft())
|
||||
{
|
||||
emit identPressed();
|
||||
}
|
||||
@@ -118,14 +112,14 @@ namespace BlackGui
|
||||
{
|
||||
emit changedOpacity(100);
|
||||
}
|
||||
else if (senderButton == this->ui->pb_SoundMaxVolume && this->getIContextAudio())
|
||||
else if (senderButton == this->ui->pb_SoundMaxVolume && sGui->getIContextAudio())
|
||||
{
|
||||
this->getIContextAudio()->setVoiceOutputVolume(100);
|
||||
sGui->getIContextAudio()->setVoiceOutputVolume(100);
|
||||
}
|
||||
else if (senderButton == this->ui->pb_SoundMute && this->getIContextAudio())
|
||||
else if (senderButton == this->ui->pb_SoundMute && sGui->getIContextAudio())
|
||||
{
|
||||
bool mute = this->getIContextAudio()->isMuted();
|
||||
this->getIContextAudio()->setMute(!mute);
|
||||
bool mute = sGui->getIContextAudio()->isMuted();
|
||||
sGui->getIContextAudio()->setMute(!mute);
|
||||
}
|
||||
else if (senderButton == this->ui->pb_Connect)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user