mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 13:25:52 +03:00
[CSE] Move code to display minemonic out of the libsync
The libsync should not contain Qt Widget related code.
This commit is contained in:
parent
6d613fb4d5
commit
4a2d0ab9e9
4 changed files with 20 additions and 8 deletions
|
@ -23,6 +23,8 @@
|
|||
#include <QSettings>
|
||||
#include <QDir>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QMessageBox>
|
||||
#include "clientsideencryption.h"
|
||||
|
||||
namespace {
|
||||
static const char urlC[] = "url";
|
||||
|
@ -324,10 +326,23 @@ AccountPtr AccountManager::createAccount()
|
|||
acc->setSslErrorHandler(new SslDialogErrorHandler);
|
||||
connect(acc.data(), &Account::proxyAuthenticationRequired,
|
||||
ProxyAuthHandler::instance(), &ProxyAuthHandler::handleProxyAuthenticationRequired);
|
||||
|
||||
connect(acc.data()->e2e(), &ClientSideEncryption::mnemonicGenerated,
|
||||
&AccountManager::displayMnemonic);
|
||||
|
||||
return acc;
|
||||
}
|
||||
|
||||
void AccountManager::displayMnemonic(const QString& mnemonic)
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(tr("Note your encryption passphrase"));
|
||||
msgBox.setDetailedText(mnemonic);
|
||||
msgBox.setIcon(QMessageBox::Information);
|
||||
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||
|
||||
msgBox.exec();
|
||||
}
|
||||
void AccountManager::shutdown()
|
||||
{
|
||||
auto accountsCopy = _accounts;
|
||||
|
|
|
@ -97,6 +97,9 @@ public slots:
|
|||
/// Saves account state data, not including the account
|
||||
void saveAccountState(AccountState *a);
|
||||
|
||||
/// Display a Box with the mnemonic so the user can copy it to a safe place.
|
||||
static void displayMnemonic(const QString& mnemonic);
|
||||
|
||||
|
||||
Q_SIGNALS:
|
||||
void accountAdded(AccountState *account);
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include <QInputDialog>
|
||||
#include <QLineEdit>
|
||||
#include <QIODevice>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include <keychain.h>
|
||||
|
||||
|
@ -931,13 +930,7 @@ void ClientSideEncryption::encryptPrivateKey()
|
|||
_mnemonic = list.join(' ');
|
||||
qCInfo(lcCse()) << "mnemonic Generated:" << _mnemonic;
|
||||
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(tr("Note your encryption passphrase"));
|
||||
msgBox.setDetailedText(_mnemonic);
|
||||
msgBox.setIcon(QMessageBox::Information);
|
||||
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||
|
||||
msgBox.exec();
|
||||
emit mnemonicGenerated(_mnemonic);
|
||||
|
||||
QString passPhrase = list.join(QString()).toLower();
|
||||
qCInfo(lcCse()) << "Passphrase Generated:" << passPhrase;
|
||||
|
|
|
@ -96,6 +96,7 @@ private slots:
|
|||
|
||||
signals:
|
||||
void initializationFinished();
|
||||
void mnemonicGenerated(const QString& mnemonic);
|
||||
|
||||
private:
|
||||
void getPrivateKeyFromServer();
|
||||
|
|
Loading…
Reference in a new issue