From 28a31b65ee83dccf1c5f169a11c194e956d541d9 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 18 Oct 2013 12:32:00 +0200 Subject: [PATCH] export QR code to clipboard (fixes issue #318) --- gui/qt/main_window.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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)