From: <umg...@us...> - 2007-06-14 13:15:38
|
Revision: 418 http://svn.sourceforge.net/pybridge/?rev=418&view=rev Author: umgangee Date: 2007-06-14 06:15:37 -0700 (Thu, 14 Jun 2007) Log Message: ----------- Add more informative messages to the status bar of WindowBridgetable, when playing a game. Modified Paths: -------------- trunk/pybridge/pybridge/ui/window_bridgetable.py Modified: trunk/pybridge/pybridge/ui/window_bridgetable.py =================================================================== --- trunk/pybridge/pybridge/ui/window_bridgetable.py 2007-06-13 15:18:35 UTC (rev 417) +++ trunk/pybridge/pybridge/ui/window_bridgetable.py 2007-06-14 13:15:37 UTC (rev 418) @@ -394,14 +394,30 @@ """Sets the statusbar text to indicate which player is on turn.""" context = self.statusbar.get_context_id('turn') self.statusbar.pop(context) + try: turn = self.table.game.getTurn() - text = _("It is %s's turn") % str(turn) - self.statusbar.push(context, text) - except GameError: # Game not in progress - pass + if self.table.game.play: + declarer, dummy = self.table.game.play.declarer, self.table.game.play.dummy + if self.position and self.position == turn != dummy: + text = _("Play a card from your hand.") + elif self.position and self.position == declarer and turn == dummy: + text = _("Play a card from dummy's hand.") + else: + text = _("It is %s's turn to play a card.") % DIRECTION_SYMBOLS[turn] + else: # Bidding. + if self.position and self.position == turn: + text = _("Make a call from the bidding box.") + else: + text = _("It is %s's turn to make a call.") % DIRECTION_SYMBOLS[turn] + + except GameError: # Game not in progress. + text = _("Waiting for next game to start.") + + self.statusbar.push(context, text) + def setVulnerability(self): """Sets the vulnerability indicators.""" format = "<b>%s</b>" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |