summaryrefslogtreecommitdiff
path: root/jfr_playoff/gui
diff options
context:
space:
mode:
Diffstat (limited to 'jfr_playoff/gui')
-rw-r--r--jfr_playoff/gui/__init__.py14
-rw-r--r--jfr_playoff/gui/tabs.py7
2 files changed, 21 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()
diff --git a/jfr_playoff/gui/tabs.py b/jfr_playoff/gui/tabs.py
index 9d41f91..1eaa074 100644
--- a/jfr_playoff/gui/tabs.py
+++ b/jfr_playoff/gui/tabs.py
@@ -21,15 +21,22 @@ class PlayoffTab(ttk.Frame):
ttk.Frame.__init__(self, master)
self.frame = ttk.Frame(self)
self.frame.pack(fill=tk.BOTH, expand=True, padx=5, pady=5)
+ self.initData()
self.renderContent(self.frame)
@property
def title(self):
pass
+ def initData(self):
+ pass
+
def renderContent(self, container):
pass
+ def setValues(self, config):
+ pass
+
class MainSettingsTab(PlayoffTab):
@property
def title(self):