From d9c9c30865330b24349438e4e20579fd76dafbd5 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 19 Oct 2026 10:01:49 +0200 Subject: desktop: report save results in the SaveBar, not at the page's foot A save's outcome sat at the bottom of the page, out of sight on a long one, while "unsaved changes" was already in the header. SaveBar gains notice, shown once the page is clean, and error, shown in red over the unsaved mark, since a refused or failed write leaves the draft dirty. Wired for notifications, HyprIdle, Sunset, Wallpaper and the four Mail pages, with their longer messages shortened to fit the header. Messages that are not save results stay in their pages: the icon theme's immediate apply, Sunset's location detection, the assistant restart. Co-Authored-By: Claude Opus 5.5 --- desktop/modules/qtmaildir/MailAccountsModule.qml | 2 +- desktop/modules/qtmaildir/MailComposeModule.qml | 2 +- desktop/modules/qtmaildir/MailGeneralModule.qml | 2 +- desktop/modules/qtmaildir/MailTagsKeysModule.qml | 2 +- desktop/modules/qtmaildir/Note.qml | 11 ++--------- desktop/modules/qtmaildir/Qtm.qml | 4 ++-- 6 files changed, 8 insertions(+), 15 deletions(-) (limited to 'desktop/modules/qtmaildir') diff --git a/desktop/modules/qtmaildir/MailAccountsModule.qml b/desktop/modules/qtmaildir/MailAccountsModule.qml index a77dbac..11cfecb 100644 --- a/desktop/modules/qtmaildir/MailAccountsModule.qml +++ b/desktop/modules/qtmaildir/MailAccountsModule.qml @@ -32,7 +32,7 @@ Module { title: "Accounts" // One draft behind all four Mail pages: Save writes them all. actions: Component { - SaveBar { dirty: Qtm.dirty; valid: Qtm.valid; onSave: Qtm.save(); onDiscard: Qtm.discard() } + SaveBar { dirty: Qtm.dirty; valid: Qtm.valid; error: Qtm.error; onSave: Qtm.save(); onDiscard: Qtm.discard() } } AccountsPage { width: parent.width } } diff --git a/desktop/modules/qtmaildir/MailComposeModule.qml b/desktop/modules/qtmaildir/MailComposeModule.qml index 6a9a198..f97f9ef 100644 --- a/desktop/modules/qtmaildir/MailComposeModule.qml +++ b/desktop/modules/qtmaildir/MailComposeModule.qml @@ -33,7 +33,7 @@ Module { title: "Compose" // One draft behind all four Mail pages: Save writes them all. actions: Component { - SaveBar { dirty: Qtm.dirty; valid: Qtm.valid; onSave: Qtm.save(); onDiscard: Qtm.discard() } + SaveBar { dirty: Qtm.dirty; valid: Qtm.valid; error: Qtm.error; onSave: Qtm.save(); onDiscard: Qtm.discard() } } ComposePage { width: parent.width } } diff --git a/desktop/modules/qtmaildir/MailGeneralModule.qml b/desktop/modules/qtmaildir/MailGeneralModule.qml index 02ecd5a..87ebeb9 100644 --- a/desktop/modules/qtmaildir/MailGeneralModule.qml +++ b/desktop/modules/qtmaildir/MailGeneralModule.qml @@ -43,7 +43,7 @@ Module { title: "Mail" // One draft behind all four Mail pages: Save writes them all. actions: Component { - SaveBar { dirty: Qtm.dirty; valid: Qtm.valid; onSave: Qtm.save(); onDiscard: Qtm.discard() } + SaveBar { dirty: Qtm.dirty; valid: Qtm.valid; error: Qtm.error; onSave: Qtm.save(); onDiscard: Qtm.discard() } } GeneralPage { width: parent.width } } diff --git a/desktop/modules/qtmaildir/MailTagsKeysModule.qml b/desktop/modules/qtmaildir/MailTagsKeysModule.qml index 0c1eade..c414a71 100644 --- a/desktop/modules/qtmaildir/MailTagsKeysModule.qml +++ b/desktop/modules/qtmaildir/MailTagsKeysModule.qml @@ -31,7 +31,7 @@ Module { title: "Tags & shortcuts" // One draft behind all four Mail pages: Save writes them all. actions: Component { - SaveBar { dirty: Qtm.dirty; valid: Qtm.valid; onSave: Qtm.save(); onDiscard: Qtm.discard() } + SaveBar { dirty: Qtm.dirty; valid: Qtm.valid; error: Qtm.error; onSave: Qtm.save(); onDiscard: Qtm.discard() } } TagsKeysPage { width: parent.width } } diff --git a/desktop/modules/qtmaildir/Note.qml b/desktop/modules/qtmaildir/Note.qml index 56b8208..94213c1 100644 --- a/desktop/modules/qtmaildir/Note.qml +++ b/desktop/modules/qtmaildir/Note.qml @@ -12,7 +12,8 @@ import QtQuick import "../.." -// The top of every Mail page: when changes apply, and any write error. +// The top of every Mail page: when changes apply. A refused or failed +// write is reported in the SaveBar. Column { width: parent ? parent.width : 0 spacing: 4 @@ -24,12 +25,4 @@ Column { color: Qtm.running ? Theme.yellow : Theme.subtext font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 } } - Text { - width: parent.width - visible: Qtm.error !== "" - wrapMode: Text.Wrap - text: Qtm.error - color: Theme.red - font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 } - } } diff --git a/desktop/modules/qtmaildir/Qtm.qml b/desktop/modules/qtmaildir/Qtm.qml index 3f6175b..554841b 100644 --- a/desktop/modules/qtmaildir/Qtm.qml +++ b/desktop/modules/qtmaildir/Qtm.qml @@ -82,7 +82,7 @@ Singleton { // here (AGENTS.md: it writes nothing for empty text on an unloaded path). function save() { if (root.text !== root.base) { - root.error = "qtmaildir.conf changed on disk since these edits began. Discard to load it, then redo them."; + root.error = "changed on disk: Discard to load it, then redo"; return; } root.error = ""; @@ -119,7 +119,7 @@ Singleton { if (!root.dirty) { root.base = root.text; root.draft = root.text; } } onLoadFailed: if (!root.dirty) { root.text = ""; root.base = ""; root.draft = ""; } - onSaveFailed: err => root.error = "Cannot write " + root.path + ": " + FileViewError.toString(err) + onSaveFailed: err => root.error = "cannot write: " + FileViewError.toString(err) } Process { -- cgit v1.2.3