28 Q_ASSERT_X(
m_parsed, Q_FUNC_INFO,
"Not yet parsed cmd line arguments");
31 const QString coreModeStr =
36 if (!coreModeStr.isEmpty())
38 if (coreMode == CoreModes::Standalone && !dBusAddress.isEmpty())
41 CStatusMessage(
this, CLogCategories::validation()).
error(u
"Inconsistent pair DBus: '%1' and core: '%2'")
42 << dBusAddress << coreModeStr;
49 if (!dBusAddress.isEmpty() && coreModeStr.isEmpty())
51 coreMode = CoreModes::Distributed;
53 CStatusMessage(
this, CLogCategories::validation()).
info(u
"No DBus address, setting core mode: '%1'")
54 << CoreModes::coreModeToString(coreMode);
57 else if (dBusAddress.isEmpty() && coreMode == CoreModes::Distributed)
59 dBusAddress = CDBusServer::sessionBusAddress();
61 CStatusMessage(
this, CLogCategories::validation()).
info(u
"Setting DBus address to '%1'") << dBusAddress;
65 CCoreFacadeConfig runtimeConfig = coreModeToCoreFacadeConfig(coreMode, dBusAddress);
75 if (!dBusAddress.isEmpty())
78 if (!CDBusServer::isDBusAvailable(dBusAddress))
80 this->
cmdLineErrorMessage(
"DBus error",
"DBus server at '" + dBusAddress +
"' can not be reached");
84 return CGuiApplication::parsingHookIn();
89 return qobject_cast<CSwiftGuiStdApplication *>(CApplication::instance());
93 const QString &dBusAddress)
97 case CoreModes::Distributed:
return CCoreFacadeConfig(CCoreFacadeConfig::Remote, dBusAddress);
98 case CoreModes::Standalone:
return CCoreFacadeConfig(CCoreFacadeConfig::Local, dBusAddress);
break;
100 Q_ASSERT_X(
false, Q_FUNC_INFO,
"Not handled core mode");
Specialized GUI application for swift pilot client.
CSwiftGuiStdApplication()
Constructor.
CSwiftGuiStdApplication * instance()
Single instance.
virtual bool parsingHookIn()
Parsing of special CMD args.
virtual swift::misc::CStatusMessageList startHookIn()
Start facade by cmd arguments.
QString getParserValue(const QString &option) const
Delegates to QCommandLineParser::value.
void addAudioOptions()
Add the audio options.
void addNetworkOptions()
Add the network options.
bool m_parsed
Parsing accomplished?
bool isParserOptionSet(const QString &option) const
Delegates to QCommandLineParser::isSet.
QString getCmdDBusAddressValue() const
DBus address from CMD line, otherwise "".
void addDBusAddressOption()
CMD line argument for DBus address.
swift::misc::CStatusMessageList initContextsAndStartCoreFacade(const CCoreFacadeConfig &coreConfig)
Init the contexts part and start core facade.
bool addParserOption(const QCommandLineOption &option)
Configuration object for the contexts.
void cmdLineErrorMessage(const QString &text, const QString &informativeText) const
print messages generated during parsing / cmd handling
Description of a swift application.
Derived & error(const char16_t(&format)[N])
Set the severity to error, providing a format string.
Derived & info(const char16_t(&format)[N])
Set the severity to info, providing a format string.
void push_back(const T &value)
Appends an element at the end of the sequence.
Streamable status message, e.g.
Status messages, e.g. from Core -> GUI.
Backend services of the swift project, like dealing with the network or the simulators.
Free functions in swift::misc.
CoreMode
Core runs how and where?