diff options
Diffstat (limited to 'src/src/mainwindow.cpp')
| -rw-r--r-- | src/src/mainwindow.cpp | 92 |
1 files changed, 41 insertions, 51 deletions
diff --git a/src/src/mainwindow.cpp b/src/src/mainwindow.cpp index eb92adf..f8f7e97 100644 --- a/src/src/mainwindow.cpp +++ b/src/src/mainwindow.cpp @@ -2400,61 +2400,51 @@ void MainWindow::on_startButton_clicked() ui->startButton->setEnabled(true); }); - // Pre-check: if this executable uses Proton and the current instance has SLR - // enabled, ensure SLR is installed (and up-to-date with the latest steamrt4 - // BUILD_ID) before launching. downloadSlr() short-circuits on BUILD_ID match - // so once SLR is current this is a single HTTP GET; no UI is shown unless - // the runtime actually needs (re)downloading. + // Pre-check: Proton launches always use SLR. Native Linux executables skip + // this branch entirely. downloadSlr() short-circuits on BUILD_ID match, so + // once SLR is current this is a single HTTP GET; no UI is shown unless the + // runtime actually needs (re)downloading. if (selectedExecutable->useProton()) { - const auto* s = Settings::maybeInstance(); - bool useSLR = true; - if (s) { - QSettings const instanceIni(s->filename(), QSettings::IniFormat); - useSLR = instanceIni.value("fluorine/use_slr", true).toBool(); - } - if (useSLR) { - const bool freshInstall = !isSlrInstalled(); - // Only show the heavyweight progress dialog on a fresh install. - // Up-to-date checks happen quietly in the background here so we don't - // block launch on a remote BUILD_ID fetch — the up-to-date case is - // handled at startup by OrganizerCore::checkForSlrUpdates(). - if (freshInstall) { - auto* progress = new QProgressDialog( - tr("Downloading Steam Linux Runtime (~200 MB)...\n" - "This is required to launch games. Check the MO2 log for details."), - tr("Cancel"), 0, 0, this); - progress->setWindowTitle(tr("Steam Linux Runtime")); - progress->setWindowModality(Qt::WindowModal); - progress->setAttribute(Qt::WA_ShowWithoutActivating); - progress->setMinimumDuration(0); + const bool freshInstall = !isSlrInstalled(); + // Only show the heavyweight progress dialog on a fresh install. + // Up-to-date checks happen quietly in the background here so we don't + // block launch on a remote BUILD_ID fetch — the up-to-date case is + // handled at startup by OrganizerCore::checkForSlrUpdates(). + if (freshInstall) { + auto* progress = new QProgressDialog( + tr("Downloading Steam Linux Runtime (~200 MB)...\n" + "This is required to launch games. Check the MO2 log for details."), + tr("Cancel"), 0, 0, this); + progress->setWindowTitle(tr("Steam Linux Runtime")); + progress->setWindowModality(Qt::WindowModal); + progress->setAttribute(Qt::WA_ShowWithoutActivating); + progress->setMinimumDuration(0); - int cancelFlag = 0; - connect(progress, &QProgressDialog::canceled, this, [&cancelFlag] { - cancelFlag = 1; - }); + int cancelFlag = 0; + connect(progress, &QProgressDialog::canceled, this, [&cancelFlag] { + cancelFlag = 1; + }); - QFutureWatcher<QString> watcher; - QEventLoop loop; - connect(&watcher, &QFutureWatcher<QString>::finished, &loop, &QEventLoop::quit); - watcher.setFuture(QtConcurrent::run([&cancelFlag]() -> QString { - return downloadSlr(nullptr, nullptr, &cancelFlag); - })); - progress->show(); - loop.exec(); - progress->close(); - progress->deleteLater(); + QFutureWatcher<QString> watcher; + QEventLoop loop; + connect(&watcher, &QFutureWatcher<QString>::finished, &loop, &QEventLoop::quit); + watcher.setFuture(QtConcurrent::run([&cancelFlag]() -> QString { + return downloadSlr(nullptr, nullptr, &cancelFlag); + })); + progress->show(); + loop.exec(); + progress->close(); + progress->deleteLater(); - const QString err = watcher.result(); - if (cancelFlag) { - return; // user cancelled, don't launch - } - if (!err.isEmpty()) { - log::error("[SLR] Download failed: {}", err); - QMessageBox::warning(this, tr("Steam Linux Runtime"), - tr("Steam Linux Runtime download failed:\n%1\n\n" - "You can disable SLR in the Instance Manager and try again.").arg(err)); - return; - } + const QString err = watcher.result(); + if (cancelFlag) { + return; // user cancelled, don't launch + } + if (!err.isEmpty()) { + log::error("[SLR] Download failed: {}", err); + QMessageBox::warning(this, tr("Steam Linux Runtime"), + tr("Steam Linux Runtime download failed:\n%1").arg(err)); + return; } } } |
