From 58765476717bc16d96db3c46c47854de36d09b26 Mon Sep 17 00:00:00 2001 From: bma Date: Thu, 15 Jun 2017 16:46:37 +0200 Subject: [PATCH] datalogger-gui: stop properly when close with X button --- datalogger-gui.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/datalogger-gui.py b/datalogger-gui.py index 8baae2c..dd8c1ba 100755 --- a/datalogger-gui.py +++ b/datalogger-gui.py @@ -131,8 +131,16 @@ class mainGui(): def runApp(self): self.w.show() + self.a.aboutToQuit.connect(self.closeEvent) sys.exit(self.a.exec_()) + def closeEvent(self): + try: + self.stopLog() + except: + pass + print('Done') + @pyqtSlot() def updateSignal(self): for i in reversed(range(5, self.layout.count())): -- 2.16.4