refactor: extract the tray into gui/tray.py #106
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/gui-tray"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Tray behavior was spread across five AqomuiGui handlers poking icon names and tooltips directly (
systemtray,pop_tray_menu,toggle_visibility,set_tray_icon, plus the state resets inconnection_established/tunnel_terminated/kill). #83 wants extractions to ride along when work touches an area — the #69/#104 tray wave is that occasion — and per its amended rule, new extractions land directly inaqomui/gui/.Fix
New
aqomui/gui/tray.pywithTrayIcon: wrapsQSystemTrayIcon+ menu, signals out (clicked,show_window,hide_window,profile_chosen,quit_app), state methods in (connected(name)/disconnected()),usablefor the no-tray fallback. AqomuiGui wires signals insystemtray()and calls state methods;pop_tray_menu/toggle_visibility/set_tray_iconare gone. setup.py gains theaqomui.guipackage.Pure move, with one deliberate dedup:
connection_establishedused to set the tooltip twice with different wording ("Status: connected to X" then "Connected to X" overwriting it) — now once, matching the "Status: …" form. Two latent quirks preserved as-is and now visible for future fixes: the profile menu is populated once at startup (stale after profile changes), and the Hide/Show label doesn't track visibility toggled by clicking the tray icon.Verification
New
tests/test_gui_tray.py(9 tests, offscreen platform): menu layout incl. separators, repopulate doesn't stack, visibility toggle emits + flips label, profile action emits its key, quit emits, connected/disconnected state + tooltips, unusable-tray construction. The #69 regression tests now assert against theTrayIconinterface. Full suite: 180 passed.Refs #83
🤖 Generated with Claude Code