fixed CQ for bitmessageqt.newaddresswizard module
This commit is contained in:
parent
e372459737
commit
5b3139c4d1
|
@ -1,14 +1,18 @@
|
||||||
#!/usr/bin/env python2.7
|
#!/usr/bin/env python2.7
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
|
|
||||||
class NewAddressWizardIntroPage(QtGui.QWizardPage):
|
class NewAddressWizardIntroPage(QtGui.QWizardPage):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(QtGui.QWizardPage, self).__init__()
|
super(QtGui.QWizardPage, self).__init__()
|
||||||
self.setTitle("Creating a new address")
|
self.setTitle("Creating a new address")
|
||||||
|
|
||||||
label = QtGui.QLabel("This wizard will help you create as many addresses as you like. Indeed, creating and abandoning addresses is encouraged.\n\n"
|
label = QtGui.QLabel(
|
||||||
"What type of address would you like? Would you like to send emails or not?\n"
|
"This wizard will help you create as many addresses"
|
||||||
"You can still change your mind later, and register/unregister with an email service provider.\n\n")
|
" as you like. Indeed, creating and abandoning addresses is encouraged.\n\n"
|
||||||
|
" What type of address would you like? Would you like to send emails or not?\n"
|
||||||
|
" You can still change your mind later, and register/unregister with an "
|
||||||
|
" email service provider.\n\n")
|
||||||
label.setWordWrap(True)
|
label.setWordWrap(True)
|
||||||
|
|
||||||
self.emailAsWell = QtGui.QRadioButton("Combined email and bitmessage address")
|
self.emailAsWell = QtGui.QRadioButton("Combined email and bitmessage address")
|
||||||
|
@ -35,17 +39,20 @@ class NewAddressWizardRngPassphrasePage(QtGui.QWizardPage):
|
||||||
super(QtGui.QWizardPage, self).__init__()
|
super(QtGui.QWizardPage, self).__init__()
|
||||||
self.setTitle("Random or Passphrase")
|
self.setTitle("Random or Passphrase")
|
||||||
|
|
||||||
label = QtGui.QLabel("<html><head/><body><p>You may generate addresses by using either random numbers or by using a passphrase. "
|
label = QtGui.QLabel(
|
||||||
"If you use a passphrase, the address is called a "deterministic" address. "
|
"<html><head/><body><p>You may generate addresses by using either random"
|
||||||
"The \'Random Number\' option is selected by default but deterministic addresses have several pros and cons:</p>"
|
" numbers or by using a passphrase.If you use a passphrase, the address"
|
||||||
"<table border=0><tr><td><span style=\" font-weight:600;\">Pros:</span></td><td><span style=\" font-weight:600;\">Cons:</span></td></tr>"
|
" is called a "deterministic" address.The \'Random Number\' option"
|
||||||
"<tr><td>You can recreate your addresses on any computer from memory. "
|
" is selected by default but deterministic addresses have several pros"
|
||||||
"You need-not worry about backing up your keys.dat file as long as you can remember your passphrase.</td>"
|
" and cons:</p><table border=0><tr><td><span style=\" font-weight:600;\">Pros:"
|
||||||
"<td>You must remember (or write down) your passphrase if you expect to be able "
|
" </span></td><td><span style=\" font-weight:600;\">Cons:</span></td></tr>"
|
||||||
"to recreate your keys if they are lost. "
|
"<tr><td>You can recreate your addresses on any computer from memory."
|
||||||
# "You must remember the address version number and the stream number along with your passphrase. "
|
" You need-not worry about backing up your keys.dat file as long as you can"
|
||||||
"If you choose a weak passphrase and someone on the Internet can brute-force it, they can read your messages and send messages as you."
|
" remember your passphrase.</td><td>You must remember (or write down) your"
|
||||||
"</p></body></html>")
|
" passphrase if you expect to be able to recreate your keys if they are lost."
|
||||||
|
# "You must remember the address version number and the stream number along with your passphrase. "
|
||||||
|
" If you choose a weak passphrase and someone on the Internet can brute-force it,"
|
||||||
|
" they can read your messages and send messages as you.</p></body></html>")
|
||||||
label.setWordWrap(True)
|
label.setWordWrap(True)
|
||||||
|
|
||||||
self.randomAddress = QtGui.QRadioButton("Use a random number generator to make an address")
|
self.randomAddress = QtGui.QRadioButton("Use a random number generator to make an address")
|
||||||
|
@ -64,6 +71,7 @@ class NewAddressWizardRngPassphrasePage(QtGui.QWizardPage):
|
||||||
else:
|
else:
|
||||||
return 3
|
return 3
|
||||||
|
|
||||||
|
|
||||||
class NewAddressWizardRandomPage(QtGui.QWizardPage):
|
class NewAddressWizardRandomPage(QtGui.QWizardPage):
|
||||||
def __init__(self, addresses):
|
def __init__(self, addresses):
|
||||||
super(QtGui.QWizardPage, self).__init__()
|
super(QtGui.QWizardPage, self).__init__()
|
||||||
|
@ -75,10 +83,13 @@ class NewAddressWizardRandomPage(QtGui.QWizardPage):
|
||||||
labelLabel = QtGui.QLabel("Label (not shown to anyone except you):")
|
labelLabel = QtGui.QLabel("Label (not shown to anyone except you):")
|
||||||
self.labelLineEdit = QtGui.QLineEdit()
|
self.labelLineEdit = QtGui.QLineEdit()
|
||||||
|
|
||||||
self.radioButtonMostAvailable = QtGui.QRadioButton("Use the most available stream\n"
|
self.radioButtonMostAvailable = QtGui.QRadioButton(
|
||||||
|
"Use the most available stream\n"
|
||||||
"(best if this is the first of many addresses you will create)")
|
"(best if this is the first of many addresses you will create)")
|
||||||
self.radioButtonExisting = QtGui.QRadioButton("Use the same stream as an existing address\n"
|
self.radioButtonExisting = QtGui.QRadioButton(
|
||||||
"(saves you some bandwidth and processing power)")
|
"Use the same stream as an existing address\n"
|
||||||
|
"(saves you some bandwidth and processing power)"
|
||||||
|
)
|
||||||
self.radioButtonMostAvailable.setChecked(True)
|
self.radioButtonMostAvailable.setChecked(True)
|
||||||
self.comboBoxExisting = QtGui.QComboBox()
|
self.comboBoxExisting = QtGui.QComboBox()
|
||||||
self.comboBoxExisting.setEnabled(False)
|
self.comboBoxExisting.setEnabled(False)
|
||||||
|
@ -88,7 +99,10 @@ class NewAddressWizardRandomPage(QtGui.QWizardPage):
|
||||||
self.comboBoxExisting.addItem(address)
|
self.comboBoxExisting.addItem(address)
|
||||||
|
|
||||||
# self.comboBoxExisting.setObjectName(_fromUtf8("comboBoxExisting"))
|
# self.comboBoxExisting.setObjectName(_fromUtf8("comboBoxExisting"))
|
||||||
self.checkBoxEighteenByteRipe = QtGui.QCheckBox("Spend several minutes of extra computing time to make the address(es) 1 or 2 characters shorter")
|
self.checkBoxEighteenByteRipe = QtGui.QCheckBox(
|
||||||
|
"Spend several minutes of extra computing time to"
|
||||||
|
" make the address(es) 1 or 2 characters shorter"
|
||||||
|
)
|
||||||
|
|
||||||
layout = QtGui.QGridLayout()
|
layout = QtGui.QGridLayout()
|
||||||
layout.addWidget(label, 0, 0)
|
layout.addWidget(label, 0, 0)
|
||||||
|
@ -100,7 +114,10 @@ class NewAddressWizardRandomPage(QtGui.QWizardPage):
|
||||||
layout.addWidget(self.checkBoxEighteenByteRipe, 6, 0)
|
layout.addWidget(self.checkBoxEighteenByteRipe, 6, 0)
|
||||||
self.setLayout(layout)
|
self.setLayout(layout)
|
||||||
|
|
||||||
QtCore.QObject.connect(self.radioButtonExisting, QtCore.SIGNAL("toggled(bool)"), self.comboBoxExisting.setEnabled)
|
QtCore.QObject.connect(
|
||||||
|
self.radioButtonExisting, QtCore.SIGNAL("toggled(bool)"),
|
||||||
|
self.comboBoxExisting.setEnabled
|
||||||
|
)
|
||||||
|
|
||||||
self.registerField("label", self.labelLineEdit)
|
self.registerField("label", self.labelLineEdit)
|
||||||
self.registerField("radioButtonMostAvailable", self.radioButtonMostAvailable)
|
self.registerField("radioButtonMostAvailable", self.radioButtonMostAvailable)
|
||||||
|
@ -126,7 +143,10 @@ class NewAddressWizardPassphrasePage(QtGui.QWizardPage):
|
||||||
passphraseLabel = QtGui.QLabel("Passphrase")
|
passphraseLabel = QtGui.QLabel("Passphrase")
|
||||||
self.lineEditPassphrase = QtGui.QLineEdit()
|
self.lineEditPassphrase = QtGui.QLineEdit()
|
||||||
self.lineEditPassphrase.setEchoMode(QtGui.QLineEdit.Password)
|
self.lineEditPassphrase.setEchoMode(QtGui.QLineEdit.Password)
|
||||||
self.lineEditPassphrase.setInputMethodHints(QtCore.Qt.ImhHiddenText|QtCore.Qt.ImhNoAutoUppercase|QtCore.Qt.ImhNoPredictiveText)
|
self.lineEditPassphrase.setInputMethodHints(
|
||||||
|
QtCore.Qt.ImhHiddenText | QtCore.Qt.ImhNoAutoUppercase
|
||||||
|
| QtCore.Qt.ImhNoPredictiveText
|
||||||
|
)
|
||||||
retypePassphraseLabel = QtGui.QLabel("Retype passphrase")
|
retypePassphraseLabel = QtGui.QLabel("Retype passphrase")
|
||||||
self.lineEditPassphraseAgain = QtGui.QLineEdit()
|
self.lineEditPassphraseAgain = QtGui.QLineEdit()
|
||||||
self.lineEditPassphraseAgain.setEchoMode(QtGui.QLineEdit.Password)
|
self.lineEditPassphraseAgain.setEchoMode(QtGui.QLineEdit.Password)
|
||||||
|
@ -163,9 +183,11 @@ class NewAddressWizardEmailProviderPage(QtGui.QWizardPage):
|
||||||
super(QtGui.QWizardPage, self).__init__()
|
super(QtGui.QWizardPage, self).__init__()
|
||||||
self.setTitle("Choose email provider")
|
self.setTitle("Choose email provider")
|
||||||
|
|
||||||
label = QtGui.QLabel("Currently only Mailchuck email gateway is available "
|
label = QtGui.QLabel(
|
||||||
"(@mailchuck.com email address). In the future, maybe other gateways will be available. "
|
"Currently only Mailchuck email gateway is available "
|
||||||
"Press Next.")
|
"(@mailchuck.com email address). In the future, maybe other gateways"
|
||||||
|
" will be available.Press Next."
|
||||||
|
)
|
||||||
label.setWordWrap(True)
|
label.setWordWrap(True)
|
||||||
|
|
||||||
# self.mailchuck = QtGui.QRadioButton("Mailchuck email gateway (@mailchuck.com)")
|
# self.mailchuck = QtGui.QRadioButton("Mailchuck email gateway (@mailchuck.com)")
|
||||||
|
@ -241,7 +263,7 @@ class NewAddressWizardWaitPage(QtGui.QWizardPage):
|
||||||
self.emit(QtCore.SIGNAL('completeChanged()'))
|
self.emit(QtCore.SIGNAL('completeChanged()'))
|
||||||
|
|
||||||
def isComplete(self):
|
def isComplete(self):
|
||||||
# print "val = " + str(self.progressBar.value())
|
# print "val = " + str(self.progressBar.value())
|
||||||
if self.progressBar.value() >= 50:
|
if self.progressBar.value() >= 50:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
@ -280,6 +302,7 @@ class NewAddressWizardConclusionPage(QtGui.QWizardPage):
|
||||||
layout.addWidget(label)
|
layout.addWidget(label)
|
||||||
self.setLayout(layout)
|
self.setLayout(layout)
|
||||||
|
|
||||||
|
|
||||||
class Ui_NewAddressWizard(QtGui.QWizard):
|
class Ui_NewAddressWizard(QtGui.QWizard):
|
||||||
def __init__(self, addresses):
|
def __init__(self, addresses):
|
||||||
super(QtGui.QWizard, self).__init__()
|
super(QtGui.QWizard, self).__init__()
|
||||||
|
@ -308,6 +331,7 @@ class Ui_NewAddressWizard(QtGui.QWizard):
|
||||||
self.adjustSize()
|
self.adjustSize()
|
||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
|
|
||||||
class NewAddressThread(QtCore.QThread):
|
class NewAddressThread(QtCore.QThread):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
QtCore.QThread.__init__(self)
|
QtCore.QThread.__init__(self)
|
||||||
|
@ -334,11 +358,12 @@ class NewAddressThread(QtCore.QThread):
|
||||||
def run(self):
|
def run(self):
|
||||||
import time
|
import time
|
||||||
for i in range(1, 101):
|
for i in range(1, 101):
|
||||||
time.sleep(0.1) # artificial time delay
|
time.sleep(0.1) # artificial time delay
|
||||||
self.emit(self.signal, i)
|
self.emit(self.signal, i)
|
||||||
self.emit(self.signal, 101)
|
self.emit(self.signal, 101)
|
||||||
# self.terminate()
|
# self.terminate()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
Reference in New Issue
Block a user