commit 6d0488c2de4330a89e864b9fc070fa09a9e2badf
parent 272a09c71045103a6bb8dea9ddca54d845161c19
Author: ThomasV <thomasv@gitorious>
Date: Thu, 12 Jun 2014 22:24:10 +0200
move qr code operations to transaction window and transaction menu
Diffstat:
3 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py
@@ -341,6 +341,7 @@ class ElectrumWindow(QMainWindow):
raw_transaction_menu.addAction(_("&From file"), self.do_process_from_file)
raw_transaction_menu.addAction(_("&From text"), self.do_process_from_text)
raw_transaction_menu.addAction(_("&From the blockchain"), self.do_process_from_txid)
+ self.raw_transaction_menu = raw_transaction_menu
help_menu = menubar.addMenu(_("&Help"))
help_menu.addAction(_("&About"), self.show_about)
diff --git a/gui/qt/transaction_dialog.py b/gui/qt/transaction_dialog.py
@@ -34,6 +34,8 @@ from PyQt4.QtCore import *
import PyQt4.QtCore as QtCore
from electrum import transaction
+from electrum.plugins import run_hook
+
from util import MyTreeWidget
class TxDialog(QDialog):
@@ -93,6 +95,8 @@ class TxDialog(QDialog):
cancelButton.clicked.connect(lambda: self.done(0))
buttons.addWidget(cancelButton)
cancelButton.setDefault(True)
+
+ run_hook('init_transaction_dialog', self, buttons)
self.update()
diff --git a/plugins/qrscanner.py b/plugins/qrscanner.py
@@ -44,21 +44,21 @@ 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)
+
+ 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)
- b2 = QPushButton(_("Scan TxQR"))
- b2.clicked.connect(self.read_raw_qr)
-
- if not wallet.seed:
- b3 = QPushButton(_("Show unsigned TxQR"))
- b3.clicked.connect(self.show_raw_qr)
- self.send_tab_grid.addWidget(b3, 7, 1)
- self.send_tab_grid.addWidget(b2, 7, 2)
- else:
- self.send_tab_grid.addWidget(b2, 7, 1)
+ self.send_tab_grid.setColumnStretch(5, 0)
+ self.send_tab_grid.setColumnStretch(6, 1)
def is_available(self):
return self._is_available