Ref T166, use command input in main keypad area

This commit is contained in:
Klaus Basan
2017-09-28 04:37:18 +02:00
parent 706a1b7b3d
commit f815f7734d
3 changed files with 6 additions and 30 deletions

View File

@@ -64,15 +64,13 @@ namespace BlackGui
connect(ui->pb_Audio, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
// command line
this->connect(ui->lep_CommandLineInput, &QLineEdit::returnPressed, this, &CMainKeypadAreaComponent::onCommandEntered);
ui->lep_CommandLineInput->setIdentifier(m_identifier);
this->connect(ui->lep_CommandLineInput, &CCommandInput::commandEntered, this, &CMainKeypadAreaComponent::commandEntered);
connect(sGui->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CMainKeypadAreaComponent::connectionStatusChanged);
connect(sGui->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CMainKeypadAreaComponent::ownAircraftCockpitChanged);
connect(sGui->getIContextAudio(), &IContextAudio::changedMute, this, &CMainKeypadAreaComponent::muteChanged);
connect(this, &CMainKeypadAreaComponent::commandEntered, sGui->getCoreFacade(), &CCoreFacade::parseCommandLine);
this->setCommandTooltip();
QTimer::singleShot(15000, this, &CMainKeypadAreaComponent::setCommandTooltip);
}
CMainKeypadAreaComponent::~CMainKeypadAreaComponent()
@@ -161,23 +159,6 @@ namespace BlackGui
}
}
void CMainKeypadAreaComponent::onCommandEntered()
{
const QString c(ui->lep_CommandLineInput->getLastEnteredLineFormatted());
if (c.isEmpty()) { return; }
if (c.toLower().trimmed().contains("help"))
{
this->setCommandTooltip();
return;
}
emit this->commandEntered(c, m_identifier);
}
void CMainKeypadAreaComponent::setCommandTooltip()
{
ui->lep_CommandLineInput->setToolTip(sGui->getIContextApplication()->dotCommandsHtmlHelp());
}
void CMainKeypadAreaComponent::ownAircraftCockpitChanged(const CSimulatedAircraft &aircraft, const CIdentifier &originator)
{
Q_UNUSED(originator);