diff --git a/src/blackcore/coremodeenums.h b/src/blackcore/coremodeenums.h index 1b2d37eb4..fd1e1dd14 100644 --- a/src/blackcore/coremodeenums.h +++ b/src/blackcore/coremodeenums.h @@ -22,22 +22,24 @@ namespace BlackCore //! Core runs how and where? enum CoreMode { - CoreInGuiProcess, - CoreExternal + Standalone, + Distributed }; //! String to core mode static CoreMode stringToCoreMode(const QString &m) { QString cm(m.toLower().trimmed()); - if (cm.isEmpty()) { return CoreInGuiProcess; } - if (m == coreModeToString(CoreInGuiProcess)) { return CoreInGuiProcess; } - if (m == coreModeToString(CoreExternal)) { return CoreExternal; } + if (cm.isEmpty()) { return Standalone; } + if (m == coreModeToString(Standalone)) { return Standalone; } + if (m == coreModeToString(Distributed)) { return Distributed; } // some alternative names - if (cm.contains("external")) { return CoreExternal; } - if (cm.contains("gui")) { return CoreInGuiProcess; } - return CoreInGuiProcess; + if (cm.contains("distribute")) { return Distributed; } + if (cm.contains("standalone")) { return Standalone; } + if (cm.contains("external")) { return Distributed; } + if (cm.contains("gui")) { return Standalone; } + return Standalone; } //! Core mode as string @@ -45,8 +47,8 @@ namespace BlackCore { switch (mode) { - case CoreInGuiProcess: return QStringLiteral("coreinguiprocess"); - case CoreExternal: return QStringLiteral("coreexternal"); + case Standalone: return QStringLiteral("standalone"); + case Distributed: return QStringLiteral("distributed"); } return {}; } diff --git a/src/blackcore/data/launchersetup.h b/src/blackcore/data/launchersetup.h index 64783738e..127b7393a 100644 --- a/src/blackcore/data/launchersetup.h +++ b/src/blackcore/data/launchersetup.h @@ -37,8 +37,7 @@ namespace BlackCore enum CoreMode { Standalone, - CoreWithAudioOnGui, - CoreWithAudioOnCore, + Distributed }; //! Default constructor diff --git a/src/swiftguistandard/swiftguistdapplication.cpp b/src/swiftguistandard/swiftguistdapplication.cpp index 06b4f5152..a195738d5 100644 --- a/src/swiftguistandard/swiftguistdapplication.cpp +++ b/src/swiftguistandard/swiftguistdapplication.cpp @@ -37,7 +37,7 @@ CStatusMessageList CSwiftGuiStdApplication::startHookIn() // Valid combination? if (!coreModeStr.isEmpty()) { - if (coreMode == CoreModes::CoreInGuiProcess && !dBusAddress.isEmpty()) + if (coreMode == CoreModes::Standalone && !dBusAddress.isEmpty()) { const CStatusMessage m = CStatusMessage(this, CLogCategory::validation()). error(u"Inconsistent pair DBus: '%1' and core: '%2'") @@ -50,13 +50,13 @@ CStatusMessageList CSwiftGuiStdApplication::startHookIn() CStatusMessageList msgs; if (!dBusAddress.isEmpty() && coreModeStr.isEmpty()) { - coreMode = CoreModes::CoreExternal; // default + coreMode = CoreModes::Distributed; // default const CStatusMessage m = CStatusMessage(this, CLogCategory::validation()). info(u"No DBus address, setting core mode: '%1'") << CoreModes::coreModeToString(coreMode); msgs.push_back(m); } - else if (dBusAddress.isEmpty() && coreMode == CoreModes::CoreExternal) + else if (dBusAddress.isEmpty() && coreMode == CoreModes::Distributed) { dBusAddress = CDBusServer::sessionBusAddress(); // a possible default const CStatusMessage m = CStatusMessage(this, CLogCategory::validation()). @@ -68,11 +68,11 @@ CStatusMessageList CSwiftGuiStdApplication::startHookIn() CCoreFacadeConfig runtimeConfig; switch (coreMode) { - case CoreModes::CoreExternal: + case CoreModes::Distributed: runtimeConfig = CCoreFacadeConfig::remote(dBusAddress); break; default: - case CoreModes::CoreInGuiProcess: + case CoreModes::Standalone: runtimeConfig = CCoreFacadeConfig::local(dBusAddress); break; } diff --git a/src/swiftguistandard/swiftguistdapplication.h b/src/swiftguistandard/swiftguistdapplication.h index 1e93c6218..5c4de36ed 100644 --- a/src/swiftguistandard/swiftguistdapplication.h +++ b/src/swiftguistandard/swiftguistdapplication.h @@ -44,7 +44,7 @@ private: QCommandLineOption m_cmdFacadeMode { { "c" , "core" }, - QCoreApplication::translate("main", "Core mode: (e)xternal, (g)ui (in GUI process), (l)ocalaudio (external, but local audio)."), + QCoreApplication::translate("main", "Core mode: (d)istributed, (s)tandalone."), "coremode" }; //!< Facade startup mode }; diff --git a/src/swiftlauncher/swiftlauncher.cpp b/src/swiftlauncher/swiftlauncher.cpp index e173488e5..b07dd3140 100644 --- a/src/swiftlauncher/swiftlauncher.cpp +++ b/src/swiftlauncher/swiftlauncher.cpp @@ -67,9 +67,8 @@ CSwiftLauncher::CSwiftLauncher(QWidget *parent) : connect(ui->tb_ConfigurationWizard, &QToolButton::pressed, this, &CSwiftLauncher::startWizard); connect(ui->tb_Launcher, &QToolBox::currentChanged, this, &CSwiftLauncher::tabChanged); - connect(ui->rb_SwiftCoreAudioOnCore, &QRadioButton::released, this, &CSwiftLauncher::onCoreModeReleased, Qt::QueuedConnection); - connect(ui->rb_SwiftCoreAudioOnGui, &QRadioButton::released, this, &CSwiftLauncher::onCoreModeReleased, Qt::QueuedConnection); - connect(ui->rb_SwiftStandalone, &QRadioButton::released, this, &CSwiftLauncher::onCoreModeReleased, Qt::QueuedConnection); + connect(ui->rb_SwiftDistributed, &QRadioButton::released, this, &CSwiftLauncher::onCoreModeReleased, Qt::QueuedConnection); + connect(ui->rb_SwiftStandalone, &QRadioButton::released, this, &CSwiftLauncher::onCoreModeReleased, Qt::QueuedConnection); connect(ui->comp_UpdateInfo, &CUpdateInfoComponent::updateInfoAvailable, this, &CSwiftLauncher::updateInfoAvailable, Qt::QueuedConnection); connect(ui->comp_UpdateInfo, &CUpdateInfoComponent::newerPilotClientAvailable, this, &CSwiftLauncher::setHeaderInfo, Qt::QueuedConnection); @@ -83,7 +82,7 @@ CSwiftLauncher::CSwiftLauncher(QWidget *parent) : connect(ui->pb_P3DConfigDirs, &QPushButton::released, this, &CSwiftLauncher::showSimulatorConfigDirs, Qt::QueuedConnection); const QShortcut *logPageShortCut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_L), this, SLOT(showLogPage())); - Q_UNUSED(logPageShortCut); + Q_UNUSED(logPageShortCut) // periodically check connect(&m_checkTimer, &QTimer::timeout, this, &CSwiftLauncher::checkRunningApplicationsAndCore); @@ -124,12 +123,11 @@ CEnableForFramelessWindow::WindowMode CSwiftLauncher::getWindowMode() const CoreModes::CoreMode CSwiftLauncher::getCoreMode() const { - if (ui->rb_SwiftStandalone->isChecked()) { return CoreModes::CoreInGuiProcess; } - if (ui->rb_SwiftCoreAudioOnCore->isChecked()) { return CoreModes::CoreExternal; } - if (ui->rb_SwiftCoreAudioOnGui->isChecked()) { return CoreModes::CoreExternal; } + if (ui->rb_SwiftStandalone->isChecked()) { return CoreModes::Standalone; } + if (ui->rb_SwiftDistributed->isChecked()) { return CoreModes::Distributed; } Q_ASSERT_X(false, Q_FUNC_INFO, "wrong mode"); - return CoreModes::CoreInGuiProcess; + return CoreModes::Standalone; } void CSwiftLauncher::mousePressEvent(QMouseEvent *event) @@ -258,8 +256,7 @@ bool CSwiftLauncher::setSwiftCoreExecutable() if (!sGui || sGui->isShuttingDown()) { return false; } this->saveSetup(); QStringList args = ui->comp_DBusSelector->getDBusCmdLineArgs(); - if (ui->rb_SwiftCoreAudioOnCore->isChecked()) { args.append("--coreaudio"); } - if (ui->cb_resetWindow->isChecked()) { args.append("--resetsize"); } + if (ui->cb_resetWindow->isChecked()) { args.append("--resetsize"); } m_executableArgs = sGui->argumentsJoined(args); m_executable = CDirectoryUtils::executableFilePath(CBuildConfig::swiftCoreExecutableName()); @@ -338,9 +335,8 @@ void CSwiftLauncher::setDefaults() ui->rb_WindowNormal->setChecked(!setup.useFramelessWindow()); const CLauncherSetup::CoreMode mode = setup.getCoreMode(); - ui->rb_SwiftStandalone->setChecked(mode == CLauncherSetup::Standalone ? true : false); - ui->rb_SwiftCoreAudioOnCore->setChecked(mode == CLauncherSetup::CoreWithAudioOnCore ? true : false); - ui->rb_SwiftCoreAudioOnGui->setChecked(mode == CLauncherSetup::CoreWithAudioOnGui ? true : false); + ui->rb_SwiftStandalone->setChecked(mode == CLauncherSetup::Standalone ? true : false); + ui->rb_SwiftDistributed->setChecked(mode == CLauncherSetup::Distributed ? true : false); } void CSwiftLauncher::saveSetup() @@ -350,16 +346,12 @@ void CSwiftLauncher::saveSetup() if (!dBus.isEmpty()) { setup.setDBusAddress(dBus); } setup.setFramelessWindow(ui->rb_WindowFrameless->isChecked()); setup.setCoreMode(CLauncherSetup::Standalone); - if (ui->rb_SwiftCoreAudioOnCore->isChecked()) + if (ui->rb_SwiftDistributed->isChecked()) { - setup.setCoreMode(CLauncherSetup::CoreWithAudioOnCore); - } - else if (ui->rb_SwiftCoreAudioOnGui->isChecked()) - { - setup.setCoreMode(CLauncherSetup::CoreWithAudioOnGui); + setup.setCoreMode(CLauncherSetup::Distributed); } const CStatusMessage msg = m_setup.set(setup); - Q_UNUSED(msg); + Q_UNUSED(msg) } bool CSwiftLauncher::warnAboutOtherSwiftApplications() @@ -425,7 +417,7 @@ void CSwiftLauncher::startButtonPressed() } else if (sender == ui->tb_SwiftCore) { - if (this->isStandaloneGuiSelected()) { ui->rb_SwiftCoreAudioOnGui->setChecked(true); } + if (this->isStandaloneGuiSelected()) { ui->rb_SwiftDistributed->setChecked(true); } ui->tb_SwiftCore->setEnabled(false); m_startCoreWaitCycles = 2; if (this->setSwiftCoreExecutable()) @@ -451,7 +443,7 @@ void CSwiftLauncher::dbusServerModeSelected(bool selected) { if (!selected) { return; } if (!this->isStandaloneGuiSelected()) { return; } - ui->rb_SwiftCoreAudioOnGui->setChecked(true); + ui->rb_SwiftDistributed->setChecked(true); } void CSwiftLauncher::showStatusMessage(const CStatusMessage &msg) @@ -508,10 +500,10 @@ void CSwiftLauncher::checkRunningApplicationsAndCore() if (m_startGuiWaitCycles > 0) { m_startGuiWaitCycles--; } const CApplicationInfoList runningApps = sGui->getRunningApplications(); - const bool foundLocalCore = runningApps.containsApplication(CApplicationInfo::PilotClientCore); - const bool foundLocalMappingTool = runningApps.containsApplication(CApplicationInfo::MappingTool); + const bool foundLocalCore = runningApps.containsApplication(CApplicationInfo::PilotClientCore); + const bool foundLocalMappingTool = runningApps.containsApplication(CApplicationInfo::MappingTool); const bool foundLocalPilotClientGui = runningApps.containsApplication(CApplicationInfo::PilotClientGui); - const bool standalone = ui->rb_SwiftStandalone->isChecked(); + const bool standalone = ui->rb_SwiftStandalone->isChecked(); ui->tb_SwiftCore->setEnabled(!standalone && !foundLocalCore && m_startCoreWaitCycles < 1); ui->tb_SwiftMappingTool->setEnabled(!foundLocalMappingTool && m_startMappingToolWaitCycles < 1); @@ -537,7 +529,7 @@ void CSwiftLauncher::onStyleSheetsChanged() void CSwiftLauncher::onDBusEditingFinished() { - ui->rb_SwiftCoreAudioOnGui->setChecked(true); + ui->rb_SwiftDistributed->setChecked(true); } void CSwiftLauncher::onCoreModeReleased() diff --git a/src/swiftlauncher/swiftlauncher.ui b/src/swiftlauncher/swiftlauncher.ui index afcc13850..13155bab2 100644 --- a/src/swiftlauncher/swiftlauncher.ui +++ b/src/swiftlauncher/swiftlauncher.ui @@ -88,7 +88,7 @@ - 4 + 2 6 @@ -225,7 +225,7 @@ &Core mode - + 4 @@ -241,33 +241,17 @@ 4 + + + + Audio on GUI side + + + - + - GUI and core - - - bg_CoreMode - - - - - - - GUI and core - - - bg_CoreMode - - - - - - - standalone - - - true + GUI and core (distributed) bg_CoreMode @@ -284,23 +268,6 @@ - - - - Audio on GUI side - - - - - - - - - - :/launcher/icons/swiftGUIandCore115x85.png - - - @@ -311,15 +278,40 @@ - - + + - Audio on core side + standalone + + true + + + bg_CoreMode + - + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + 225 + 0 + + DBus (swift core/GUI, NOT XSwiftBus) @@ -358,25 +350,6 @@ - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - @@ -648,7 +621,7 @@ swift GUI - + :/own/icons/own/swift3D/sw3DBlue-256.png:/own/icons/own/swift3D/sw3DBlue-256.png @@ -668,7 +641,7 @@ swift core - + :/own/icons/own/swift3D/sw3DOrange-256.png:/own/icons/own/swift3D/sw3DOrange-256.png @@ -688,7 +661,7 @@ mapping tool - + :/own/icons/own/swift3D/sw3DGreen-256.png:/own/icons/own/swift3D/sw3DGreen-256.png @@ -705,7 +678,7 @@ ... - + :/misc/icons/misc/toolWizard128.png:/misc/icons/misc/toolWizard128.png @@ -725,7 +698,7 @@ goto swift database - + :/own/icons/own/swift3D/sw3DGreen-256.png:/own/icons/own/swift3D/sw3DGreen-256.png @@ -827,7 +800,7 @@ back to main - + :/diagona/icons/diagona/icons/arrow-180.png:/diagona/icons/diagona/icons/arrow-180.png @@ -895,8 +868,7 @@ rb_WindowNormal rb_WindowFrameless rb_SwiftStandalone - rb_SwiftCoreAudioOnGui - rb_SwiftCoreAudioOnCore + rb_SwiftDistributed sa_DataUpdates tb_SwiftGui tb_SwiftCore @@ -906,7 +878,6 @@ tb_BackToMain -