Skip to content

Commit

Permalink
Make warning text before deleting all files more clear and concise.
Browse files Browse the repository at this point in the history
Signed-off-by: Camila Ayres <[email protected]>
  • Loading branch information
camilasan committed Jun 4, 2024
1 parent 11b11c0 commit bd1fcbf
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/gui/folder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1628,21 +1628,14 @@ bool Folder::virtualFilesEnabled() const

void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction dir, std::function<void(bool)> callback)
{
const QString msg = dir == SyncFileItem::Down ? tr("All files in the sync folder \"%1\" folder were deleted on the server.\n"
"These deletes will be synchronized to your local sync folder, making such files "
"unavailable unless you have a right to restore. \n"
"If you decide to restore the files, they will be re-synced with the server if you have rights to do so.\n"
"If you decide to delete the files, they will be unavailable to you, unless you are the owner.")
: tr("All the files in your local sync folder \"%1\" were deleted. These deletes will be "
"synchronized with your server, making such files unavailable unless restored.\n"
"Are you sure you want to sync those actions with the server?\n"
"If this was an accident and you decide to keep your files, they will be re-synced from the server.");
auto msgBox = new QMessageBox(QMessageBox::Warning, tr("Remove All Files?"),
msg.arg(shortGuiLocalPath()), QMessageBox::NoButton);
const QString msg = dir == SyncFileItem::Down ? tr("All files in the server folder \"%1\" were deleted.\n\nIf you restore the files, they will be uploaded again to the server.")
: tr("All files in the local folder \"%1\" were deleted.\n\nIf you restore the files, they will be downloaded again from the server.");
auto msgBox = new QMessageBox(QMessageBox::Warning, tr("Remove all files?"),
msg.arg(shortGuiLocalPath()), QMessageBox::NoButton);
msgBox->setAttribute(Qt::WA_DeleteOnClose);
msgBox->setWindowFlags(msgBox->windowFlags() | Qt::WindowStaysOnTopHint);
msgBox->addButton(tr("Remove all files"), QMessageBox::DestructiveRole);
QPushButton *keepBtn = msgBox->addButton(tr("Keep files"), QMessageBox::AcceptRole);
msgBox->addButton(tr("Proceed removing all files"), QMessageBox::DestructiveRole);
QPushButton *keepBtn = msgBox->addButton(tr("Restore files"), QMessageBox::AcceptRole);
bool oldPaused = syncPaused();
setSyncPaused(true);
connect(msgBox, &QMessageBox::finished, this, [msgBox, keepBtn, callback, oldPaused, this] {
Expand Down

0 comments on commit bd1fcbf

Please sign in to comment.