17
# Translators: Error message displayed when 3D mode is not available due to no Python OpenGL libraries
17
18
openGLErrors.append(_('No Python OpenGL support'))
23
# Translators: Error message displayed when 3D mode is not available due to no Python GTKGLExt libraries
22
24
openGLErrors.append(_('No Python GTKGLExt support'))
24
26
display_mode = (gtk.gdkgl.MODE_RGB | gtk.gdkgl.MODE_DEPTH | gtk.gdkgl.MODE_DOUBLE)
30
32
glConfig = gtk.gdkgl.Config(mode = display_mode)
31
33
except gtk.gdkgl.NoMatches:
34
# Translators: Error message displayed when 3D mode is not available due to their 3D drivers not being able to provide a suitable display mode
32
35
openGLErrors.append(_('OpenGL libraries do not support required display mode'))
33
36
haveGLSupport = len(openGLErrors) == 0
248
251
# Make a model for navigation (move object, number, description)
249
252
model = gtk.ListStore(gobject.TYPE_PYOBJECT, int, str)
250
253
iter = model.append()
254
# Translators: Move History Combo: Go to the start of the game
251
255
model.set(iter, 0, None, 1, 0, 2, _('Game Start'))
252
256
self.moveModel = model
461
466
self.ui._updateViewButtons()
463
468
def endGame(self, game):
469
# Translators: Message displayed when a player wins. The %s is substituted with the winning player's name
470
format = _('%s wins')
464
472
# If game completed show this in the GUI
465
473
if game.result is glchess.game.RESULT_WHITE_WINS:
466
title = _('%s wins') % game.getWhite().getName()
474
title = format % game.getWhite().getName()
467
475
elif game.result is glchess.game.RESULT_BLACK_WINS:
468
title = _('%s wins') % game.getBlack().getName()
476
title = format % game.getBlack().getName()
478
# Translators: Message displayed when a game is drawn
470
479
title = _('Game is drawn')
473
482
if game.rule is glchess.game.RULE_CHECKMATE:
483
# Translators: Message displayed when the game ends due to a player being checkmated
474
484
description = _('Opponent is in check and cannot move (checkmate)')
475
485
elif game.rule is glchess.game.RULE_STALEMATE:
486
# Translators: Message displayed when the game terminates due to a stalemate
476
487
description = _('Opponent cannot move (stalemate)')
477
488
elif game.rule is glchess.game.RULE_FIFTY_MOVES:
489
# Translators: Message displayed when the game is drawn due to the fifty move rule
478
490
description = _('No piece has been taken or pawn moved in the last fifty moves')
479
491
elif game.rule is glchess.game.RULE_TIMEOUT:
492
# Translators: Message displayed when the game ends due to one player's clock stopping
480
493
description = _('Opponent has run out of time')
481
494
elif game.rule is glchess.game.RULE_THREE_FOLD_REPETITION:
495
# Translators: Message displayed when the game is drawn due to the three-fold-repitition rule
482
496
description = _('The same board state has occured three times (three fold repetition)')
483
497
elif game.rule is glchess.game.RULE_INSUFFICIENT_MATERIAL:
498
# Translators: Message displayed when the game is drawn due to the insufficient material rule
484
499
description = _('Neither player can cause checkmate (insufficient material)')
485
500
elif game.rule is glchess.game.RULE_RESIGN:
486
501
if game.result is glchess.game.RESULT_WHITE_WINS:
502
# Translators: Message displayed when the game ends due to the black player resigning
487
503
description = _('The black player has resigned')
488
504
elif game.result is glchess.game.RESULT_BLACK_WINS:
505
# Translators: Message displayed when the game ends due to the white player resigning
489
506
description = _('The white player has resigned')
492
509
elif game.rule is glchess.game.RULE_DEATH:
510
# Translators: Message displayed when the game ends due to a player dying
493
511
description = _('One of the players has died')
495
513
self.gameResult = (title, description)