13 using namespace swift::misc::network;
14 using namespace swift::misc::simulation;
15 using namespace swift::core::context;
21 if (!CSimpleCommandParser::registered(
"swift::gui::components::CCommandInput"))
23 CSimpleCommandParser::registerCommand({
".tooltip",
"toggle dot command tooltip" });
24 CSimpleCommandParser::registerCommand({
".help",
"show help" });
27 if (this->placeholderText().isEmpty()) { this->setPlaceholderText(
".dot commands"); }
29 const QPointer<CCommandInput> myself(
this);
31 if (!myself) {
return; }
40 &CCommandInput::onSimulatorPluginChanged, Qt::QueuedConnection);
45 &CCommandInput::onConnectedServerChanged, Qt::QueuedConnection);
49 Qt::QueuedConnection);
55 this->setCommandToolTip();
58 void CCommandInput::validateCommand()
61 if (c.isEmpty()) {
return; }
62 if (c.startsWith(
'.'))
64 if (c.contains(
"help", Qt::CaseInsensitive))
66 this->setCommandToolTip();
69 if (c.contains(
"tooltip", Qt::CaseInsensitive))
79 void CCommandInput::setCommandToolTip()
81 if (m_showToolTip) { this->setToolTip(CSimpleCommandParser::commandsHtmlHelp()); }
82 else { this->setToolTip(
""); }
const context::IContextNetwork * getIContextNetwork() const
Direct access to contexts if a CCoreFacade has been initialized.
const context::IContextSimulator * getIContextSimulator() const
Direct access to contexts if a CCoreFacade has been initialized.
bool supportsContexts(bool ignoreShutdownTest=false) const
Supports contexts.
QString getLastEnteredLineFormatted() const
Get the last entered line but simplified and trimmed.
void returnPressedUnemptyLine()
Return has been pressed, line is NOT empty (spaces are trimmed)
void inputSignal()
Received input signal, or manually trigger.
Base class with a member CIdentifier to be inherited by a class which has an identity in the environm...
const CIdentifier & identifier() const
Get identifier.
Value object encapsulating information of a server.
Describing a simulator plugin.
SWIFT_GUI_EXPORT swift::gui::CGuiApplication * sGui
Single instance of GUI application object.
High level reusable GUI components.
Free functions in swift::misc.
auto singleShot(int msec, QObject *target, F &&task)
Starts a single-shot timer which will call a task in the thread of the given object when it times out...