diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 8cb9ea664..6f9a2f8b9 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -35,6 +35,7 @@ set(client_UI_SRCS addcertificatedialog.ui proxyauthdialog.ui notificationwidget.ui + mnemonicdialog.ui wizard/owncloudadvancedsetuppage.ui wizard/owncloudconnectionmethoddialog.ui wizard/owncloudhttpcredspage.ui diff --git a/src/gui/accountmanager.cpp b/src/gui/accountmanager.cpp index 45b75b3e3..ae144bcca 100644 --- a/src/gui/accountmanager.cpp +++ b/src/gui/accountmanager.cpp @@ -25,6 +25,7 @@ #include #include #include "clientsideencryption.h" +#include "ui_mnemonicdialog.h" namespace { static const char urlC[] = "url"; @@ -335,16 +336,19 @@ AccountPtr AccountManager::createAccount() void AccountManager::displayMnemonic(const QString& mnemonic) { - QMessageBox msgBox; - msgBox.setText(tr("All 12 words together make a very strong password, " - "letting only you view and make use of your encrypted files. " - "Please write it down and keep it somewhere safe.")); - msgBox.setDetailedText(mnemonic); - msgBox.setWindowTitle(tr("Make note of your 12 word encryption password")); - msgBox.setIcon(QMessageBox::Information); - msgBox.setStandardButtons(QMessageBox::Ok); - - msgBox.exec(); + QDialog *widget = new QDialog; + Ui_Dialog ui; + ui.setupUi(widget); + widget->setWindowTitle(tr("End to end encryption mnemonic")); + ui.label->setText(tr("To protect your Cryptocraphic Identity, we encrypt it with a mnemonic of 12 dictionary words." + "Please note these down and keep them safe. " + "They will be needed to add other devices to your account (like your mobile phone or laptop).")); + ui.textEdit->setText(mnemonic); + ui.textEdit->focusWidget(); + ui.textEdit->selectAll(); + ui.textEdit->setAlignment(Qt::AlignCenter); + widget->exec(); + widget->resize(widget->sizeHint()); } void AccountManager::shutdown() { diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index e4d7c372a..1e3183cc2 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -284,10 +284,7 @@ void AccountSettings::doExpand() } void AccountSettings::slotShowMnemonic(const QString &mnemonic) { - QMessageBox msgBox; - msgBox.setText(tr("Your end to end encryption mnemonic is:")); - msgBox.setInformativeText(mnemonic); - msgBox.exec(); + AccountManager::instance()->displayMnemonic(mnemonic); } void AccountSettings::slotEncryptionFlagSuccess(const QByteArray& fileId) diff --git a/src/gui/mnemonicdialog.ui b/src/gui/mnemonicdialog.ui new file mode 100644 index 000000000..e0b804f13 --- /dev/null +++ b/src/gui/mnemonicdialog.ui @@ -0,0 +1,146 @@ + + + Dialog + + + Qt::NonModal + + + + 0 + 0 + 588 + 214 + + + + + 0 + 0 + + + + Dialog + + + false + + + false + + + + + + QLayout::SetMinimumSize + + + + + + 0 + 50 + + + + + 0 + 0 + + + + + 0 + 0 + + + + Label + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 16777215 + 80 + + + + + + + + + 0 + 0 + + + + Qt::Horizontal + + + QDialogButtonBox::Ok + + + + + + + + + + + buttonBox + accepted() + Dialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + Dialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + +