From e9780645ffc171ebc5323efcc84d970a435c3e5c Mon Sep 17 00:00:00 2001 From: emkael Date: Fri, 28 Jun 2019 01:25:54 +0200 Subject: Match label contains phase name --- jfr_playoff/gui/frames/match.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'jfr_playoff/gui/frames') 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) -- cgit v1.2.3