use userpw for encryption at sdl close
This commit is contained in:
@@ -276,7 +276,7 @@ void MainWindow::closeEvent(QCloseEvent* event) {
|
|||||||
fileoldencryption.remove();
|
fileoldencryption.remove();
|
||||||
|
|
||||||
// Encrypt our wallet.dat
|
// Encrypt our wallet.dat
|
||||||
QString str = "123";///just for testing. We set the user pw here
|
QString str = this->getPassword();
|
||||||
// QString str = ed.txtPassword->text(); // data comes from user inputs
|
// QString str = ed.txtPassword->text(); // data comes from user inputs
|
||||||
int length = str.length();
|
int length = str.length();
|
||||||
|
|
||||||
@@ -351,6 +351,7 @@ void MainWindow::encryptWallet() {
|
|||||||
auto fnPasswordEdited = [=](const QString&) {
|
auto fnPasswordEdited = [=](const QString&) {
|
||||||
// Enable the OK button if the passwords match.
|
// Enable the OK button if the passwords match.
|
||||||
QString password = ed.txtPassword->text();
|
QString password = ed.txtPassword->text();
|
||||||
|
this->setPassword(password);
|
||||||
if (!ed.txtPassword->text().isEmpty() &&
|
if (!ed.txtPassword->text().isEmpty() &&
|
||||||
ed.txtPassword->text() == ed.txtConfirmPassword->text() && password.size() >= 16) {
|
ed.txtPassword->text() == ed.txtConfirmPassword->text() && password.size() >= 16) {
|
||||||
ed.lblPasswordMatch->setText("");
|
ed.lblPasswordMatch->setText("");
|
||||||
@@ -546,6 +547,18 @@ void MainWindow::removeWalletEncryptionStartUp() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString MainWindow::getPassword()
|
||||||
|
{
|
||||||
|
|
||||||
|
return _password;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::setPassword(QString password)
|
||||||
|
{
|
||||||
|
|
||||||
|
_password = password;
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::setupStatusBar() {
|
void MainWindow::setupStatusBar() {
|
||||||
// Status Bar
|
// Status Bar
|
||||||
loadingLabel = new QLabel();
|
loadingLabel = new QLabel();
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ public:
|
|||||||
QString doSendChatTxValidations(Tx tx);
|
QString doSendChatTxValidations(Tx tx);
|
||||||
QString doSendRequestTxValidations(Tx tx);
|
QString doSendRequestTxValidations(Tx tx);
|
||||||
QString getCid();
|
QString getCid();
|
||||||
|
QString getPassword();
|
||||||
|
void setPassword(QString Password);
|
||||||
|
|
||||||
void replaceWormholeClient(WormholeClient* newClient);
|
void replaceWormholeClient(WormholeClient* newClient);
|
||||||
bool isWebsocketListening();
|
bool isWebsocketListening();
|
||||||
@@ -120,6 +122,7 @@ private:
|
|||||||
void setupStatusBar();
|
void setupStatusBar();
|
||||||
|
|
||||||
void clearSendForm();
|
void clearSendForm();
|
||||||
|
QString _password;
|
||||||
|
|
||||||
Tx createTxFromSendPage();
|
Tx createTxFromSendPage();
|
||||||
bool confirmTx(Tx tx, RecurringPaymentInfo* rpi);
|
bool confirmTx(Tx tx, RecurringPaymentInfo* rpi);
|
||||||
|
|||||||
Reference in New Issue
Block a user