mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-27 23:41:35 +00:00
export QR code to clipboard (fixes issue #318)
This commit is contained in:
parent
554d8dd3b7
commit
28a31b65ee
1 changed files with 12 additions and 2 deletions
|
@ -1581,11 +1581,21 @@ class ElectrumWindow(QMainWindow):
|
||||||
hbox = QHBoxLayout()
|
hbox = QHBoxLayout()
|
||||||
hbox.addStretch(1)
|
hbox.addStretch(1)
|
||||||
|
|
||||||
def print_qr(self):
|
filename = os.path.join(self.config.path, "qrcode.bmp")
|
||||||
filename = "qrcode.bmp"
|
|
||||||
|
def print_qr():
|
||||||
bmp.save_qrcode(qrw.qr, filename)
|
bmp.save_qrcode(qrw.qr, filename)
|
||||||
QMessageBox.information(None, _('Message'), _("QR code saved to file") + " " + filename, _('OK'))
|
QMessageBox.information(None, _('Message'), _("QR code saved to file") + " " + filename, _('OK'))
|
||||||
|
|
||||||
|
def copy_to_clipboard():
|
||||||
|
bmp.save_qrcode(qrw.qr, filename)
|
||||||
|
self.app.clipboard().setImage(QImage(filename))
|
||||||
|
QMessageBox.information(None, _('Message'), _("QR code saved to clipboard"), _('OK'))
|
||||||
|
|
||||||
|
b = QPushButton(_("Copy"))
|
||||||
|
hbox.addWidget(b)
|
||||||
|
b.clicked.connect(copy_to_clipboard)
|
||||||
|
|
||||||
b = QPushButton(_("Save"))
|
b = QPushButton(_("Save"))
|
||||||
hbox.addWidget(b)
|
hbox.addWidget(b)
|
||||||
b.clicked.connect(print_qr)
|
b.clicked.connect(print_qr)
|
||||||
|
|
Loading…
Add table
Reference in a new issue