From dddf9edde7ad89ba358af482e7206749d9e16426 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 20 Oct 2026 11:41:11 +0200 Subject: Packages: Build/Update/Rebuild/Remove act on ticked packages only The highlighted row used to stand in when nothing was ticked; with row clicks toggling the tick, that ran an action on a row just unticked. Co-Authored-By: Claude Opus 5.5 --- README.md | 4 ++-- sb_builder/packages.py | 7 ++----- tests/test_gui.py | 4 ++++ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6d03f06..0659a12 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,8 @@ Every key is optional. `File > Reload config` rereads the GUI config. package, Ctrl+Shift+A unticks all (here and in Hints). The detail pane shows the package's versions, its dependencies after hints (dropped ones struck through), and what its hint file does, section by section. -- Tick packages (or select one row) and press Build, Update, Rebuild or - Remove; Update all updates everything. Each first runs a slackrepo +- Tick packages and press Build, Update, Rebuild or Remove (they act on the + ticked packages only); Update all updates everything. Each first runs a slackrepo `--preview` job. When the preview is fine, **Run it** in the Jobs tab starts the real run; untick **publish** to keep the packages local and press **Publish** later to push them. diff --git a/sb_builder/packages.py b/sb_builder/packages.py index 72b5f93..64032a2 100644 --- a/sb_builder/packages.py +++ b/sb_builder/packages.py @@ -337,11 +337,8 @@ class PackagesTab(QWidget): self.update_count() def targets(self): - """Checked packages, else the current row; sorted names.""" - if self.model.checked: - return sorted(self.model.checked) - current = self.table.currentIndex() - return [current.data(Qt.ItemDataRole.UserRole)["name"]] if current.isValid() else [] + """Ticked packages, sorted; the highlighted row alone is not a target.""" + return sorted(self.model.checked) def act(self, action): names = self.targets() diff --git a/tests/test_gui.py b/tests/test_gui.py index b326ee1..d45fffd 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -405,7 +405,11 @@ class SmokeTest(unittest.TestCase): self.assertEqual(tab.model.checked, set()) tab.table.setCurrentIndex(tab.proxy.index(1, 1)) self.assertIn("x", tab.detail.text()) + tab.act("update") # highlighted but not ticked: nothing + self.assertEqual(started, []) + tab.model.checked.add("foo") tab.act("update") + tab.model.checked.clear() select, clear = tab.keys select.activated.emit() self.assertEqual(len(tab.model.checked), 4) -- cgit v1.2.3