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:
Klaus Basan
2019-04-04 23:25:16 +02:00
committed by Mat Sutcliffe
parent 3bb5efcb29
commit dc6e18b5a2
4 changed files with 26 additions and 12 deletions

View File

@@ -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());
}