From c8599bc0843095ed623d3f8bd97295f579375665 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Fri, 11 Aug 2023 15:08:32 +0800 Subject: [PATCH] Fix warning dialog box message when trying to encrypt folders that have not been successfully synced (i.e. error/problem) Signed-off-by: Claudio Cambra --- src/gui/accountsettings.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index cc300174d..7613595cd 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -329,10 +329,18 @@ void AccountSettings::doExpand() } } -bool AccountSettings::canEncryptOrDecrypt(const FolderStatusModel::SubFolderInfo* info) { - if (info->_folder->syncResult().status() != SyncResult::Status::Success) { +bool AccountSettings::canEncryptOrDecrypt(const FolderStatusModel::SubFolderInfo *info) +{ + if (const auto folderSyncStatus = info->_folder->syncResult().status(); folderSyncStatus != SyncResult::Status::Success) { + auto message = tr("Please wait for the folder to sync before trying to encrypt it."); + if (folderSyncStatus == SyncResult::Status::Problem) { + message = tr("The folder has a minor sync problem. Encryption of this folder will be possible once it has synced successfully"); + } else if (folderSyncStatus == SyncResult::Status::Error) { + message = tr("The folder has a sync error. Encryption of this folder will be possible once it has synced successfully"); + } + QMessageBox msgBox; - msgBox.setText("Please wait for the folder to sync before trying to encrypt it."); + msgBox.setText(message); msgBox.exec(); return false; }