diff options
Diffstat (limited to 'desktop/modules/deckit/DeckIt.qml')
| -rw-r--r-- | desktop/modules/deckit/DeckIt.qml | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/desktop/modules/deckit/DeckIt.qml b/desktop/modules/deckit/DeckIt.qml index 8d24917..632285f 100644 --- a/desktop/modules/deckit/DeckIt.qml +++ b/desktop/modules/deckit/DeckIt.qml @@ -14,6 +14,7 @@ pragma Singleton import Quickshell import Quickshell.Io import QtQuick +import "../.." import "../sbbuilder" import "../autostart/Autostart.js" as A @@ -57,9 +58,7 @@ Singleton { // waiting, tablet, extend}; null until the first answer. property var status: null property int watchers: 0 - // The last Restart's outcome; restartAt is 0 when none is pending. - property string note: "" - property bool noteBad: false + // A pending Restart, 0 when none; its outcome goes to the window's snackbar. property real restartAt: 0 readonly property int restartTimeout: 30000 @@ -79,8 +78,7 @@ Singleton { // Stops it and starts it again the way login does, so a saved config applies. function restart() { Quickshell.execDetached(["sh", "-c", "deck-it stop; exec deck-it wifi --wait"]); - root.note = "Restarting…"; - root.noteBad = false; + Snack.wait("Restarting deck-it…"); root.restartAt = Date.now(); // Let stop run first, or the first poll still sees the old instance. poll.restart(); @@ -89,12 +87,10 @@ Singleton { function checkRestart() { if (root.restartAt === 0) return; if (root.healthy) { - root.note = "Restarted at " + Qt.formatTime(new Date(), "HH:mm:ss"); - root.noteBad = false; + Snack.ok("deck-it restarted"); root.restartAt = 0; } else if (Date.now() - root.restartAt > root.restartTimeout) { - root.note = "Not back after " + root.restartTimeout / 1000 + "s: " + root.summary; - root.noteBad = true; + Snack.error("deck-it not back after " + root.restartTimeout / 1000 + "s: " + root.summary); root.restartAt = 0; } } |
