summaryrefslogtreecommitdiff
path: root/jfr_playoff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-07-30 12:18:23 +0200
committeremkael <emkael@tlen.pl>2019-07-30 12:18:45 +0200
commitb67eef0f06be286de6ef3732e8f85801bf440dd0 (patch)
tree2d9a33ef718def1befb12041eaddf2405efdc238 /jfr_playoff
parentd3963540184beeca0d8193b530a1588be9c9f55d (diff)
Checking for dirty bracket save on exit
Diffstat (limited to 'jfr_playoff')
-rw-r--r--jfr_playoff/gui/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/jfr_playoff/gui/__init__.py b/jfr_playoff/gui/__init__.py
index 086b3ab..56ed1cb 100644
--- a/jfr_playoff/gui/__init__.py
+++ b/jfr_playoff/gui/__init__.py
@@ -39,6 +39,7 @@ class PlayoffGUI(tk.Tk):
self._dirty.trace('w', self._setMenuButtons)
self._runTimer = None
self._filepath = None
+ self.protocol('WM_DELETE_WINDOW', self.onClose)
def run(self):
self.notebook = ttk.Notebook(self)
@@ -160,6 +161,10 @@ class PlayoffGUI(tk.Tk):
filename = filename + '.jtpo'
self.saveFile(filename)
+ def onClose(self, *args):
+ self._checkSave()
+ self.destroy()
+
def _run(self, config, interactive=True):
self._interactive = interactive
try: