MCPcopy Index your code
hub / github.com/Bitmessage/PyBitmessage / accept

Method accept

src/bitmessageqt/address_dialogs.py:117–159  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

115 self.show()
116
117 def accept(self):
118 self.hide()
119 # self.buttonBox.enabled = False
120 if self.radioButtonRandomAddress.isChecked():
121 if self.radioButtonMostAvailable.isChecked():
122 streamNumberForAddress = 1
123 else:
124 # User selected 'Use the same stream as an existing
125 # address.'
126 streamNumberForAddress = decodeAddress(
127 self.comboBoxExisting.currentText())[2]
128 queues.addressGeneratorQueue.put((
129 'createRandomAddress', 4, streamNumberForAddress,
130 str(self.newaddresslabel.text().toUtf8()), 1, "",
131 self.checkBoxEighteenByteRipe.isChecked()
132 ))
133 else:
134 if self.lineEditPassphrase.text() != \
135 self.lineEditPassphraseAgain.text():
136 QtGui.QMessageBox.about(
137 self, _translate("MainWindow", "Passphrase mismatch"),
138 _translate(
139 "MainWindow",
140 "The passphrase you entered twice doesn\'t"
141 " match. Try again.")
142 )
143 elif self.lineEditPassphrase.text() == "":
144 QtGui.QMessageBox.about(
145 self, _translate("MainWindow", "Choose a passphrase"),
146 _translate(
147 "MainWindow", "You really do need a passphrase.")
148 )
149 else:
150 # this will eventually have to be replaced by logic
151 # to determine the most available stream number.
152 streamNumberForAddress = 1
153 queues.addressGeneratorQueue.put((
154 'createDeterministicAddresses', 4, streamNumberForAddress,
155 "unused deterministic address",
156 self.spinBoxNumberOfAddressesToMake.value(),
157 self.lineEditPassphrase.text().toUtf8(),
158 self.checkBoxEighteenByteRipe.isChecked()
159 ))
160
161
162class NewSubscriptionDialog(AddressDataDialog, RetranslateMixin):

Callers 2

acceptMethod · 0.45
acceptMethod · 0.45

Calls 3

decodeAddressFunction · 0.90
_translateFunction · 0.90
putMethod · 0.80

Tested by

no test coverage detected