summaryrefslogtreecommitdiff
path: root/jfr_playoff/gui
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-06-27 14:07:48 +0200
committeremkael <emkael@tlen.pl>2019-06-27 14:07:48 +0200
commit106133121d017c1788cde11c2d419b74e5465979 (patch)
treefe48a02954f5fca951c910d3a6498d7bed0ff6f9 /jfr_playoff/gui
parent7354a92ecb7c69537c4e1904ec463a2b216be162 (diff)
Code refactoring and cleanup
Diffstat (limited to 'jfr_playoff/gui')
-rw-r--r--jfr_playoff/gui/tabs.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/jfr_playoff/gui/tabs.py b/jfr_playoff/gui/tabs.py
index 4c60d3a..d5eab9b 100644
--- a/jfr_playoff/gui/tabs.py
+++ b/jfr_playoff/gui/tabs.py
@@ -50,6 +50,7 @@ class MainSettingsTab(PlayoffTab):
self.pageTitle = tk.StringVar()
self.pageLogoh = tk.StringVar()
self.refresh = tk.IntVar()
+ self.refresh.trace('w', self._updateRefreshFields)
self.refreshInterval = tk.StringVar()
def _chooseOutputPath(self):
@@ -63,22 +64,17 @@ class MainSettingsTab(PlayoffTab):
filename = filename + '.html'
self.outputPath.set(filename)
- def _updateRefreshFields(self):
+ def _updateRefreshFields(self, *args):
self.intervalField.configure(
state=tk.NORMAL if self.refresh.get() else tk.DISABLED)
def setValues(self, config):
- if 'output' in config:
- self.outputPath.set(config['output'])
- else:
- self.outputPath.set('')
+ self.outputPath.set(config['output'] if 'output' in config else '')
if 'page' in config:
- self.pageTitle.set(config['page']['title']
- if 'title' in config['page']
- else '')
- self.pageLogoh.set(config['page']['logoh']
- if 'logoh' in config['page']
- else '')
+ self.pageTitle.set(
+ config['page']['title'] if 'title' in config['page'] else '')
+ self.pageLogoh.set(
+ config['page']['logoh'] if 'logoh' in config['page'] else '')
try:
interval = int(config['page']['refresh'])
if interval > 0:
@@ -95,7 +91,6 @@ class MainSettingsTab(PlayoffTab):
self.pageLogoh.set('')
self.refresh.set(0)
self.refreshInterval.set(self.DEFAULT_INTERVAL)
- self._updateRefreshFields()
def renderContent(self, container):
(ttk.Label(container, text='Plik wynikowy:')).grid(