1
0

new widget: QRTextEdit

This commit is contained in:
ThomasV
2014-06-14 12:17:44 +02:00
parent f5a76f7dcf
commit d2cad7bbbb
9 changed files with 125 additions and 54 deletions

View File

@@ -45,11 +45,6 @@ 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(lambda: self.win.pay_from_URI(self.scan_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):
b = QPushButton(_("Show QR code"))
@@ -59,6 +54,12 @@ class Plugin(BasePlugin):
def is_available(self):
return self._is_available
def scan_qr_hook(self, func):
data = self.scan_qr()
if type(data) != str:
return
func(data)
def scan_qr(self):
proc = zbar.Processor()
try:
@@ -84,7 +85,7 @@ class Plugin(BasePlugin):
def show_raw_qr(self, tx):
try:
json_text = json.dumps(tx.as_dict()).replace(' ', '')
self.win.show_qrcode(json_text, 'Unsigned Transaction')
self.win.show_qrcode(json_text, 'Transaction')
except Exception as e:
self.win.show_message(str(e))