Skip to content

Commit

Permalink
Merge pull request #3346 from nextcloud/bugfix/e2ee-warning-vfs-dialog
Browse files Browse the repository at this point in the history
Set button on QMessageBox before changing the text
  • Loading branch information
mgallien authored May 27, 2021
2 parents ba5f517 + 03610cb commit a807263
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/gui/accountsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,14 @@ bool showEnableE2eeWithVirtualFilesWarningDialog()
" End-to-End Encryption, make sure the encrypted folder is marked with"
" \"Make always available locally\"."));
e2eeWithVirtualFilesWarningMsgBox.setIcon(QMessageBox::Warning);
const auto dontEncryptButton = e2eeWithVirtualFilesWarningMsgBox.button(QMessageBox::StandardButton::Ok);
const auto encryptButton = e2eeWithVirtualFilesWarningMsgBox.button(QMessageBox::StandardButton::Cancel);
const auto dontEncryptButton = e2eeWithVirtualFilesWarningMsgBox.addButton(QMessageBox::StandardButton::Ok);
Q_ASSERT(dontEncryptButton);
dontEncryptButton->setText(AccountSettings::tr("Don't encrypt folder"));
const auto encryptButton = e2eeWithVirtualFilesWarningMsgBox.addButton(QMessageBox::StandardButton::Cancel);
Q_ASSERT(encryptButton);
encryptButton->setText(AccountSettings::tr("Encrypt folder"));
e2eeWithVirtualFilesWarningMsgBox.exec();


return e2eeWithVirtualFilesWarningMsgBox.clickedButton() != dontEncryptButton;
}
Expand Down

0 comments on commit a807263

Please sign in to comment.