@@ -6089,6 +6089,21 @@ def _show_remote_control_server_active(self):
6089
6089
is_message = True
6090
6090
)
6091
6091
6092
+ def _reload_playlist_after_confirmation (self , char = 121 ):
6093
+ if char in (ord ('y' ), ord ('Y' )):
6094
+ if not self ._cnf .locked and char == ord ('Y' ):
6095
+ self ._cnf .confirm_playlist_reload = False
6096
+ self .reloadCurrentPlaylist (self .ws .PLAYLIST_DIRTY_RELOAD_CONFIRM_MODE )
6097
+ self .ws .close_window ()
6098
+ self .refreshBody ()
6099
+ else :
6100
+ ''' close confirmation message '''
6101
+ self .stations = self ._cnf .stations
6102
+ if logger .isEnabledFor (logging .DEBUG ):
6103
+ logger .debug ('Canceling Playlist Reload' )
6104
+ self .ws .close_window ()
6105
+ self .refreshBody ()
6106
+
6092
6107
def _remove_station (self , char = 121 ):
6093
6108
''' removes a station
6094
6109
char=121 is ord('y')
@@ -7879,19 +7894,7 @@ def keypress(self, char):
7879
7894
if char in self ._global_functions .keys ():
7880
7895
self ._global_functions [char ]()
7881
7896
return
7882
- if char in (ord ('y' ), ord ('Y' )):
7883
- if not self ._cnf .locked and char == ord ('Y' ):
7884
- self ._cnf .confirm_playlist_reload = False
7885
- self .reloadCurrentPlaylist (self .ws .PLAYLIST_DIRTY_RELOAD_CONFIRM_MODE )
7886
- self .ws .close_window ()
7887
- self .refreshBody ()
7888
- else :
7889
- ''' close confirmation message '''
7890
- self .stations = self ._cnf .stations
7891
- if logger .isEnabledFor (logging .DEBUG ):
7892
- logger .debug ('Canceling Playlist Reload' )
7893
- self .ws .close_window ()
7894
- self .refreshBody ()
7897
+ self ._reload_playlist_after_confirmation (char )
7895
7898
return
7896
7899
7897
7900
elif self .ws .operation_mode == self .ws .REMOVE_STATION_MODE :
@@ -8394,13 +8397,13 @@ def keypress(self, char):
8394
8397
self ._print_playlist_dirty_reload_confirmation ()
8395
8398
else :
8396
8399
self .ws .operation_mode = self .ws .PLAYLIST_RELOAD_CONFIRM_MODE
8397
- curses . ungetch ( 'y' )
8400
+ self . _reload_playlist_after_confirmation ( char )
8398
8401
else :
8399
8402
if not self ._cnf .is_register and self ._cnf .confirm_playlist_reload :
8400
8403
self ._print_playlist_reload_confirmation ()
8401
8404
else :
8402
8405
self .ws .operation_mode = self .ws .PLAYLIST_RELOAD_CONFIRM_MODE
8403
- curses . ungetch ( 'y' )
8406
+ self . _reload_playlist_after_confirmation ( char )
8404
8407
return
8405
8408
8406
8409
elif char in (ord ('z' ), ):
0 commit comments