From: <umg...@us...> - 2007-06-20 15:13:24
|
Revision: 431 http://svn.sourceforge.net/pybridge/?rev=431&view=rev Author: umgangee Date: 2007-06-20 08:13:03 -0700 (Wed, 20 Jun 2007) Log Message: ----------- Add "click to start next game" message to game result dialog, fix "show no buttons when bidding passed out" bug. 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-20 15:10:30 UTC (rev 430) +++ trunk/pybridge/pybridge/ui/window_bridgetable.py 2007-06-20 15:13:03 UTC (rev 431) @@ -267,8 +267,7 @@ self.setTurnIndicator() - dialog = gtk.MessageDialog(parent=self.window, flags=gtk.DIALOG_MODAL, - type=gtk.MESSAGE_INFO) + dialog = gtk.MessageDialog(parent=self.window, type=gtk.MESSAGE_INFO) dialog.set_title(_('Game result')) # Determine and display score in dialog box. @@ -281,26 +280,24 @@ contractText = self.formatContract(self.table.game.contract) if offset > 0: - dialog.set_markup(_('Contract %s made by %s tricks.') \ - % (contractText, offset)) + resultText = _('Contract %s made by %s tricks.') % (contractText, offset) elif offset < 0: - dialog.set_markup(_('Contract %s failed by %s tricks.') \ - % (contractText, abs(offset))) + resultText = _('Contract %s failed by %s tricks.') % (contractText, abs(offset)) else: - dialog.set_markup(_('Contract %s made exactly.') % contractText) - + resultText = _('Contract %s made exactly.') % contractText scorer = (score >= 0 and _('declarer')) or _('defence') - dialog.format_secondary_text(_('Score %s points for %s.' % (abs(score), scorer))) + scoreText = _('Score %s points for %s.' % (abs(score), scorer)) + dialog.set_markup(resultText + '\n' + scoreText) - if self.player: - dialog.add_button(_('Leave Seat'), gtk.RESPONSE_CANCEL) - dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK) - - else: dialog.set_markup(_('Bidding passed out.')) dialog.format_secondary_text(_('No score.')) + if self.player: + dialog.add_button(_('Leave Seat'), gtk.RESPONSE_CANCEL) + dialog.format_secondary_text(_('Click OK to start next game.')) + dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK) + def dialog_response_cb(dialog, response_id): dialog.destroy() if self.player: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |