From 3ee73d48c9d819b2e186655b7ba86ebc2a961baf Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 3 Aug 2026 09:28:33 +0200 Subject: fix: only interrupt startup for real configuration problems 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 --- src/mainwindow.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ed16010..d6eccf9 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -274,15 +274,25 @@ void MainWindow::wireWorker() void MainWindow::showWarnings() { - QStringList warnings = m_config.warnings() + m_keyMap.warnings(); + const QStringList warnings = m_config.warnings() + m_keyMap.warnings(); if (warnings.isEmpty()) return; // Non-fatal: the app runs degraded rather than refusing to start. m_statusLabel->setText( - tr("%1 configuration warning(s); see Help").arg(warnings.size())); - QMessageBox::warning(this, tr("Configuration warnings"), - warnings.join(QLatin1Char('\n'))); + tr("%n configuration warning(s)", "", warnings.size())); + + // Interrupt startup only for things that are actually wrong. Every KeyMap + // warning qualifies (each one means a binding the user wrote is being + // ignored), but a Config notice such as "no sync command configured" does + // not: nothing is broken, the feature is simply off, and a modal on every + // launch teaches the user to dismiss dialogs unread. + const QStringList problems = m_config.problems() + m_keyMap.warnings(); + if (problems.isEmpty()) + return; + + QMessageBox::warning(this, tr("Configuration problems"), + problems.join(QLatin1Char('\n'))); } void MainWindow::runCurrentQuery() -- cgit v1.2.3