diff options
author | emkael <emkael@tlen.pl> | 2019-06-28 01:25:54 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2019-06-28 01:25:54 +0200 |
commit | e9780645ffc171ebc5323efcc84d970a435c3e5c (patch) | |
tree | fd9b2dcf076c71526621979e1b7f87287a9c1460 /jfr_playoff/gui/frames/match.py | |
parent | 903ace218bbc5a16a4f42479024d1702bf54e29f (diff) |
Match label contains phase name
Diffstat (limited to 'jfr_playoff/gui/frames/match.py')
-rw-r--r-- | jfr_playoff/gui/frames/match.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/jfr_playoff/gui/frames/match.py b/jfr_playoff/gui/frames/match.py index 01cb742..b44bfe0 100644 --- a/jfr_playoff/gui/frames/match.py +++ b/jfr_playoff/gui/frames/match.py @@ -568,9 +568,20 @@ class MatchSettingsFrame(RepeatableFrame): def getMatchID(self): return self.matchID.get() + def _getPhase(self): + obj = self + while not isinstance(obj, MatchPhaseFrame): + obj = obj.master + if obj is None: + break + return obj + @property def label(self): - return 'Mecz nr %d' % (self.getMatchID()) + phase = self._getPhase() + return 'Mecz #%d (%s)' % ( + self.getMatchID(), + phase.master.tab(phase)['text'] if phase is not None else '') def setValue(self, value): self.matchID.set(value['id'] if 'id' in value else 0) |