mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-06 10:26:03 +08:00
refs #288, parseCommand in runtime, which distributes it to the contexts (easier, also for core command line)
This commit is contained in:
committed by
Roland Winklmeier
parent
8b002e1510
commit
788078f72a
@@ -126,6 +126,15 @@ namespace BlackCore
|
|||||||
return (token == this->m_contextApplication->ping(token));
|
return (token == this->m_contextApplication->ping(token));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CRuntime::parseCommandLine(const QString commandLine)
|
||||||
|
{
|
||||||
|
bool handled = false;
|
||||||
|
if (this->getIContextAudio()) { handled = handled || this->getIContextAudio()->parseCommandLine(commandLine); }
|
||||||
|
if (this->getIContextNetwork()) { handled = handled || this->getIContextNetwork()->parseCommandLine(commandLine); }
|
||||||
|
if (this->getIContextOwnAircraft()) { handled = handled || this->getIContextOwnAircraft()->parseCommandLine(commandLine); }
|
||||||
|
return handled;
|
||||||
|
}
|
||||||
|
|
||||||
void CRuntime::initDBusServer(const QString &dBusAddress)
|
void CRuntime::initDBusServer(const QString &dBusAddress)
|
||||||
{
|
{
|
||||||
if (this->m_dbusServer) return;
|
if (this->m_dbusServer) return;
|
||||||
|
|||||||
@@ -149,6 +149,10 @@ namespace BlackCore
|
|||||||
//! Is application context available?
|
//! Is application context available?
|
||||||
bool canPingApplicationContext() const;
|
bool canPingApplicationContext() const;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
//! Parse command line in all contexts
|
||||||
|
bool parseCommandLine(const QString commandLine);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_init = false; /*!< flag */
|
bool m_init = false; /*!< flag */
|
||||||
|
|
||||||
|
|||||||
@@ -86,10 +86,7 @@ namespace BlackGui
|
|||||||
connect(this->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CMainKeypadAreaComponent::ps_connectionStatusChanged);
|
connect(this->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CMainKeypadAreaComponent::ps_connectionStatusChanged);
|
||||||
connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CMainKeypadAreaComponent::ps_ownAircraftCockpitChanged);
|
connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CMainKeypadAreaComponent::ps_ownAircraftCockpitChanged);
|
||||||
connect(this->getIContextAudio(), &IContextAudio::changedMute, this, &CMainKeypadAreaComponent::ps_muteChanged);
|
connect(this->getIContextAudio(), &IContextAudio::changedMute, this, &CMainKeypadAreaComponent::ps_muteChanged);
|
||||||
|
connect(this, &CMainKeypadAreaComponent::commandEntered, this->getRuntime(), &CRuntime::parseCommandLine);
|
||||||
connect(this, &CMainKeypadAreaComponent::commandEntered, this->getIContextOwnAircraft(), &IContextOwnAircraft::parseCommandLine);
|
|
||||||
connect(this, &CMainKeypadAreaComponent::commandEntered, this->getIContextNetwork(), &IContextNetwork::parseCommandLine);
|
|
||||||
connect(this, &CMainKeypadAreaComponent::commandEntered, this->getIContextAudio(), &IContextAudio::parseCommandLine);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMainKeypadAreaComponent::ps_buttonSelected()
|
void CMainKeypadAreaComponent::ps_buttonSelected()
|
||||||
|
|||||||
@@ -163,10 +163,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CTextMessageComponent::ps_onChangedAircraftCockpit);
|
connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CTextMessageComponent::ps_onChangedAircraftCockpit);
|
||||||
connect(this->getDockWidgetInfoArea(), &CDockWidgetInfoArea::widgetTopLevelChanged, this, &CTextMessageComponent::ps_topLevelChanged);
|
connect(this->getDockWidgetInfoArea(), &CDockWidgetInfoArea::widgetTopLevelChanged, this, &CTextMessageComponent::ps_topLevelChanged);
|
||||||
|
connect(this, &CTextMessageComponent::commandEntered, this->getRuntime(), &CRuntime::parseCommandLine);
|
||||||
connect(this, &CTextMessageComponent::commandEntered, this->getIContextOwnAircraft(), &IContextOwnAircraft::parseCommandLine);
|
|
||||||
connect(this, &CTextMessageComponent::commandEntered, this->getIContextNetwork(), &IContextNetwork::parseCommandLine);
|
|
||||||
connect(this, &CTextMessageComponent::commandEntered, this->getIContextAudio(), &IContextAudio::parseCommandLine);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user