From: Kevin Ottens Date: Tue, 18 Aug 2020 14:35:47 +0000 (+0200) Subject: Show the "Display mnemonic" button only when we know e2e is supported X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~22^2~220 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3540f1e460a1d688f59244cc127e97ff4cc59aa9;p=nextcloud-desktop.git Show the "Display mnemonic" button only when we know e2e is supported Turns out that showing the button straight from the page ctor is a bit too early. At that point the account might not be connected yet and thus we wouldn't have proper information. Currently we were displaying that button all the time, now we wait for the account to be connected to decide to show it or not. Signed-off-by: Kevin Ottens --- diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index c70096730..517d452d2 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -205,7 +205,7 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent) auto *mnemonic = new QAction(tr("Display mnemonic"), this); connect(mnemonic, &QAction::triggered, this, &AccountSettings::requesetMnemonic); _ui->encryptionMessage->addAction(mnemonic); - _ui->encryptionMessage->show(); + _ui->encryptionMessage->hide(); } connect(UserModel::instance(), &UserModel::addAccount, @@ -841,6 +841,10 @@ void AccountSettings::slotAccountStateChanged() */ qCInfo(lcAccountSettings) << "Account" << accountsState()->account()->displayName() << "Client Side Encryption" << accountsState()->account()->capabilities().clientSideEncryptionAvailable(); + + if (_accountState->account()->capabilities().clientSideEncryptionAvailable()) { + _ui->encryptionMessage->show(); + } } }