From: Kevin Ottens Date: Tue, 11 Aug 2020 12:55:51 +0000 (+0200) Subject: Keep the E2EE info message around to allow displaying mnemonic X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~22^2~240^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=37e20698caef89dd552f953bc415aa9f672697a8;p=nextcloud-desktop.git Keep the E2EE info message around to allow displaying mnemonic We lost the ability to display the E2EE mnemonic during the GUI redesign and the info message wasn't displayed again on restart. So now we display it every time, it still can be dismissed and the button text is different in such a case to make the intent clearer. Signed-off-by: Kevin Ottens --- diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index d625d7d2d..2caf63b50 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -197,11 +197,15 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent) connect(_accountState->account()->e2e(), &ClientSideEncryption::showMnemonic, this, &AccountSettings::slotShowMnemonic); connect(_accountState->account()->e2e(), &ClientSideEncryption::mnemonicGenerated, this, &AccountSettings::slotNewMnemonicGenerated); - if (_accountState->account()->e2e()->newMnemonicGenerated()) - { + if (_accountState->account()->e2e()->newMnemonicGenerated()) { slotNewMnemonicGenerated(); } else { - _ui->encryptionMessage->hide(); + _ui->encryptionMessage->setText(tr("This account supports end-to-end encryption")); + + auto *mnemonic = new QAction(tr("Display mnemonic"), this); + connect(mnemonic, &QAction::triggered, this, &AccountSettings::requesetMnemonic); + _ui->encryptionMessage->addAction(mnemonic); + _ui->encryptionMessage->show(); } connect(UserModel::instance(), &UserModel::addAccount,