Commit graph

10 commits

Author SHA1 Message Date
cjjohn
4b5da69174 Add free-text notes per button/encoder action
Lets you record what a binding actually does (e.g. "Save in Fusion
360") alongside the auto-generated label ("Strg+S"). Notes live in a
new "note" field on every action dict, purely local like profile
names -- the firmware struct has no room for strings, and
pack_config/unpack_config already only touch type/data so the extra
key round-trips harmlessly.

Two things had to be handled carefully: changing a button's key/type
must not wipe its note (all set_button_*/set_encoder_* setters and the
edit dialog now carry the previous note forward), and re-reading from
the board must not erase notes either, since the firmware doesn't know
about them -- versapad_combined.merge_notes() restores them onto the
freshly-fetched state by button/encoder index.

Editable via the Programmiermodus dialog (new text field), visible on
both the desktop card (grown from 84 to 114px to fit it) and the
browser view. MCP server gets set_button_note()/set_encoder_note() so
notes can be set programmatically too.
2026-08-15 11:15:36 +02:00
9e21360393 Allow renaming profile tabs outside Programmiermodus
Double-click-to-rename already existed but silently no-op'd unless
Programmiermodus was on, and even there it only updated the in-memory
self.combined without saving -- the name was lost unless some later button
edit happened to trigger an autosave. Since profile_names lives purely in
the combined JSON and never touches the board, there's no reason to gate it
behind the heavier editing mode: it now works from any mode, loading/saving
the combined file directly (auto-creating it if needed) when not already in
an active Programmiermodus session, and always persists immediately.

(cherry picked from commit 82c3fd0056)
2026-08-14 23:51:34 +02:00
b4ad7698ed Move config storage next to the install and auto-create it if missing
versapad_combined.DEFAULT_PATH was hardcoded to this one machine's OneDrive
desktop, which made the tool unusable anywhere else. versapad_data.app_dir()
now resolves to the running .exe's own folder when frozen, or the project
directory when run from source, and DEFAULT_PATH hangs off that instead.

load_or_fetch() previously raised when both the file was missing and the
board unreachable, blocking a fresh install with no config and no board
attached. It now falls back to an empty default_combined() in that case, so
the tool is immediately usable either way. desktop_viewer's
_current_profile_view() picks up the same fallback instead of re-implementing
a narrower version of it.

Also drop the hardcoded PROFILE_NAMES dict, which had drifted out of sync
with the profile_names already stored in the combined JSON -- renaming a
profile in Programmiermodus never showed up in the read-only/browser views.
server.py and desktop_viewer.py now read names from the same JSON everywhere.

versapad_data.CONFIG_PATHS (read-only interop with the official C# VersaGUI's
JSON export) is intentionally left on the OneDrive desktop -- nothing in
this codebase writes there, it's not part of this tool's own config.

(cherry picked from commit 5d14bdd826)
2026-08-14 23:50:46 +02:00
cjjohn
540ce5b1eb Fix crash when desktop config JSON is deleted: self-heal from board
server.py and desktop_viewer.py read-only mode required the desktop
config JSONs to exist and crashed/showed "Config-Datei fehlt" if one
was deleted, even though the board already holds the config durably
in NVM. Add versapad_combined.fetch_from_board()/load_or_fetch(): a
missing combined JSON is now transparently rebuilt from the board via
serial and cached back to disk, falling back to the legacy per-profile
JSONs (or a clear error) only when the board is unreachable.
2026-08-08 17:06:53 +02:00
cjjohn
8a2a73c68d Fix Programmiermodus default-seed bug wiping other profiles
_on_toggle_editing() seeded self.combined from default_combined() on first
activation, which reads the stale per-profile JSONs for all 3 profiles
instead of the current versapad_config_all.json. Writing to board while
only editing one profile silently reverted the other two. Now prefers
loading the current combined file, falling back to defaults only if it
doesn't exist.

Also documents the READ_STATUS polling change and the jappel PR workflow
constraint in AGENTS.md.
2026-08-07 20:50:52 +02:00
cjjohn
78d412ffa6 Fix: Programmiermodus-Aenderungen erschienen nicht im Nur-Lese-Modus
Ursache: Programmiermodus arbeitet auf der kombinierten Datei
(versapad_config_all.json), der Nur-Lese-Modus las aber immer nur die
alten Einzel-JSONs (versapad_config{1,2,3}.json) -- zwei komplett
getrennte Datenquellen. Jetzt: jede Aenderung im Programmiermodus wird
sofort in die kombinierte Datei geschrieben, und der Nur-Lese-Modus
bevorzugt diese Datei, wenn sie existiert.
2026-08-05 17:54:44 +02:00
cjjohn
b924273400 Add "Immer im Vordergrund" (always-on-top) toggle 2026-08-05 14:34:38 +02:00
cjjohn
3615ff3122 Make MCP info text tool-agnostic; simplify Live-Sync status
Info dialog no longer assumes Claude Code's own CLI setup command --
other users may register the MCP server with a different assistant.
Live-Sync status just says "verbunden" instead of repeating the
profile name (already visible via the active tab).
2026-08-05 08:40:37 +02:00
cjjohn
4ac29a3e5c Add custom icon and tray-minimize behavior (like VersaGUI's TrayApp)
Minimizing or closing hides the window instead of leaving a taskbar
entry; only "Beenden" in the tray right-click menu really exits. Tray
callbacks route through a queue instead of touching Tk directly from
pystray's thread (same pattern as the earlier serial-thread fix).

Also fixes the build script: PyInstaller failed on the network share
while copying Tcl/Tk tzdata (path-length issue), so building now
happens in a local temp copy instead of directly on Z:.

Adds an info button that explains the MCP server's available tools.
2026-08-05 08:30:50 +02:00
cjjohn
6227903ebd Initial commit: VersaPad viewer + programming mode 2026-08-04 20:03:49 +02:00