From 2ae92a8434c878659594381eb41aa6ed6bf60c0f Mon Sep 17 00:00:00 2001
From: DenioD <41270280+DenioD@users.noreply.github.com>
Date: Fri, 21 Aug 2020 20:54:12 +0200
Subject: [PATCH] create/restore at startup if needed
---
src/mainwindow.cpp | 17 ++++++++++++++++-
src/startupencryption.ui | 28 ++++++++++++++--------------
2 files changed, 30 insertions(+), 15 deletions(-)
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index b598425..2a2fd3f 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -633,6 +633,21 @@ void MainWindow::removeWalletEncryptionStartUp() {
QDialog d(this);
Ui_startup ed;
ed.setupUi(&d);
+
+ QObject::connect(ed.new_restore, &QPushButton::clicked, [&] {
+
+ d.close();
+ QFile wallet(dirwallet);
+ QFile walletenc(dirwalletenc);
+
+ wallet.remove();
+ walletenc.remove();
+
+ auto cl = new ConnectionLoader(this, rpc);
+ cl->loadConnection();
+
+
+ });
if (d.exec() == QDialog::Accepted)
{
@@ -696,7 +711,7 @@ void MainWindow::removeWalletEncryptionStartUp() {
this->doClosePw();
}
-
+
}
QString MainWindow::getPassword()
diff --git a/src/startupencryption.ui b/src/startupencryption.ui
index 963d2f0..a8d0325 100644
--- a/src/startupencryption.ui
+++ b/src/startupencryption.ui
@@ -7,7 +7,7 @@
0
0
400
- 177
+ 218
@@ -25,13 +25,13 @@
400
- 177
+ 250
SDL Startup Decryption
-
+
-
@@ -45,21 +45,28 @@
- -
+
-
+
+
+ Create new Wallet or Restore
+
+
+
+ -
Qt::Horizontal
- -
+
-
Encryption Passphrase:
- -
+
-
@@ -72,14 +79,7 @@
- -
-
-
- Qt::Horizontal
-
-
-
- -
+
-
Qt::Horizontal