aboutsummaryrefslogtreecommitdiffstats
path: root/src/mainwindow.cpp
AgeCommit message (Collapse)AuthorFilesLines
9 hoursAdd GPLv2-only license and per-file headersDanilo M.1-1/+20
Confirmed with the maintainer as v2-only rather than v2-or-later. LICENSE is the official text from gnu.org. Every file under src/ and tests/ carries the matching notice. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
9 hoursfix: let key bindings win over the thread list's type-to-searchDanilo M.1-0/+9
With the thread list focused, 'h' jumped to the next thread whose subject began with "h" instead of toggling HTML, and j, k, a, d, N, F, u and G were swallowed the same way. The keymap only worked when focus happened to be somewhere else. installEventFilter(this) was on the MainWindow, and a window-level filter only sees key presses the focused child did not consume. QAbstractItemView consumes plain letters for its type-to-search feature, so it took them first. The filter is now installed on the thread view as well, which puts the keymap ahead of that search. The existing query-bar guard in eventFilter() still keeps ordinary typing working there. Found by the maintainer while walking task 13 item 14, and confirmed fixed on screen. No regression test: a QTest::keyClick attempt passed both with and without the fix, because synthetic key posting does not reproduce the focus and consumption path that causes the bug. A test that cannot fail is worse than none, so it was dropped rather than kept for appearances. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
9 hoursfix: only interrupt startup for real configuration problemsDanilo M.1-4/+14
Found while walking the task 13 checklist against real mail. Item 1 ("startup shows no configuration warnings with a valid config") failed: with a perfectly valid config that simply had no [sync] command, every launch opened a blocking modal that had to be dismissed before the window could be used. Config now separates the two cases. A problem is something configured but wrong (a sync command that does not exist, an account with no maildir); those still open a dialog, as does every KeyMap warning, since each one means a binding the user wrote is being ignored. A notice is an optional feature simply not being configured; it reports to the status bar only. Nothing is broken in that case, and a modal on every launch teaches the user to dismiss dialogs unread, which defeats the ones that matter. problems() is a subset of warnings(), so callers wanting everything need only the latter. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
9 hoursfeat: add MainWindow wiring query, list, message, and syncDanilo M.1-0/+495
Wires the worker thread, thread list, message pane, sync process and undo stack together, and replaces the placeholder main() with real startup: custom URL schemes registered before QApplication, a libnotmuch ABI check, and config loading. Four fixes against the drafted version: - onWorkerError() only set a status label. Its own comment elsewhere claimed it reverted the optimistic update, and the spec requires that; it did not, so a rejected write left the list showing a tag the database never received. The pending change is now recorded and rolled back, and a confirmed tagsApplied clears it so a later unrelated error cannot undo a write that succeeded. - runCurrentQuery() cleared the model but left the undo stack pointing at rows that no longer exist. Undoing after a new query would have written to the database while the visible list stayed put. The stack is cleared with the model. - m_currentMessages was assigned on every thread load and never read. Removed. - buildUi() connected sync output to m_syncLog and errors to m_statusLabel before either existed. Both are constructed before the wiring now. cidPrefix generation lives here, this being its only producer in the application, and is pinned by tests: it must never contain '!' and must be distinct per message, which are the invariants the cid: namespacing rests on. A second test holds registeredActionNames() against KeyMap::knownActions(), since those two hand-maintained lists drifting either way silently breaks a user's key binding. Mutation-verified that dropping an action fails the test by name. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>