From d5ea4b30bf5d39ca200389db2c54a34d5dafdbea Mon Sep 17 00:00:00 2001 From: trav Date: Fri, 7 Aug 2026 17:39:03 -0400 Subject: [PATCH] v0.2.1: sync status readable in the corner; Device menu right of Track MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The QProgressBar overlay text didn't fit at 160-220px and clipped to two broken lines. Split it: a plain label "Copying to Rabbit R1 · 1.2 GB / 3.4 GB" next to a textless bar, both permanent right-side widgets hidden when idle. And the Device menu now sits to the right of Track (trav's intended spot). Co-Authored-By: Claude Fable 5 --- TASKS.md | 3 +++ lintunes/__init__.py | 2 +- lintunes/gui/main_window.py | 32 ++++++++++++++++++++++---------- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/TASKS.md b/TASKS.md index fa74571..167aa2a 100644 --- a/TASKS.md +++ b/TASKS.md @@ -36,6 +36,9 @@ When a round closes, move its finished items to `tasks-done.md`. totals middle, sync right). Tests in `tests/test_round26.py`. Feature round → minor bump **0.2.0**. +Follow-up polish (**0.2.1**): sync status split into a plain "Copying to +Rabbit R1 · X / Y" label + textless bar (overlay text didn't fit), and the +Device menu moved to the right of Track per trav. ## Round 25 — folder highlight while dragging a playlist (v0.1.6) diff --git a/lintunes/__init__.py b/lintunes/__init__.py index 672967b..9d61313 100644 --- a/lintunes/__init__.py +++ b/lintunes/__init__.py @@ -1,3 +1,3 @@ """LinTunes — iTunes-style music library manager and player for Linux.""" -__version__ = "0.2.0" +__version__ = "0.2.1" diff --git a/lintunes/gui/main_window.py b/lintunes/gui/main_window.py index 7ffd653..ee5939d 100644 --- a/lintunes/gui/main_window.py +++ b/lintunes/gui/main_window.py @@ -104,13 +104,18 @@ class MainWindow(QMainWindow): self._updater.start_checking() # Device-sync progress, right-justified: permanent widgets sit on the # status bar's right and survive showMessage. No stretch (see above) - # and hidden while idle so it costs no space. + # and hidden while idle so it costs no space. Text lives in its own + # label — QProgressBar's overlay can't fit a sentence at this width. + self._sync_label = QLabel() + self._sync_label.hide() + self.statusBar().addPermanentWidget(self._sync_label) self._sync_progress = QProgressBar() - self._sync_progress.setFixedWidth(220) - self._sync_progress.setTextVisible(True) + self._sync_progress.setFixedWidth(160) + self._sync_progress.setTextVisible(False) self._sync_progress.hide() self.statusBar().addPermanentWidget(self._sync_progress) self._sync_worker = None + self._sync_device_name = "" # Wiring self._transport.play_clicked.connect(self.play_pause) @@ -236,6 +241,11 @@ class MainWindow(QMainWindow): self._add_action(view_menu, "Toggle Column Browser", "Ctrl+B", self._library_view.toggle_browser) + track_menu = bar.addMenu("&Track") + self._add_action(track_menu, "Get Info", "Ctrl+I", self._info_for_current_view) + self._add_action(track_menu, "Go to Current Song", "Ctrl+L", + self._go_to_current_song) + device_menu = bar.addMenu("&Device") self._sync_action = self._add_action( device_menu, "Sync Playlist to Rabbit", "", @@ -245,11 +255,6 @@ class MainWindow(QMainWindow): # always reflects plug/unplug and the current view. device_menu.aboutToShow.connect(self._refresh_device_actions) - track_menu = bar.addMenu("&Track") - self._add_action(track_menu, "Get Info", "Ctrl+I", self._info_for_current_view) - self._add_action(track_menu, "Go to Current Song", "Ctrl+L", - self._go_to_current_song) - def _add_action(self, menu, text, shortcut, slot): action = QAction(text, self) if shortcut: @@ -311,18 +316,24 @@ class MainWindow(QMainWindow): self._sync_worker.progress.connect(self._on_sync_progress) self._sync_worker.finished.connect(self._on_sync_finished) self._sync_worker.failed.connect(self._on_sync_failed) + self._sync_device_name = device.name + self._sync_label.setText(f"Copying to {device.name}") self._sync_progress.setRange(0, max(plan.bytes_to_copy // 1024, 1)) self._sync_progress.setValue(0) - self._sync_progress.setFormat(f"Syncing “{playlist.name}”…") + self._sync_label.show() self._sync_progress.show() self._sync_worker.start() def _on_sync_progress(self, done_kib, total_kib, label): self._sync_progress.setRange(0, total_kib) self._sync_progress.setValue(done_kib) - self._sync_progress.setFormat(f"Syncing {label} · %p%") + self._sync_label.setText( + f"Copying to {self._sync_device_name} · " + f"{device_sync.format_bytes(done_kib * 1024)} / " + f"{device_sync.format_bytes(total_kib * 1024)}") def _on_sync_finished(self, summary): + self._sync_label.hide() self._sync_progress.hide() msg = (f"Synced “{summary['playlist']}” to the {summary['device']}: " f"{summary['copied']} copied, {summary['kept']} up to date, " @@ -332,6 +343,7 @@ class MainWindow(QMainWindow): self.statusBar().showMessage(msg, 8000) def _on_sync_failed(self, message): + self._sync_label.hide() self._sync_progress.hide() QMessageBox.warning(self, "Sync failed", message)