diff options
author | emkael <emkael@tlen.pl> | 2020-01-14 01:41:25 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2020-01-14 01:41:25 +0100 |
commit | c3b141b01a54b9869f067bff4695d300446f8005 (patch) | |
tree | 7fd13ca22e5a0682e7855338078c3e8d5533e319 | |
parent | f90884a97abf9e2dabdfe90cb3704c551fedfbc9 (diff) |
Fixing team pre-selection in GUI
-rw-r--r-- | jfr_playoff/gui/frames/match.py | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/jfr_playoff/gui/frames/match.py b/jfr_playoff/gui/frames/match.py index 4b1f5a6..ad630d0 100644 --- a/jfr_playoff/gui/frames/match.py +++ b/jfr_playoff/gui/frames/match.py @@ -449,11 +449,10 @@ class BracketMatchSettingsFrame(GuiFrame): def getSelectedTeam(self): if self.selected.get(): - try: - return self.bracketWidgets[7].getValues().index( - self.selectedIndex.get()) - except ValueError: - return -1 + for idx, val in enumerate(self.bracketWidgets[7].getValues()): + if str(self.selectedIndex.get()) == str(val): + return idx - 1 + return -1 else: return -1 @@ -770,16 +769,6 @@ class MatchSettingsFrame(RepeatableFrame): return config - if 'selected_teams' in value \ - and isinstance(value['selected_teams'], list): - for idx, val in enumerate(value['selected_teams']): - if idx < 2: - self.bracketSettings[idx].setSelectedTeam(val) - else: - for idx in range(0, 2): - self.bracketSettings[idx].setSelectedTeam(-1) - - class MatchSeparator(RepeatableFrame): def renderContent(self): |