Browse Source

create/restore at startup if needed

pull/188/head
DenioD 4 years ago
parent
commit
2ae92a8434
  1. 17
      src/mainwindow.cpp
  2. 28
      src/startupencryption.ui

17
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()

28
src/startupencryption.ui

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>400</width>
<height>177</height>
<height>218</height>
</rect>
</property>
<property name="sizePolicy">
@ -25,13 +25,13 @@
<property name="maximumSize">
<size>
<width>400</width>
<height>177</height>
<height>250</height>
</size>
</property>
<property name="windowTitle">
<string>SDL Startup Decryption</string>
</property>
<layout class="QFormLayout" name="formLayout">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_2">
<property name="text">
@ -45,21 +45,28 @@
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<item row="1" column="0" colspan="2">
<widget class="QPushButton" name="new_restore">
<property name="text">
<string>Create new Wallet or Restore</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Encryption Passphrase:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<item row="4" column="0">
<widget class="QLineEdit" name="txtPassword">
<property name="minimumSize">
<size>
@ -72,14 +79,7 @@
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="9" column="1">
<item row="4" column="1">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>

Loading…
Cancel
Save