@@ -2572,7 +2572,8 @@ def select_review_game(self, pgn_file=None, games=None):
25722572 except (FileNotFoundError , OSError , UnicodeError ) as exc :
25732573 logging .exception (
25742574 f'Failed to load pgn games from { selected_pgn } : { exc } ' )
2575- w ['status_k' ].Update ('Status: Failed to read PGN file.' )
2575+ w ['status_k' ].Update (
2576+ 'Status: Failed to read PGN file. Check the file path and encoding.' )
25762577 selected_games = []
25772578 w ['game_k' ].Update ([])
25782579 continue
@@ -2656,7 +2657,7 @@ def update_review_window(self, window):
26562657 game_number = (
26572658 self .review_game_index + 1
26582659 if self .review_game_index is not None
2659- else 1
2660+ else '?'
26602661 )
26612662 window ['_gamestatus_' ].Update (
26622663 f'Mode Review, game { game_number } /{ len (self .review_games )} ' )
@@ -2751,7 +2752,8 @@ def start_review_mode(self, window):
27512752 continue
27522753
27532754 if button == 'Load PGN::review_load_pgn_k' :
2754- selected_game = self .select_review_game (self .review_pgn_file )
2755+ selected_game = self .select_review_game (
2756+ self .review_pgn_file , self .review_games )
27552757 if selected_game is None :
27562758 continue
27572759
@@ -2794,10 +2796,9 @@ def start_review_mode(self, window):
27942796 self .review_move_index = len (self .review_boards ) - 1
27952797 elif button == 'review_move_list_k' :
27962798 try :
2797- selected_move = value ['review_move_list_k' ][0 ]
2798- self .review_move_index = self .review_move_labels .index (
2799- selected_move )
2800- except (IndexError , ValueError ):
2799+ selected_index = review_window ['review_move_list_k' ].Widget .curselection ()[0 ]
2800+ self .review_move_index = selected_index
2801+ except (IndexError , AttributeError ):
28012802 self .update_review_window (review_window )
28022803 continue
28032804
0 commit comments