From 5c1dc6f58d43d02cc883688d028489a0d75be5cc Mon Sep 17 00:00:00 2001 From: offbyonebit <83889256+offbyonebit@users.noreply.github.com> Date: Wed, 6 May 2026 18:25:41 -0500 Subject: [PATCH] Fix history window to pass settings for encrypted history decryption The HistoryWindow was creating ClipboardHistory() instances without passing the settings parameter, which meant it couldn't access the encryption passphrase. This caused the history window to show empty even though entries were being saved correctly. Changes: - Add app parameter to HistoryWindow.__init__() - Pass self._app.settings to ClipboardHistory() constructor - Update call site to pass app parameter Fixes issue where history window showed 'No clipboard history yet' despite history being enabled and entries existing in the encrypted history file. --- clipsync/ui.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/clipsync/ui.py b/clipsync/ui.py index 0414a7f..3c2d77f 100644 --- a/clipsync/ui.py +++ b/clipsync/ui.py @@ -1300,7 +1300,8 @@ def _reject(self, device_id: str) -> None: class HistoryWindow(_BaseWindow): """Scrollable list of recent clipboard entries with copy-on-click and search.""" - def __init__(self, parent: ctk.CTk, on_close: Callable[[], None]) -> None: + def __init__(self, parent: ctk.CTk, app: object, on_close: Callable[[], None]) -> None: + self._app = app super().__init__(parent, f"{config.APP_NAME} — Clipboard History", (480, 520), on_close) container = ctk.CTkFrame(self.window, fg_color="transparent") container.pack(fill="both", expand=True, padx=16, pady=16) @@ -1356,7 +1357,7 @@ def _refresh(self) -> None: for w in self._list_frame.winfo_children(): w.destroy() - history = ClipboardHistory() + history = ClipboardHistory(self._app.settings) self._all_entries = list(reversed(history.get_entries())) query = self._search_var.get().strip().lower() @@ -1490,7 +1491,7 @@ def do_clear() -> None: _emit("clear_history") from .history import ClipboardHistory - ClipboardHistory().clear() + ClipboardHistory(self._app.settings).clear() dialog.destroy() self._refresh() @@ -1570,7 +1571,7 @@ def _quit() -> None: elif kind == "incoming": IncomingWindow(root, app, on_close=_quit) elif kind == "history": - HistoryWindow(root, on_close=_quit) + HistoryWindow(root, app, on_close=_quit) else: log.error("Unknown window: %s", window_name) return 1