mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 11:05:44 +08:00
Register "dot commands" for help (CCommandInput)
This commit is contained in:
committed by
Mat Sutcliffe
parent
72334af1e8
commit
84cfec81e7
@@ -26,6 +26,12 @@ namespace BlackGui
|
|||||||
CLineEditHistory(parent),
|
CLineEditHistory(parent),
|
||||||
CIdentifiable(this)
|
CIdentifiable(this)
|
||||||
{
|
{
|
||||||
|
if (!CSimpleCommandParser::registered("BlackGui::Components::CCommandInput"))
|
||||||
|
{
|
||||||
|
CSimpleCommandParser::registerCommand({".tooltip", "toggle dot command tooltip"});
|
||||||
|
CSimpleCommandParser::registerCommand({".help", "show help"});
|
||||||
|
}
|
||||||
|
|
||||||
if (this->placeholderText().isEmpty())
|
if (this->placeholderText().isEmpty())
|
||||||
{
|
{
|
||||||
this->setPlaceholderText(".dot commands");
|
this->setPlaceholderText(".dot commands");
|
||||||
@@ -91,7 +97,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CCommandInput::onSimulatorPluginChanged(const CSimulatorPluginInfo &info)
|
void CCommandInput::onSimulatorPluginChanged(const CSimulatorPluginInfo &info)
|
||||||
{
|
{
|
||||||
Q_UNUSED(info);
|
Q_UNUSED(info)
|
||||||
|
|
||||||
// different simulators have different commands
|
// different simulators have different commands
|
||||||
m_dsCommandTooltip.inputSignal();
|
m_dsCommandTooltip.inputSignal();
|
||||||
@@ -99,7 +105,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CCommandInput::onConnectedServerChanged(const Network::CServer &server)
|
void CCommandInput::onConnectedServerChanged(const Network::CServer &server)
|
||||||
{
|
{
|
||||||
Q_UNUSED(server);
|
Q_UNUSED(server)
|
||||||
|
|
||||||
// commands of network
|
// commands of network
|
||||||
m_dsCommandTooltip.inputSignal();
|
m_dsCommandTooltip.inputSignal();
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
bool CSimpleCommandParser::registered(const QString &helpContext)
|
bool CSimpleCommandParser::registered(const QString &helpContext)
|
||||||
{
|
{
|
||||||
if (s_registered.contains(helpContext)) { return true; };
|
if (s_registered.contains(helpContext)) { return true; }
|
||||||
s_registered.insert(helpContext);
|
s_registered.insert(helpContext);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user