make showqrcode a static method

This commit is contained in:
ThomasV 2012-04-09 21:02:59 +02:00
parent 9304cfbdd5
commit 6329120847
1 changed files with 14 additions and 23 deletions

View File

@ -524,17 +524,7 @@ class ElectrumWindow(QMainWindow):
addr = unicode( i.text(0) )
return addr
def showqrcode(address):
if not address: return
d = QDialog(self)
d.setModal(1)
d.setMinimumSize(270, 300)
vbox = QVBoxLayout()
vbox.addWidget(QRCodeWidget(address))
vbox.addLayout(ok_cancel_buttons(d))
d.setLayout(vbox)
d.exec_()
qrButton = EnterButton("QR",lambda: showqrcode(get_addr(l)))
qrButton = EnterButton("QR",lambda: ElectrumWindow.showqrcode(get_addr(l)))
def copy2clipboard(addr):
self.app.clipboard().setText(addr)
@ -667,19 +657,20 @@ class ElectrumWindow(QMainWindow):
+ ' '.join(mnemonic.mn_encode(seed)) + "\""
QMessageBox.information(parent, 'Seed', msg, 'OK')
ElectrumWindow.showqrcode(seed)
def showqrcode(address):
if not address: return
d = QDialog(None)
d.setModal(1)
d.setMinimumSize(270, 300)
vbox = QVBoxLayout()
vbox.addWidget(QRCodeWidget(address))
vbox.addLayout(ok_cancel_buttons(d))
d.setLayout(vbox)
d.exec_()
showqrcode(seed)
@staticmethod
def showqrcode(address):
if not address: return
d = QDialog(None)
d.setModal(1)
d.setWindowTitle(address)
d.setMinimumSize(270, 300)
vbox = QVBoxLayout()
vbox.addWidget(QRCodeWidget(address))
vbox.addLayout(ok_cancel_buttons(d))
d.setLayout(vbox)
d.exec_()
def question(self, msg):
return QMessageBox.question(self, 'Message', msg, QMessageBox.Yes | QMessageBox.No, QMessageBox.No) == QMessageBox.Yes