From 8685d749a3b7329ca318aa1ce1d2c9c440b26853 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Thu, 12 Jun 2014 22:32:24 +0200 Subject: [PATCH] qrscanner: add scan button in init() --- plugins/qrscanner.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/plugins/qrscanner.py b/plugins/qrscanner.py index c9094cf5..a7e41f8b 100644 --- a/plugins/qrscanner.py +++ b/plugins/qrscanner.py @@ -45,27 +45,20 @@ class Plugin(BasePlugin): def init(self): self.win = self.gui.main_window self.win.raw_transaction_menu.addAction(_("&From QR code"), self.read_raw_qr) + b = QPushButton(_("Scan QR code")) + b.clicked.connect(self.fill_from_qr) + self.win.send_grid.addWidget(b, 1, 5) + self.win.send_grid.setColumnStretch(5, 0) + self.win.send_grid.setColumnStretch(6, 1) def init_transaction_dialog(self, dialog, buttons): - print dialog, buttons - #if not wallet.seed: b = QPushButton(_("Show QR code")) b.clicked.connect(self.show_raw_qr) buttons.insertWidget(1,b) - def load_wallet(self, wallet): - b = QPushButton(_("Scan QR code")) - b.clicked.connect(self.fill_from_qr) - self.send_tab_grid.addWidget(b, 1, 5) - self.send_tab_grid.setColumnStretch(5, 0) - self.send_tab_grid.setColumnStretch(6, 1) - def is_available(self): return self._is_available - def create_send_tab(self, grid): - self.send_tab_grid = grid - def scan_qr(self): proc = zbar.Processor() try: