redefine do_send as a wrapper for send_tx
authorThomasV <thomasv@gitorious>
Sat, 13 Jul 2013 18:47:10 +0000 (20:47 +0200)
committerThomasV <thomasv@gitorious>
Sat, 13 Jul 2013 18:47:10 +0000 (20:47 +0200)
gui/gui_classic.py

index 834680d..e41ee8e 100644 (file)
@@ -873,8 +873,7 @@ class ElectrumWindow(QMainWindow):
         return lambda s, *args: s.do_protect(func, args)
 
 
-    @protected
-    def do_send(self, password):
+    def do_send(self):
 
         label = unicode( self.message_e.text() )
         r = unicode( self.payto_e.text() )
@@ -899,6 +898,17 @@ class ElectrumWindow(QMainWindow):
             QMessageBox.warning(self, _('Error'), _('Invalid Fee'), _('OK'))
             return
 
+        confirm_amount = self.config.get('confirm_amount', 100000000)
+        if amount >= confirm_amount:
+            if not self.question("send %s to %s?"%(self.format_amount(amount) + ' '+ self.base_unit(), to_address)):
+                return
+
+        self.send_tx(to_address, amount, fee, label)
+
+
+    @protected
+    def send_tx(self, to_address, amount, fee, label, password):
+
         try:
             tx = self.wallet.mktx( [(to_address, amount)], password, fee, account=self.current_account)
         except BaseException, e:
@@ -909,11 +919,6 @@ class ElectrumWindow(QMainWindow):
             QMessageBox.warning(self, _('Error'), _("This transaction requires a higher fee, or it will not be propagated by the network."), _('OK'))
             return
 
-        confirm_amount = self.config.get('confirm_amount', 100000000)
-        if amount >= confirm_amount:
-            if not self.question("send %s to %s?"%(self.format_amount(amount) + ' '+ self.base_unit(), to_address)):
-                return
-
         self.run_hook('send_tx', tx)
 
         if label: