diff --git a/src/blackgui/components/mainkeypadareacomponent.cpp b/src/blackgui/components/mainkeypadareacomponent.cpp index ccab5fde3..699a42b8c 100644 --- a/src/blackgui/components/mainkeypadareacomponent.cpp +++ b/src/blackgui/components/mainkeypadareacomponent.cpp @@ -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); diff --git a/src/blackgui/components/mainkeypadareacomponent.h b/src/blackgui/components/mainkeypadareacomponent.h index 9e0899b2a..cd55a7623 100644 --- a/src/blackgui/components/mainkeypadareacomponent.h +++ b/src/blackgui/components/mainkeypadareacomponent.h @@ -74,12 +74,6 @@ namespace BlackGui //! Button was clicked void buttonSelected(); - //! Command line entered - void onCommandEntered(); - - //! Display help as HTML - void setCommandTooltip(); - //! \copydoc BlackCore::Context::IContextNetwork::connectionStatusChanged void connectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to); diff --git a/src/blackgui/components/mainkeypadareacomponent.ui b/src/blackgui/components/mainkeypadareacomponent.ui index 36cf86ab9..dfa8e710c 100644 --- a/src/blackgui/components/mainkeypadareacomponent.ui +++ b/src/blackgui/components/mainkeypadareacomponent.ui @@ -443,7 +443,7 @@ - + 0 @@ -465,9 +465,10 @@ - BlackGui::CLineEditHistory + BlackGui::Components::CCommandInput QLineEdit -
blackgui/lineedithistory.h
+
blackgui/components/commandinput.h
+ 1