refactor: Move installer flag handling to launcher

This is only used by the launcher
This commit is contained in:
Lars Toenning
2024-02-15 23:01:00 +01:00
parent a84e299e45
commit a664371567
5 changed files with 31 additions and 31 deletions

View File

@@ -50,11 +50,11 @@ using namespace BlackMisc::Simulation;
using namespace BlackMisc::Simulation::Data;
using namespace BlackMisc::Simulation::FsCommon;
CSwiftLauncher::CSwiftLauncher(QWidget *parent) : QMainWindow(parent, CEnableForFramelessWindow::modeToWindowFlags(CEnableForFramelessWindow::WindowNormal)),
CEnableForFramelessWindow(CEnableForFramelessWindow::WindowFrameless, true, "framelessMainWindow", this),
CCentralMultiSimulatorModelSetCachesAware(),
CIdentifiable(this),
ui(new Ui::CSwiftLauncher)
CSwiftLauncher::CSwiftLauncher(bool installerMode, QWidget *parent) : QMainWindow(parent, CEnableForFramelessWindow::modeToWindowFlags(CEnableForFramelessWindow::WindowNormal)),
CEnableForFramelessWindow(CEnableForFramelessWindow::WindowFrameless, true, "framelessMainWindow", this),
CCentralMultiSimulatorModelSetCachesAware(),
CIdentifiable(this),
ui(new Ui::CSwiftLauncher)
{
Q_ASSERT_X(sGui, Q_FUNC_INFO, "Need sGui");
sGui->registerMainApplicationWidget(this);
@@ -100,7 +100,7 @@ CSwiftLauncher::CSwiftLauncher(QWidget *parent) : QMainWindow(parent, CEnableFor
}
const QPointer<CSwiftLauncher> myself(this);
if (sGui->isInstallerOptionSet())
if (installerMode)
{
QTimer::singleShot(1000, this, [=] {
if (!sGui || sGui->isShuttingDown() || !myself) { return; }
@@ -114,7 +114,7 @@ CSwiftLauncher::CSwiftLauncher(QWidget *parent) : QMainWindow(parent, CEnableFor
if (!sGui || sGui->isShuttingDown() || !myself) { return; }
this->onCoreModeReleased();
this->requestMacMicrophoneAccess();
this->installerMode();
if (installerMode) this->installerMode();
});
this->show();
@@ -123,7 +123,6 @@ CSwiftLauncher::CSwiftLauncher(QWidget *parent) : QMainWindow(parent, CEnableFor
void CSwiftLauncher::installerMode()
{
if (!sGui || sGui->isShuttingDown()) { return; }
if (!sGui->isInstallerOptionSet()) { return; }
bool runDialog = false;
do