@@ -63,8 +63,8 @@ namespace {
6363constexpr auto propertyFolder = " folder" ;
6464constexpr auto propertyPath = " path" ;
6565constexpr auto e2eUiActionIdKey = " id" ;
66- constexpr auto e2EeUiActionEnableEncryptionId = " enable_encryption " ;
67- constexpr auto e2EeUiActionDisableEncryptionId = " disable_encryption " ;
66+ constexpr auto e2EeUiActionSetupEncryptionId = " setup_encryption " ;
67+ constexpr auto e2EeUiActionForgetEncryptionId = " forget_encryption " ;
6868constexpr auto e2EeUiActionDisplayMnemonicId = " display_mnemonic" ;
6969constexpr auto e2EeUiActionMigrateCertificateId = " migrate_certificate" ;
7070}
@@ -274,7 +274,7 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent)
274274 _ui->quotaProgressBar->setStyleSheet(QString::fromLatin1(progressBarStyleC).arg(color.name()));*/
275275
276276 // Connect E2E stuff
277- initializeE2eEncryption ();
277+ setupE2eEncryption ();
278278 _ui->encryptionMessage ->setCloseButtonVisible (false );
279279
280280 _ui->connectLabel ->setText (tr (" No account configured." ));
@@ -295,9 +295,9 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent)
295295
296296void AccountSettings::slotE2eEncryptionMnemonicReady ()
297297{
298- const auto actionDisableEncryption = addActionToEncryptionMessage (tr (" Disable encryption" ), e2EeUiActionDisableEncryptionId );
298+ const auto actionDisableEncryption = addActionToEncryptionMessage (tr (" Forget encryption setup " ), e2EeUiActionForgetEncryptionId );
299299 connect (actionDisableEncryption, &QAction::triggered, this , [this ] {
300- disableEncryptionForAccount (_accountState->account ());
300+ forgetEncryptionOnDeviceForAccount (_accountState->account ());
301301 });
302302
303303 if (_accountState->account ()->e2e ()->userCertificateNeedsMigration ()) {
@@ -312,7 +312,7 @@ void AccountSettings::slotE2eEncryptionMnemonicReady()
312312 }
313313
314314 _ui->encryptionMessage ->setMessageType (KMessageWidget::Positive);
315- _ui->encryptionMessage ->setText (tr (" End-to- end encryption has been enabled for this account " ));
315+ _ui->encryptionMessage ->setText (tr (" Encryption is set-up. Remember to <b>Encrypt</b> a folder to end-to- end encrypt any new files added to it. " ));
316316 _ui->encryptionMessage ->setIcon (Theme::createColorAwareIcon (QStringLiteral (" :/client/theme/lock.svg" )));
317317 _ui->encryptionMessage ->show ();
318318}
@@ -329,7 +329,7 @@ void AccountSettings::slotE2eEncryptionInitializationFinished(bool isNewMnemonic
329329{
330330 disconnect (_accountState->account ()->e2e (), &ClientSideEncryption::initializationFinished, this , &AccountSettings::slotE2eEncryptionInitializationFinished);
331331 if (_accountState->account ()->e2e ()->isInitialized ()) {
332- removeActionFromEncryptionMessage (e2EeUiActionEnableEncryptionId );
332+ removeActionFromEncryptionMessage (e2EeUiActionSetupEncryptionId );
333333 slotE2eEncryptionMnemonicReady ();
334334 if (isNewMnemonicGenerated) {
335335 displayMnemonic (_accountState->account ()->e2e ()->getMnemonic ());
@@ -406,9 +406,8 @@ bool AccountSettings::canEncryptOrDecrypt(const FolderStatusModel::SubFolderInfo
406406
407407 if (!_accountState->account ()->e2e () || !_accountState->account ()->e2e ()->isInitialized ()) {
408408 QMessageBox msgBox;
409- msgBox.setText (tr (" End-to-end encryption is not configured on this device. "
410- " Once it is configured, you will be able to encrypt this folder.\n "
411- " Would you like to set up end-to-end encryption?" ));
409+ msgBox.setText (tr (" You cannot encrypt this folder because the end-to-end encryption is not set-up yet on this device.\n "
410+ " Would you like to do this now?" ));
412411 msgBox.setStandardButtons (QMessageBox::Ok | QMessageBox::Cancel);
413412 msgBox.setDefaultButton (QMessageBox::Ok);
414413 const auto ret = msgBox.exec ();
@@ -1092,8 +1091,8 @@ void AccountSettings::displayMnemonic(const QString &mnemonic)
10921091 widget.setWindowTitle (tr (" End-to-end encryption mnemonic" ));
10931092 ui.label ->setText (
10941093 tr (" To protect your Cryptographic Identity, we encrypt it with a mnemonic of 12 dictionary words. "
1095- " Please note these down and keep them safe. "
1096- " They will be needed to add other devices to your account (like your mobile phone or laptop) ." ));
1094+ " Please note it down and keep it safe. "
1095+ " You will need it to set-up the synchronization of encrypted folders on your other devices ." ));
10971096 QFont monoFont (QStringLiteral (" Monospace" ));
10981097 monoFont.setStyleHint (QFont::TypeWriter);
10991098 ui.lineEdit ->setFont (monoFont);
@@ -1113,14 +1112,14 @@ void AccountSettings::displayMnemonic(const QString &mnemonic)
11131112 widget.exec ();
11141113}
11151114
1116- void AccountSettings::disableEncryptionForAccount (const AccountPtr &account) const
1115+ void AccountSettings::forgetEncryptionOnDeviceForAccount (const AccountPtr &account) const
11171116{
11181117 QMessageBox dialog;
1119- dialog.setWindowTitle (tr (" Disable end-to-end encryption" ));
1120- dialog.setText (tr (" Disable end-to-end encryption for %1?" ).arg (account->davUser ()));
1121- dialog.setInformativeText (tr (" Removing end-to-end encryption will remove locally-synced files that are encrypted."
1118+ dialog.setWindowTitle (tr (" Forget the end-to-end encryption on this device " ));
1119+ dialog.setText (tr (" Do you want to forget the end-to-end encryption settings for %1 on this device ?" ).arg (account->davUser ()));
1120+ dialog.setInformativeText (tr (" Forgetting end-to-end encryption will remove the sensitive data and all the encrypted files from this device ."
11221121 " <br>"
1123- " Encrypted files will remain on the server." ));
1122+ " However, the encrypted files will remain on the server and all your other devices, if configured ." ));
11241123 dialog.setStandardButtons (QMessageBox::Ok | QMessageBox::Cancel);
11251124 dialog.setDefaultButton (QMessageBox::Ok);
11261125 dialog.adjustSize ();
@@ -1129,7 +1128,7 @@ void AccountSettings::disableEncryptionForAccount(const AccountPtr &account) con
11291128 switch (ret) {
11301129 case QMessageBox::Ok:
11311130 connect (account->e2e (), &ClientSideEncryption::sensitiveDataForgotten,
1132- this , &AccountSettings::resetE2eEncryption );
1131+ this , &AccountSettings::forgetE2eEncryption );
11331132 account->e2e ()->forgetSensitiveData (account);
11341133 break ;
11351134 case QMessageBox::Cancel:
@@ -1677,37 +1676,35 @@ void AccountSettings::customizeStyle()
16771676 _ui->quotaProgressBar ->setStyleSheet (QString::fromLatin1 (progressBarStyleC).arg (color.name ()));
16781677}
16791678
1680- void AccountSettings::initializeE2eEncryption ()
1679+ void AccountSettings::setupE2eEncryption ()
16811680{
16821681 connect (_accountState->account ()->e2e (), &ClientSideEncryption::initializationFinished, this , &AccountSettings::slotPossiblyUnblacklistE2EeFoldersAndRestartSync);
16831682
16841683 if (_accountState->account ()->e2e ()->isInitialized ()) {
16851684 slotE2eEncryptionMnemonicReady ();
16861685 } else {
1687- initializeE2eEncryptionSettingsMessage ();
1686+ setupE2eEncryptionMessage ();
16881687
16891688 connect (_accountState->account ()->e2e (), &ClientSideEncryption::initializationFinished, this , [this ] {
16901689 if (!_accountState->account ()->e2e ()->getPublicKey ().isNull ()) {
1691- _ui->encryptionMessage ->setText (tr (" End-to-end encryption has been enabled on this account with another device."
1690+ _ui->encryptionMessage ->setText (tr (" End-to-end encryption has been initialized on this account with another device."
16921691 " <br>"
1693- " It can be enabled on this device by entering your mnemonic."
1694- " <br>"
1695- " This will enable synchronisation of existing encrypted folders." ));
1692+ " Enter the unique mnemonic to have the encrypted folders synchronize on this device as well." ));
16961693 }
16971694 });
16981695 _accountState->account ()->setE2eEncryptionKeysGenerationAllowed (false );
16991696 _accountState->account ()->e2e ()->initialize (this , _accountState->account ());
17001697 }
17011698}
17021699
1703- void AccountSettings::resetE2eEncryption ()
1700+ void AccountSettings::forgetE2eEncryption ()
17041701{
17051702 for (const auto action : _ui->encryptionMessage ->actions ()) {
17061703 _ui->encryptionMessage ->removeAction (action);
17071704 }
17081705 _ui->encryptionMessage ->setText ({});
17091706 _ui->encryptionMessage ->setIcon ({});
1710- initializeE2eEncryptionSettingsMessage ();
1707+ setupE2eEncryptionMessage ();
17111708 checkClientSideEncryptionState ();
17121709
17131710 const auto account = _accountState->account ();
@@ -1744,15 +1741,15 @@ QAction *AccountSettings::addActionToEncryptionMessage(const QString &actionTitl
17441741 return action;
17451742}
17461743
1747- void AccountSettings::initializeE2eEncryptionSettingsMessage ()
1744+ void AccountSettings::setupE2eEncryptionMessage ()
17481745{
17491746 _ui->encryptionMessage ->setMessageType (KMessageWidget::Information);
1750- _ui->encryptionMessage ->setText (tr (" This account supports end-to-end encryption" ));
1747+ _ui->encryptionMessage ->setText (tr (" This account supports end-to-end encryption, but it needs to be set up first. " ));
17511748 _ui->encryptionMessage ->setIcon (Theme::createColorAwareIcon (QStringLiteral (" :/client/theme/black/state-info.svg" )));
17521749 _ui->encryptionMessage ->hide ();
17531750
1754- auto *const actionEnableE2e = addActionToEncryptionMessage (tr (" Set up encryption" ), e2EeUiActionEnableEncryptionId );
1755- connect (actionEnableE2e , &QAction::triggered, this , &AccountSettings::slotE2eEncryptionGenerateKeys);
1751+ auto *const actionSetupE2e = addActionToEncryptionMessage (tr (" Set up encryption" ), e2EeUiActionSetupEncryptionId );
1752+ connect (actionSetupE2e , &QAction::triggered, this , &AccountSettings::slotE2eEncryptionGenerateKeys);
17561753}
17571754
17581755} // namespace OCC
0 commit comments