From 5c20075b735bf694ad1c43a51ead1c1cced4df09 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" Date: Sun, 26 May 2019 17:06:40 +0200 Subject: [PATCH] Fixed a bug in closing the app with the X button and selecting No on the question --- nw/gui/statusbar.py | 2 -- nw/gui/winmain.py | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/nw/gui/statusbar.py b/nw/gui/statusbar.py index 4cc437cc..484e9519 100644 --- a/nw/gui/statusbar.py +++ b/nw/gui/statusbar.py @@ -144,7 +144,6 @@ class GuiMainStatus(QStatusBar): ## def _updateTime(self): - sTime = time() if self.refTime is None: theTime = "00:00:00" else: @@ -156,7 +155,6 @@ class GuiMainStatus(QStatusBar): tS = tS - tM*60 - tH*3600 theTime = "%02d:%02d:%02d" % (tH,tM,tS) self.boxTime.setText(theTime) - print((time()-sTime)*1e6) return # END Class GuiMainStatus diff --git a/nw/gui/winmain.py b/nw/gui/winmain.py index 46948ae1..0de1c27f 100644 --- a/nw/gui/winmain.py +++ b/nw/gui/winmain.py @@ -548,7 +548,10 @@ class GuiMain(QMainWindow): return def closeEvent(self, theEvent): - self.closeMain() + if self.closeMain(): + theEvent.accept() + else: + theEvent.ignore() return ##