From fdb49f2503485691494b5ca777cbcba0229adcf1 Mon Sep 17 00:00:00 2001 From: Rick Peters Date: Fri, 25 Sep 2026 15:56:41 +0200 Subject: [PATCH] fix(ui): Applying got stuck: the ticked items came in as a JS value Convert QML's array; if starting fails anyway, show the done screen with the reason instead of staying on the progress screen. --- ui/qml/Main.qml | 2 +- ui/steamify-ui | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ui/qml/Main.qml b/ui/qml/Main.qml index f3e173a..f6a1f2a 100644 --- a/ui/qml/Main.qml +++ b/ui/qml/Main.qml @@ -225,7 +225,7 @@ ApplicationWindow { else if (ev.event === "finished") { if (!(biosRun && plan.length && plan[0].action === "check" && !ev.failed.length && !ev.error && !ev.nothing)) sessionPassword = ""; failed = ev.failed || []; restartNeeded = !!ev.restart; - runError = ev.error === "wrong-password" ? "The password didn't work." : (ev.error ? "sudo isn't available." : ""); + runError = ev.error === "wrong-password" ? "The password didn't work." : (ev.error === "start" ? "Steamify couldn't start the changes." : (ev.error ? "sudo isn't available." : "")); screen = "done"; } } diff --git a/ui/steamify-ui b/ui/steamify-ui index 59f0dea..8f6a7c3 100755 --- a/ui/steamify-ui +++ b/ui/steamify-ui @@ -247,12 +247,20 @@ class Backend(QObject): @Slot("QVariant", str, bool, str) def apply(self, ids, boot, reapply, password): - args = ["apply"] - if reapply: - args.append("--reapply") - if boot: - args += ["--boot", boot] - self._start(args + list(ids), password) + try: + if hasattr(ids, "toVariant"): # a JS array from QML + ids = ids.toVariant() + args = ["apply"] + if reapply: + args.append("--reapply") + if boot: + args += ["--boot", boot] + self._start(args + [str(i) for i in (ids or [])], password) + except Exception as e: + # Never leave the app on the progress screen. + print("steamify-ui: couldn't start:", e, file=sys.stderr) + self._drop_askpass() + self.event.emit({"event": "finished", "failed": [], "restart": False, "error": "start"}) @Slot(str) def biosPrepare(self, password):