@ -1203,10 +1203,12 @@ class ElectrumWindow(QMainWindow):
@protected
@protected
def sign_tx ( self , tx , callback , password ) :
def sign_tx ( self , tx , callback , password , parent = None ) :
''' Sign the transaction in a separate thread. When done, calls
''' Sign the transaction in a separate thread. When done, calls
the callback with a success code of True or False .
the callback with a success code of True or False .
'''
'''
if parent == None :
parent = self
self . send_button . setDisabled ( True )
self . send_button . setDisabled ( True )
# call hook to see if plugin needs gui interaction
# call hook to see if plugin needs gui interaction
@ -1224,11 +1226,11 @@ class ElectrumWindow(QMainWindow):
callback ( success [ 0 ] )
callback ( success [ 0 ] )
# keep a reference to WaitingDialog or the gui might crash
# keep a reference to WaitingDialog or the gui might crash
self . waiting_dialog = WaitingDialog ( self , ' Signing transaction... ' , sign_thread , on_sign_successful , on_dialog_close )
self . waiting_dialog = WaitingDialog ( parent , ' Signing transaction... ' , sign_thread , on_sign_successful , on_dialog_close )
self . waiting_dialog . start ( )
self . waiting_dialog . start ( )
def broadcast_transaction ( self , tx , tx_desc ) :
def broadcast_transaction ( self , tx , tx_desc , parent = None ) :
def broadcast_thread ( ) :
def broadcast_thread ( ) :
# non-GUI thread
# non-GUI thread
@ -1255,14 +1257,16 @@ class ElectrumWindow(QMainWindow):
if status :
if status :
if tx_desc is not None and tx . is_complete ( ) :
if tx_desc is not None and tx . is_complete ( ) :
self . wallet . set_label ( tx . hash ( ) , tx_desc )
self . wallet . set_label ( tx . hash ( ) , tx_desc )
QMessageBox . information ( self , ' ' , _ ( ' Payment sent. ' ) + ' \n ' + msg , _ ( ' OK ' ) )
QMessageBox . information ( parent , ' ' , _ ( ' Payment sent. ' ) + ' \n ' + msg , _ ( ' OK ' ) )
self . update_invoices_list ( )
self . update_invoices_list ( )
self . do_clear ( )
self . do_clear ( )
else :
else :
QMessageBox . warning ( self , _ ( ' Error ' ) , msg , _ ( ' OK ' ) )
QMessageBox . warning ( parent , _ ( ' Error ' ) , msg , _ ( ' OK ' ) )
self . send_button . setDisabled ( False )
self . send_button . setDisabled ( False )
self . waiting_dialog = WaitingDialog ( self , ' Broadcasting transaction... ' , broadcast_thread , broadcast_done )
if parent == None :
parent = self
self . waiting_dialog = WaitingDialog ( parent , ' Broadcasting transaction... ' , broadcast_thread , broadcast_done )
self . waiting_dialog . start ( )
self . waiting_dialog . start ( )