refs #77, handling commands (aka dot commands)

* network, aircraft context consume command line commands
* hooked up with keypad area
This commit is contained in:
Klaus Basan
2014-10-29 01:28:36 +01:00
committed by Roland Winklmeier
parent fe2fa65d36
commit cd69eebe8c
12 changed files with 115 additions and 8 deletions

View File

@@ -58,7 +58,9 @@ namespace BlackGui
Q_ASSERT(this->getIContextOwnAircraft());
Q_ASSERT(this->getIContextNetwork());
connect(this->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CMainKeypadAreaComponent::ps_connectionStatusChanged);
connect(this, &CMainKeypadAreaComponent::commandEntered, this->getIContextNetwork(), &IContextNetwork::parseCommandLine);
connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CMainKeypadAreaComponent::ps_ownAircraftCockpitChanged);
connect(this, &CMainKeypadAreaComponent::commandEntered, this->getIContextOwnAircraft(), &IContextOwnAircraft::parseCommandLine);
}
void CMainKeypadAreaComponent::ps_buttonPressed()
@@ -97,11 +99,6 @@ namespace BlackGui
}
}
void CMainKeypadAreaComponent::ps_buttonDoubleClicked()
{
}
void CMainKeypadAreaComponent::ps_connectionStatusChanged(uint from, uint to, const QString &message)
{
INetwork::ConnectionStatus statusFrom = static_cast<INetwork::ConnectionStatus>(from);
@@ -128,6 +125,7 @@ namespace BlackGui
QString c = this->ui->le_CommandLineInput->text().trimmed();
if (c.isEmpty()) return;
emit this->commandEntered(c);
this->ui->le_CommandLineInput->clear();
}
void CMainKeypadAreaComponent::ps_ownAircraftCockpitChanged(const CAircraft &aircraft, const QString &originator)