Skip to content

Commit 44ac96f

Browse files
committed
qtdragon -find the currently visible dialog to send messages to
halui 'ok' or 'cancel' messages
1 parent d359903 commit 44ac96f

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

share/qtvcp/screens/qtdragon/qtdragon_handler.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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)
@@ -2090,14 +2090,14 @@ def external_mpg(self, count):
20902090

20912091
def dialog_ext_control(self, pin, value, answer):
20922092
if value:
2093-
# handler defined dialog?
2094-
if not self._dialog_message is None:
2095-
name = self._dialog_message.get('NAME')
2096-
STATUS.emit('dialog-update',{'NAME':name,'response':answer})
2097-
else:
2098-
# tool change dialog?
2099-
if self.w.toolDialog_.isVisible():
2100-
STATUS.emit('dialog-update',{'NAME':'TOOLCHANGE','response':answer})
2093+
# search the registered dialogs for a match
2094+
dlist = self.w.getRegisteredDialogList()
2095+
for i in (dlist):
2096+
if i.isVisible():
2097+
print('Found dialog',i.objectName())
2098+
name = i.getIdName()
2099+
STATUS.emit('dialog-update',{'NAME':name,'response':answer})
2100+
return
21012101

21022102
def log_version(self):
21032103
if INFO.RIP_FLAG:

0 commit comments

Comments
 (0)