summaryrefslogtreecommitdiff
path: root/jfr_playoff/gui/__init__.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-06-23 13:55:29 +0200
committeremkael <emkael@tlen.pl>2019-06-23 13:55:29 +0200
commitf4627ece00ed7959c3fb4d2aa601366fb85ec7c1 (patch)
tree9748eca74e8a7c9bd2307e8e7fadc8e76865e92c /jfr_playoff/gui/__init__.py
parent5d9ccd1ddee2aa4b9e651b68d20dabbc5fba3c4c (diff)
Protocol for resetting tab data on "new" command
Diffstat (limited to 'jfr_playoff/gui/__init__.py')
-rw-r--r--jfr_playoff/gui/__init__.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/jfr_playoff/gui/__init__.py b/jfr_playoff/gui/__init__.py
index ffd9d00..4b1441b 100644
--- a/jfr_playoff/gui/__init__.py
+++ b/jfr_playoff/gui/__init__.py
@@ -10,6 +10,7 @@ class PlayoffGUI(tk.Tk):
ttk.Style().configure('TLabelframe', padding=5)
self.geometry('920x640')
self.tabs = {}
+ self.newFileIndex = 0
def run(self):
self.notebook = ttk.Notebook(self)
@@ -17,8 +18,21 @@ class PlayoffGUI(tk.Tk):
for tab in tabs.__all__:
self.tabs[tab] = globals()[tab](self.notebook)
self.notebook.add(self.tabs[tab], text=self.tabs[tab].title)
+ self.newFile()
self.mainloop()
+ def _setValues(self, config):
+ for tab in self.tabs.values():
+ tab.setValues(config)
+
+ def _resetValues(self):
+ self._setValues({})
+
+ def newFile(self):
+ self.newFileIndex += 1
+ self.title('Nowa drabinka %d' % (self.newFileIndex))
+ self._resetValues()
+
def getDbConfig(self):
return self.tabs['NetworkTab'].getDB()