diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-20 11:41:11 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-20 11:41:11 +0200 |
| commit | dddf9edde7ad89ba358af482e7206749d9e16426 (patch) | |
| tree | 1172671b7efff9182f3938d82a5ba13a289735bd | |
| parent | 48cbd81a2c674b7d65a82f986ed7ad12e2f6869f (diff) | |
| download | sb-builder-dddf9edde7ad89ba358af482e7206749d9e16426.tar.gz sb-builder-dddf9edde7ad89ba358af482e7206749d9e16426.zip | |
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 <noreply@anthropic.com>
| -rw-r--r-- | README.md | 4 | ||||
| -rw-r--r-- | sb_builder/packages.py | 7 | ||||
| -rw-r--r-- | tests/test_gui.py | 4 |
3 files changed, 8 insertions, 7 deletions
@@ -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("<s>x</s>", 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) |
