diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-18 16:56:01 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-18 16:56:01 +0100 |
| commit | 44f947c642fe842fae80c7407399265aa47e9909 (patch) | |
| tree | fba51fa5ddbfb9033a63aa1fda9b720f262848af /desktop/modules/deckit/DeckItControlModule.qml | |
| parent | 403d88813622c45ea270d5168e9875e582bad4d4 (diff) | |
| download | quickshell-44f947c642fe842fae80c7407399265aa47e9909.tar.gz quickshell-44f947c642fe842fae80c7407399265aa47e9909.zip | |
feat(deckit): Start, Stop and Restart in the drawer
Running deck-it is a runtime operation, so it moves out of the settings
window into a drawer tile: the deck-it page shows its status line and
Start, Stop and Restart. The Server settings page keeps only the status
line in its header.
DeckIt.control(op) replaces restart(): the buttons stay disabled until
deck-it status shows the result (running or waiting after a start,
stopped after a stop) or 30s pass. A Restart waits 2s before believing
the status, so the old instance's last answer does not count. The
snackbar went with it: the drawer has none, and its page shows the
status line instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules/deckit/DeckItControlModule.qml')
| -rw-r--r-- | desktop/modules/deckit/DeckItControlModule.qml | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/desktop/modules/deckit/DeckItControlModule.qml b/desktop/modules/deckit/DeckItControlModule.qml new file mode 100644 index 0000000..311de1c --- /dev/null +++ b/desktop/modules/deckit/DeckItControlModule.qml @@ -0,0 +1,63 @@ +// Copyright (C) 2026 Danilo M. <danix@danix.xyz> +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 as +// published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + + +import QtQuick +import "../.." + +// deck-it's runtime controls in the drawer: its state, Start, Stop and +// Restart. Its settings stay in the settings window's deck-it pages. +Module { + name: "deckit-run" + label: "deck-it" + // nf-md-tablet, as on the Server page. + icon: "" + + page: Component { + Page { + title: "deck-it" + Column { + width: parent.width + spacing: 12 + // `deck-it status` polls only while this page is open. + Component.onCompleted: DeckIt.watchers++ + Component.onDestruction: DeckIt.watchers-- + + Text { + width: parent.width + wrapMode: Text.Wrap + text: ({ start: "Starting…", stop: "Stopping…", restart: "Restarting…" })[DeckIt.busy] + ?? DeckIt.summary + color: DeckIt.healthy ? Theme.green : DeckIt.running ? Theme.yellow : Theme.red + font { family: Theme.fontFamily; pixelSize: Theme.fontSize } + } + Row { + spacing: 8 + Button { + text: "Start" + enabled: !DeckIt.busy && !!DeckIt.status && !DeckIt.running + onClicked: DeckIt.control("start") + } + Button { + text: "Stop" + enabled: !DeckIt.busy && DeckIt.running + onClicked: DeckIt.control("stop") + } + Button { + text: "Restart" + enabled: !DeckIt.busy && DeckIt.running + onClicked: DeckIt.control("restart") + } + } + } + } + } +} |
