121
121
# Create model for game time
122
122
defaultTime = glchess.config.get('new_game_dialog/move_time')
123
# Translators: Time Combo: There is no time limit
123
124
times = [(_('Unlimited'), 0),
125
# Translators: Time Combo: Game will last one minute
124
126
(_('One minute'), 60),
127
# Translators: Time Combo: Game will last five minutes
125
128
(_('Five minutes'), 300),
129
# Translators: Time Combo: Game will last 30 minutes
126
130
(_('30 minutes'), 1800),
131
# Translators: Time Combo: Game will last one hour
127
132
(_('One hour'), 3600),
133
# Translators: Time Combo: User will configure game duration
128
134
(_('Custom'), -1)]
129
135
timeModel = gtk.ListStore(str, int)
130
136
activeIter = None
145
151
widget.add_attribute(cell, 'text', 0)
147
153
model = gtk.ListStore(str, int)
154
# Translators: Custom Time Combo: User specifying number of seconds for game duration
148
155
units = [(_('seconds'), 1),
156
# Translators: Custom Time Combo: User specifying number of minutes for game duration
149
157
(_('minutes'), 60),
158
# Translators: Custom Time Combo: User specifying number of hours for game duration
150
159
(_('hours'), 3600)]
151
160
for (name, multiplier) in units:
152
161
iter = model.append()
165
174
# Create the model for difficulty options
166
175
levelModel = gtk.ListStore(str, str, str)
176
# Translators: AI Difficulty Combo: AI set to easy difficulty
167
177
levels = [('easy', _('Easy'), 'weather-few-clouds'),
178
# Translators: AI Difficulty Combo: AI set to normal diffuculty
168
179
('normal', _('Normal'), 'weather-overcast'),
180
# Translators: AI Difficulty Combo: AI set to hard diffuculty
169
181
('hard', _('Hard'), 'weather-storm')]
170
182
for (key, label, icon) in levels:
171
183
iter = levelModel.append()
239
251
# Change title for loaded games
240
252
if g.path is not None:
253
# Translators: This is the title of the dialog when continuing a loaded game
241
254
self.window.set_title(_('Configure loaded game (%i moves)') % len(g.moves))
243
256
# Display warning if missing the AIs
305
318
whiteName = self.__getComboData(self.__gui.get_widget('white_type_combo'), 2)
306
319
blackName = self.__getComboData(self.__gui.get_widget('black_type_combo'), 2)
320
# Translators: Default name for a new game. %(white) and %(black) are substituted for the names of the white and black players.
307
321
format = _('%(white)s versus %(black)s')
308
322
self.__gui.get_widget('game_name_entry').set_text(format % {'white': whiteName, 'black': blackName})
327
341
# Get the players
328
342
game.white.type = self.__getComboData(self.__gui.get_widget('white_type_combo'), 0)
329
343
if game.white.type == '':
344
# Translators: Default name for the white player
330
345
game.white.name = _('White')
332
347
game.white.name = self.__getComboData(self.__gui.get_widget('white_type_combo'), 2)
333
348
game.white.level = self.__getComboData(self.__gui.get_widget('white_difficulty_combo'), 0)
334
349
game.black.type = self.__getComboData(self.__gui.get_widget('black_type_combo'), 0)
335
350
if game.black.type == '':
351
# Translators: Default name for the black player
336
352
game.black.name = _('Black')
338
354
game.black.name = self.__getComboData(self.__gui.get_widget('black_type_combo'), 2)
441
459
fileName = self.__gui.get_widget('filechooserwidget').get_filename()
442
460
if fileName is None:
461
# Translators: Message displayed in load game dialog when no file is selected
443
462
error = _('Please select a file to load')
445
464
error = self.__mainUI.feedback.loadGame(fileName, responseId == gtk.RESPONSE_YES)
447
466
if error is not None:
448
467
self.firstExpose = True
449
468
self.__gui.get_widget('error_box').show()
469
# Translators: Title of error box when unable to load game
450
470
self.__gui.get_widget('error_title_label').set_markup('<big><b>%s</b></big>' % _('Unabled to load game'))
451
471
self.__gui.get_widget('error_description_label').set_markup('<i>%s</i>' % error)
475
if self.__mainUI.loadGameDialog is self:
476
self.__mainUI.loadGameDialog = None
456
478
class GtkSaveGameDialog:
514
536
# Append .pgn to the end if not provided
515
537
fname = chooser.get_filename()
516
538
if fname is None:
539
# Translators: Save Game Dialog: Error displayed when no file name entered
517
540
self.__setError(_('Please enter a file name'), '')
519
542
if fname[-4:].lower() != '.pgn':
551
575
moveModel = gtk.ListStore(str, str)
552
576
widget = self.__gui.get_widget('move_format_combo')
553
577
widget.set_model(moveModel)
578
# Translators: Move Format Combo: Moves shown in human descriptive notation
554
579
move_formats = [('human', _('Human')),
580
# Translators: Move Format Combo: Moves shown in long algebraic notation (LAN)
555
581
('lan', _('Long Algebraic')),
582
# Translators: Move Format Combo: Moves shown in standard algebraic notation (SAN)
556
583
('san', _('Standard Algebraic'))]
557
584
for (key, label) in move_formats:
558
585
iter = moveModel.append()
559
586
moveModel.set(iter, 0, label, 1, key)
561
# Make modelfor board orientation
588
# Make model for board orientation
562
589
boardModel = gtk.ListStore(str, str)
563
590
widget = self.__gui.get_widget('board_combo')
564
591
widget.set_model(boardModel)
592
# Translators: Board Side Combo: Camera will face white player's side
565
593
view_list = [('white', _('White Side')),
594
# Translators: Board Side Combo: Camera will face black player's side
566
595
('black', _('Black Side')),
596
# Translators: Board Side Combo: Camera will face human player's side
567
597
('human', _('Human Side')),
598
# Translators: Board Side Combo: Camera will face current player's side
568
599
('current', _('Current Player'))]
569
600
for (key, label) in view_list:
570
601
iter = boardModel.append()
574
605
promotionModel = gtk.ListStore(str, str)
575
606
widget = self.__gui.get_widget('promotion_type_combo')
576
607
widget.set_model(promotionModel)
608
# Translators: Promotion Combo: Promote to a queen
577
609
promotion_list = [('queen', _('Queen')),
610
# Translators: Promotion Combo: Promote to a knight
578
611
('knight', _('Knight')),
612
# Translators: Promotion Combo: Promote to a rook
579
613
('rook', _('Rook')),
614
# Translators: Promotion Combo: Promote to a bishop
580
615
('bishop', _('Bishop'))]
581
616
for (key, label) in promotion_list:
582
617
iter = promotionModel.append()