mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
Ref T591, avoid duplicated text message lines
* also consider Qt::Key_Enter (NUMPAD) * signal returnPressedUnemptyLine * use signal returnPressedUnemptyLine instead of returnPressed which avoids empty lines
This commit is contained in:
committed by
Mat Sutcliffe
parent
3bb5efcb29
commit
dc6e18b5a2
@@ -49,7 +49,7 @@ namespace BlackGui
|
||||
connect(sGui->getIContextNetwork(), &IContextNetwork::connectedServerChanged, this, &CCommandInput::onConnectedServerChanged, Qt::QueuedConnection);
|
||||
}
|
||||
}
|
||||
connect(this, &CCommandInput::returnPressed, this, &CCommandInput::validateCommand);
|
||||
connect(this, &CCommandInput::returnPressedUnemptyLine, this, &CCommandInput::validateCommand, Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
void CCommandInput::showToolTip(bool show)
|
||||
@@ -64,7 +64,7 @@ namespace BlackGui
|
||||
if (c.isEmpty()) { return; }
|
||||
if (c.startsWith('.'))
|
||||
{
|
||||
if (c.contains("help", Qt::CaseInsensitive)) { this->setCommandToolTip(); return; }
|
||||
if (c.contains("help", Qt::CaseInsensitive)) { this->setCommandToolTip(); return; }
|
||||
if (c.contains("tooltip", Qt::CaseInsensitive)) { this->showToolTip(!m_showToolTip); return; }
|
||||
emit this->commandEntered(c, this->identifier());
|
||||
}
|
||||
|
||||
@@ -69,14 +69,14 @@ namespace BlackGui
|
||||
ui->comp_AtcStations->setWithIcons(false);
|
||||
|
||||
// lep_textMessages is the own line edit
|
||||
bool c = connect(ui->lep_textMessages, &CLineEditHistory::returnPressed, this, &CTextMessageComponent::textMessageEntered);
|
||||
bool c = connect(ui->lep_textMessages, &CLineEditHistory::returnPressedUnemptyLine, this, &CTextMessageComponent::textMessageEntered, Qt::QueuedConnection);
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect");
|
||||
c = connect(ui->gb_Settings, &QGroupBox::toggled, this, &CTextMessageComponent::onSettingsChecked);
|
||||
c = connect(ui->gb_Settings, &QGroupBox::toggled, this, &CTextMessageComponent::onSettingsChecked, Qt::QueuedConnection);
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect");
|
||||
c = connect(ui->gb_MessageTo, &QGroupBox::toggled, this, &CTextMessageComponent::onMessageToChecked);
|
||||
c = connect(ui->gb_MessageTo, &QGroupBox::toggled, this, &CTextMessageComponent::onMessageToChecked, Qt::QueuedConnection);
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect");
|
||||
|
||||
c = connect(ui->comp_AtcStations, &CAtcButtonComponent::requestAtcStation, this, &CTextMessageComponent::onAtcButtonClicked);
|
||||
c = connect(ui->comp_AtcStations, &CAtcButtonComponent::requestAtcStation, this, &CTextMessageComponent::onAtcButtonClicked, Qt::QueuedConnection);
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect");
|
||||
|
||||
// style sheet
|
||||
|
||||
Reference in New Issue
Block a user