diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 1dad5247..6c38aaba 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -1581,11 +1581,21 @@ class ElectrumWindow(QMainWindow): hbox = QHBoxLayout() hbox.addStretch(1) - def print_qr(self): - filename = "qrcode.bmp" + filename = os.path.join(self.config.path, "qrcode.bmp") + + def print_qr(): bmp.save_qrcode(qrw.qr, filename) 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")) hbox.addWidget(b) b.clicked.connect(print_qr)