Browse Source

Merge #266: Check for empty password and cancellation in JoinMarket-Qt wallet generation

5d66d94 Check for empty password and cancellation in JoinMarket-Qt wallet generation (Kristaps Kaupe)
master
AdamISZ 7 years ago
parent
commit
d3db7dc3b9
No known key found for this signature in database
GPG Key ID: 141001A1AF77F20B
  1. 12
      scripts/joinmarket-qt.py

12
scripts/joinmarket-qt.py

@ -1465,13 +1465,21 @@ class JMMainWindow(QMainWindow):
def getPassword(self): def getPassword(self):
pd = PasswordDialog() pd = PasswordDialog()
while True: while True:
pd.exec_() pd_return = pd.exec_()
if pd.new_pw.text() != pd.conf_pw.text(): if pd_return == QDialog.Rejected:
return None
elif pd.new_pw.text() != pd.conf_pw.text():
JMQtMessageBox(self, JMQtMessageBox(self,
"Passwords don't match.", "Passwords don't match.",
mbtype='warn', mbtype='warn',
title="Error") title="Error")
continue continue
elif pd.new_pw.text() == "":
JMQtMessageBox(self,
"Password must not be empty.",
mbtype='warn',
title="Error")
continue
break break
self.textpassword = str(pd.new_pw.text()) self.textpassword = str(pd.new_pw.text())
return self.textpassword.encode('utf-8') return self.textpassword.encode('utf-8')

Loading…
Cancel
Save