aboutsummaryrefslogtreecommitdiffstats
path: root/sb_builder/mainwindow.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-19 21:28:54 +0200
committerDanilo M. <danix@danix.xyz>2026-10-19 21:28:54 +0200
commit993950b7733ba9300915955ec6e51e1f21dad806 (patch)
treed8800305748d96581f3bea06eeb9b1a1da979a49 /sb_builder/mainwindow.py
parent5609a744ef5e89c4d57a5239199a6afe5497590e (diff)
downloadsb-builder-993950b7733ba9300915955ec6e51e1f21dad806.tar.gz
sb-builder-993950b7733ba9300915955ec6e51e1f21dad806.zip
Results tab with build logs; count only real packages
sbb-remote 0.4.0: results lists slackrepo's last attempt per package (newest first, with built version and whether a log dir exists), and build-log returns the end of a package's build.log (512 KB) plus its resource.log, accepting only category/pkg paths. Result counts skip the legacy buildresults rows keyed by package file name: the 213 "bad" on the Dashboard matched no package. GUI: a Results tab (chips per result, table sorted by attempt time, detail pane, log viewer window that keeps the failure at the end), opened from the ribbon or by clicking a result in the Dashboard bar or legend, filtered to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'sb_builder/mainwindow.py')
-rw-r--r--sb_builder/mainwindow.py25
1 files changed, 22 insertions, 3 deletions
diff --git a/sb_builder/mainwindow.py b/sb_builder/mainwindow.py
index bd2245d..247b0cf 100644
--- a/sb_builder/mainwindow.py
+++ b/sb_builder/mainwindow.py
@@ -29,6 +29,7 @@ from .dashboard import Dashboard
from .fmt import job_title
from .jobs import JobsTab
from .packages import PackagesTab
+from .results import ResultsTab
from .remote import DOWN, MISSING
NOTIFY = "org.freedesktop.Notifications"
@@ -36,6 +37,7 @@ NOTIFY_PATH = "/org/freedesktop/Notifications"
# ribbon entries: label, freedesktop icon name, Qt fallback icon
RIBBON = (("Dashboard", "go-home", QStyle.StandardPixmap.SP_DirHomeIcon),
("Packages", "package-x-generic", QStyle.StandardPixmap.SP_FileDialogDetailedView),
+ ("Results", "view-list-text", QStyle.StandardPixmap.SP_MessageBoxWarning),
("Jobs", "system-run", QStyle.StandardPixmap.SP_MediaPlay))
# tabs as a distinct, centered row; colors from the palette so the theme applies
TAB_STYLE = """
@@ -84,6 +86,7 @@ class MainWindow(QMainWindow):
self.notifier.clicked.connect(self.open_job)
self.jobs_tab = None
self.packages_tab = None
+ self.results_tab = None
self.seen = None # job id -> status at the last poll; None before the first
self.online = None # None until the first answer
self.overlays = []
@@ -100,6 +103,7 @@ class MainWindow(QMainWindow):
self.dashboard.refresh_btn.clicked.connect(self.poll_stats)
self.dashboard.tiles["Packages"].link(self.open_packages)
self.dashboard.jobs.link(self.open_jobs)
+ self.dashboard.result_clicked.connect(self.open_results)
self.tabs.addTab(self.dashboard, "Dashboard")
self.tabs.tabBar().setTabButton(0, QTabBar.ButtonPosition.RightSide, None)
self.setCentralWidget(self.tabs)
@@ -115,7 +119,8 @@ class MainWindow(QMainWindow):
self.ribbon.setIconSize(QSize(32, 32))
self.addToolBar(Qt.ToolBarArea.TopToolBarArea, self.ribbon)
slots = {"Dashboard": lambda: self.tabs.setCurrentWidget(self.dashboard),
- "Packages": self.open_packages, "Jobs": self.open_jobs}
+ "Packages": self.open_packages, "Results": lambda: self.open_results(),
+ "Jobs": self.open_jobs}
for label, name, fallback in RIBBON:
icon = QIcon.fromTheme(name, self.style().standardIcon(fallback))
self.ribbon.addAction(icon, label, slots[label])
@@ -275,8 +280,10 @@ class MainWindow(QMainWindow):
event = END_EVENT.get(j["status"])
if event and prev.get(j["id"], "running") != j["status"]:
self.notify(event, job_title(j), j["id"])
- if j["kind"] in ("slackrepo", "publish") and self.packages_tab:
- self.packages_tab.reload() # build state changed
+ if j["kind"] in ("slackrepo", "publish"): # build state changed
+ for tab in (self.packages_tab, self.results_tab):
+ if tab:
+ tab.reload()
# ── tabs ────────────────────────────────────────────────────────────────
@@ -302,6 +309,16 @@ class MainWindow(QMainWindow):
self.tabs.setCurrentWidget(self.packages_tab)
return self.packages_tab
+ def open_results(self, result=None):
+ if self.results_tab is None:
+ self.results_tab = ResultsTab(self.remote)
+ self.tabs.addTab(self.results_tab, "Results")
+ self.results_tab.reload()
+ if result:
+ self.results_tab.filter_to(result)
+ self.tabs.setCurrentWidget(self.results_tab)
+ return self.results_tab
+
def open_job(self, jid):
self.show()
self.raise_()
@@ -319,6 +336,8 @@ class MainWindow(QMainWindow):
w.stop()
if w is self.packages_tab:
self.packages_tab = None
+ if w is self.results_tab:
+ self.results_tab = None
w.deleteLater()
def reload_config(self):