adding fixes on closing tunnel

This commit is contained in:
Adolfo Gómez García 2021-07-03 13:02:34 +02:00
parent d7886a1281
commit b031e0aa3c

View File

@ -35,12 +35,14 @@ class UdsApplication(QtWidgets.QApplication):
def event(self, evnt: QtCore.QEvent) -> bool:
if evnt.type() == QtCore.QEvent.FileOpen:
# First, remove all finished tunnel processed from check queue
fe = typing.cast(QtGui.QFileOpenEvent, evnt)
logger.debug('Got url: %s', fe.url().url())
fe.accept()
logger.debug('Spawning %s', self.path)
subprocess.Popen([self.path, fe.url().url()])
# First, remove all finished tunnel processed from check queue
self.cleanTunnels()
# And now add a new one
self.tunnels.append(subprocess.Popen([self.path, fe.url().url()]))
return super().event(evnt)