mirror of
https://github.com/wownero/wowlet.git
synced 2026-10-25 18:28:53 +01:00
SeedDialog: add 25 word seed toggle
This commit is contained in:
+28
-12
@@ -4,27 +4,43 @@
|
||||
#include "ui_seeddialog.h"
|
||||
#include "seeddialog.h"
|
||||
|
||||
SeedDialog::SeedDialog(const QString &seed, QWidget *parent)
|
||||
SeedDialog::SeedDialog(Wallet *wallet, QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, ui(new Ui::SeedDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->label_seedIcon->setPixmap(QPixmap(":/assets/images/seed.png").scaledToWidth(64, Qt::SmoothTransformation));
|
||||
|
||||
QString seed_14_words = wallet->getCacheAttribute("feather.seed");
|
||||
QString seed_25_words = wallet->getSeed();
|
||||
|
||||
if (seed_14_words.isEmpty()) {
|
||||
ui->check_toggleSeedType->hide();
|
||||
this->setSeed(seed_25_words);
|
||||
} else {
|
||||
this->setSeed(seed_14_words);
|
||||
connect(ui->check_toggleSeedType, &QCheckBox::toggled, [this, seed_25_words, seed_14_words](bool toggled){
|
||||
this->setSeed(toggled ? seed_25_words : seed_14_words);
|
||||
});
|
||||
}
|
||||
|
||||
this->adjustSize();
|
||||
}
|
||||
|
||||
void SeedDialog::setSeed(const QString &seed) {
|
||||
ui->seed->setPlainText(seed);
|
||||
|
||||
int words = seed.split(" ").size();
|
||||
ui->label_warning->setText(QString("<p>Please save these %1 words on paper (order is important). "
|
||||
"This seed will allow you to recover your wallet in case "
|
||||
"of computer failure."
|
||||
"</p>"
|
||||
"<b>WARNING:</b>"
|
||||
"<ul>"
|
||||
"<li>Never disclose your seed.</li>"
|
||||
"<li>Never type it on a website</li>"
|
||||
"<li>Do not store it electronically</li>"
|
||||
"</ul>").arg(words));
|
||||
|
||||
this->adjustSize();
|
||||
"This seed will allow you to recover your wallet in case "
|
||||
"of computer failure."
|
||||
"</p>"
|
||||
"<b>WARNING:</b>"
|
||||
"<ul>"
|
||||
"<li>Never disclose your seed.</li>"
|
||||
"<li>Never type it on a website</li>"
|
||||
"<li>Do not store it electronically</li>"
|
||||
"</ul>").arg(words));
|
||||
}
|
||||
|
||||
SeedDialog::~SeedDialog()
|
||||
|
||||
Reference in New Issue
Block a user