@@ -769,7 +769,7 @@ def dialog_return(self, w, message):
769769 self .touchoff ('touchplate' )
770770 elif sensor_code and name == 'MESSAGE' and rtn is True :
771771 self .touchoff ('sensor' )
772- elif wait_code and name == 'MESSAGE' :
772+ elif wait_code and name == 'MESSAGE' and rtn is True :
773773 self .lowerSpindle ()
774774 elif unhome_code and name == 'MESSAGE' and rtn is True :
775775 ACTION .SET_MACHINE_UNHOMED (- 1 )
@@ -2089,14 +2089,14 @@ def external_mpg(self, count):
20892089
20902090 def dialog_ext_control (self , pin , value , answer ):
20912091 if value :
2092- # handler defined dialog?
2093- if not self ._dialog_message is None :
2094- name = self . _dialog_message . get ( 'NAME' )
2095- STATUS . emit ( 'dialog-update' ,{ 'NAME' : name , 'response' : answer })
2096- else :
2097- # tool change dialog?
2098- if self . w . toolDialog_ . isVisible ():
2099- STATUS . emit ( 'dialog-update' ,{ 'NAME' : 'TOOLCHANGE' , 'response' : answer })
2092+ # search the registered dialogs for a match
2093+ dlist = self .w . getRegisteredDialogList ()
2094+ for i in ( dlist ):
2095+ if i . isVisible ():
2096+ print ( 'Found dialog' , i . objectName ())
2097+ name = i . getIdName ()
2098+ STATUS . emit ( 'dialog-update' ,{ 'NAME' : name , 'response' : answer })
2099+ return
21002100
21012101 def log_version (self ):
21022102 if INFO .RIP_FLAG :
0 commit comments