diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-20 12:13:00 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-20 12:13:00 +0200 |
| commit | d4cae7a87fd30341b5a936aa848e1fdc019a379e (patch) | |
| tree | 4a8a21966595468046f1b39b345a49a03c76f25e /sb_builder/results.py | |
| parent | c8306d6c87a40bb800241cccd90831e3893550b5 (diff) | |
| download | sb-builder-d4cae7a87fd30341b5a936aa848e1fdc019a379e.tar.gz sb-builder-d4cae7a87fd30341b5a936aa848e1fdc019a379e.zip | |
One frame for every tab: ribbons of actions, next steps as dialogs
Tabs are permanent and load on first show. The ribbon shows the current
tab's actions in workflow order, a small ribbon under it the view
controls; inapplicable actions are disabled with the reason as tooltip.
Starting a job stays on the tab; the Jobs tab reads (running), then shows
the end status. When a preview this session started ends, its log opens
with Run it (publish box) or Apply shadowing; Not now loses nothing, Run
it in Jobs reopens it. New hint moves to the Packages ribbon and acts on
the ticked packages without a hint.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'sb_builder/results.py')
| -rw-r--r-- | sb_builder/results.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sb_builder/results.py b/sb_builder/results.py index 1fc6b9a..21fdcc3 100644 --- a/sb_builder/results.py +++ b/sb_builder/results.py @@ -21,12 +21,13 @@ import re from PyQt6.QtCore import Qt from PyQt6.QtGui import QColor, QFontDatabase, QTextCursor -from PyQt6.QtWidgets import (QDialog, QHBoxLayout, QLabel, QPlainTextEdit, QPushButton, - QSplitter, QTableWidget, QTableWidgetItem, QVBoxLayout, QWidget) +from PyQt6.QtWidgets import (QDialog, QHBoxLayout, QLabel, QPlainTextEdit, QSplitter, + QTableWidget, QTableWidgetItem, QVBoxLayout, QWidget) from .dashboard import STATUS from .fmt import NA, fmt_time from .packages import chip +from .ui import SP, action, enable KINDS = ("ok", "failed", "bad", "aborted", "removed") ANSI = re.compile(r"\x1b\[[0-9;?]*[A-Za-z]") @@ -75,9 +76,10 @@ class ResultsTab(QWidget): bar.addStretch() self.count = QLabel() bar.addWidget(self.count) - refresh = QPushButton("Refresh") - refresh.clicked.connect(self.reload) - bar.addWidget(refresh) + self.act_log = action(self, "Show build log", "text-x-generic", SP.SP_FileIcon, self.show_log) + self.actions = [self.act_log] + self.view_actions = [action(self, "Refresh", "view-refresh", SP.SP_BrowserReload, self.reload)] + self.loaded = False self.table = QTableWidget(0, 4, sortingEnabled=True) self.table.setHorizontalHeaderLabels(["result", "package", "built version", "attempt"]) @@ -94,13 +96,9 @@ class ResultsTab(QWidget): self.detail = QLabel(textFormat=Qt.TextFormat.RichText, wordWrap=True, alignment=Qt.AlignmentFlag.AlignTop) self.detail.setContentsMargins(12, 8, 12, 8) - self.log_btn = QPushButton("Show build log") - self.log_btn.clicked.connect(self.show_log) - self.log_btn.setEnabled(False) side = QWidget() col = QVBoxLayout(side) col.addWidget(self.detail) - col.addWidget(self.log_btn) col.addStretch() split = QSplitter() split.addWidget(self.table) @@ -109,9 +107,11 @@ class ResultsTab(QWidget): layout = QVBoxLayout(self) layout.addLayout(bar) - layout.addWidget(split) + layout.addWidget(split, 1) + self.show_detail() def reload(self): + self.loaded = True self.count.setText("loading…") self.remote.call(self._loaded, "results") @@ -166,7 +166,7 @@ class ResultsTab(QWidget): def show_detail(self): row = self.current() - self.log_btn.setEnabled(bool(row and row[4])) + enable(self.act_log, None if row and row[4] else "select a result with a log") if not row: self.detail.setText("") return |
