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

Method accept

src/bitmessageqt/newchandialog.py:28–45  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

26 self.chanPassPhrase.validator().checkQueue()
27
28 def accept(self):
29 self.timer.stop()
30 self.hide()
31 apiAddressGeneratorReturnQueue.queue.clear()
32 if self.chanAddress.text().toUtf8() == "":
33 addressGeneratorQueue.put(('createChan', 4, 1, str_chan + ' ' + str(self.chanPassPhrase.text().toUtf8()), self.chanPassPhrase.text().toUtf8(), True))
34 else:
35 addressGeneratorQueue.put(('joinChan', addBMIfNotPresent(self.chanAddress.text().toUtf8()), str_chan + ' ' + str(self.chanPassPhrase.text().toUtf8()), self.chanPassPhrase.text().toUtf8(), True))
36 addressGeneratorReturnValue = apiAddressGeneratorReturnQueue.get(True)
37 if len(addressGeneratorReturnValue) > 0 and addressGeneratorReturnValue[0] != 'chan name does not match address':
38 UISignalQueue.put(('updateStatusBar', _translate("newchandialog", "Successfully created / joined chan %1").arg(unicode(self.chanPassPhrase.text()))))
39 self.parent.ui.tabWidget.setCurrentIndex(
40 self.parent.ui.tabWidget.indexOf(self.parent.ui.chans)
41 )
42 self.done(QtGui.QDialog.Accepted)
43 else:
44 UISignalQueue.put(('updateStatusBar', _translate("newchandialog", "Chan creation / joining failed")))
45 self.done(QtGui.QDialog.Rejected)
46
47 def reject(self):
48 self.timer.stop()

Callers 1

closeEventMethod · 0.45

Calls 7

addBMIfNotPresentFunction · 0.90
_translateFunction · 0.90
clearMethod · 0.80
putMethod · 0.80
argMethod · 0.80
stopMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected