|
205 | 205 | ['&Book', ['Set Book::book_set_k']], |
206 | 206 | ['&User', ['Set Name::user_name_k']], |
207 | 207 | ['Tools', ['PGN', ['Delete Player::delete_player_k']]], |
| 208 | + ['&Settings', ['Game::settings_game_k']], |
208 | 209 | ['&Help', ['About']], |
209 | 210 | ] |
210 | 211 |
|
@@ -678,7 +679,7 @@ def __init__(self, theme, engine_config_file, user_config_file, |
678 | 679 |
|
679 | 680 | self.gui_theme = 'Reddit' |
680 | 681 |
|
681 | | - self.is_save_time_left = True |
| 682 | + self.is_save_time_left = False |
682 | 683 | self.is_save_user_comment = True |
683 | 684 |
|
684 | 685 | def update_game(self, mc, user_move, time_left, user_comment): |
@@ -3373,6 +3374,34 @@ def main_loop(self): |
3373 | 3374 | w.Close() |
3374 | 3375 | continue |
3375 | 3376 |
|
| 3377 | + # Mode: Neutral, Settings menu |
| 3378 | + if button == 'Game::settings_game_k': |
| 3379 | + win_title = 'Settings/Game' |
| 3380 | + layout = [ |
| 3381 | + [sg.CBox('Save time left in game notation', |
| 3382 | + key='save_time_left_k', |
| 3383 | + default=self.is_save_time_left, |
| 3384 | + tooltip='[%clk h:mm:ss] will appear as\n' + |
| 3385 | + 'move comment and is shown in move\n' + |
| 3386 | + 'list and saved in pgn file.')], |
| 3387 | + [sg.OK(), sg.Cancel()], |
| 3388 | + ] |
| 3389 | + |
| 3390 | + w = sg.Window(win_title, layout, icon='Icon/pecg.ico') |
| 3391 | + window.Disable() |
| 3392 | + |
| 3393 | + while True: |
| 3394 | + e, v = w.Read(timeout=10) |
| 3395 | + if e is None or e == 'Cancel': |
| 3396 | + break |
| 3397 | + if e == 'OK': |
| 3398 | + self.is_save_time_left = v['save_time_left_k'] |
| 3399 | + break |
| 3400 | + |
| 3401 | + window.Enable() |
| 3402 | + w.Close() |
| 3403 | + continue |
| 3404 | + |
3376 | 3405 | # Mode: Neutral, Change theme |
3377 | 3406 | if button in GUI_THEME: |
3378 | 3407 | self.gui_theme = button |
|
0 commit comments