@@ -813,7 +813,7 @@ def _print_body_header(self):
813
813
w_header , curses .color_pair (4 )
814
814
)
815
815
816
- def __displayBodyLine (self , lineNum , pad , station ):
816
+ def __displayBodyLine (self , lineNum , pad , station , return_line = False ):
817
817
col = curses .color_pair (5 )
818
818
sep_col = None
819
819
# logger.error('DE selection = {0},{1},{2},{3}'.format(
@@ -826,31 +826,33 @@ def __displayBodyLine(self, lineNum, pad, station):
826
826
# self.selections[0][0],
827
827
# self.selections[0][1],
828
828
# self.selections[0][2]))
829
- if station :
830
- if lineNum + self .startPos == self .selection and \
831
- self .selection == self .playing :
832
- col = curses .color_pair (9 )
833
- ''' initialize col_sep here to have separated cursor '''
834
- sep_col = curses .color_pair (5 )
835
- self .bodyWin .hline (lineNum , 0 , ' ' , self .bodyMaxX , col )
836
- elif lineNum + self .startPos == self .selection :
837
- col = curses .color_pair (6 )
838
- ''' initialize col_sep here to have separated cursor '''
839
- sep_col = curses .color_pair (5 )
840
- self .bodyWin .hline (lineNum , 0 , ' ' , self .bodyMaxX , col )
841
- elif lineNum + self .startPos == self .playing :
842
- col = curses .color_pair (4 )
843
- sep_col = curses .color_pair (5 )
844
- self .bodyWin .hline (lineNum , 0 , ' ' , self .bodyMaxX , col )
845
- else :
846
- ''' this is only for a browser service '''
847
- col = curses .color_pair (5 )
829
+ if not return_line :
830
+ if station :
831
+ if lineNum + self .startPos == self .selection and \
832
+ self .selection == self .playing :
833
+ col = curses .color_pair (9 )
834
+ ''' initialize col_sep here to have separated cursor '''
835
+ sep_col = curses .color_pair (5 )
836
+ self .bodyWin .hline (lineNum , 0 , ' ' , self .bodyMaxX , col )
837
+ elif lineNum + self .startPos == self .selection :
838
+ col = curses .color_pair (6 )
839
+ ''' initialize col_sep here to have separated cursor '''
840
+ sep_col = curses .color_pair (5 )
841
+ self .bodyWin .hline (lineNum , 0 , ' ' , self .bodyMaxX , col )
842
+ elif lineNum + self .startPos == self .playing :
843
+ col = curses .color_pair (4 )
844
+ sep_col = curses .color_pair (5 )
845
+ self .bodyWin .hline (lineNum , 0 , ' ' , self .bodyMaxX , col )
846
+ else :
847
+ ''' this is only for a browser service '''
848
+ col = curses .color_pair (5 )
848
849
849
850
## self.maxY, self.maxX = self.stdscr.getmaxyx()
850
851
## logger.error('DE ==== width = {}'.format(self.maxX - 2))
851
852
#if self.ws.operation_mode == self.ws.PLAYLIST_MODE or \
852
853
# self.ws.operation_mode == self.ws.PLAYLIST_LOAD_ERROR_MODE or \
853
854
# self.ws.operation_mode == self.ws.PLAYLIST_NOT_FOUND_ERROR_MODE:
855
+
854
856
if self .ws .window_mode == self .ws .PLAYLIST_MODE :
855
857
line = self ._format_playlist_line (lineNum , pad , station )
856
858
try :
@@ -864,18 +866,25 @@ def __displayBodyLine(self, lineNum, pad, station):
864
866
else :
865
867
played , line = self ._cnf .online_browser .format_empty_line (self .bodyMaxX )
866
868
else :
867
- line = self ._format_station_line ("{0}. {1}" .format (str (lineNum + self .startPos + 1 ).rjust (pad ), station [0 ]))
869
+ if station :
870
+ line = self ._format_station_line ("{0}. {1}" .format (str (lineNum + self .startPos + 1 ).rjust (pad ), station [0 ]))
871
+ else :
872
+ line = ' ' * (self .bodyMaxX - 2 )
873
+
874
+ if return_line :
875
+ ''' return empty line '''
876
+ return line
877
+
868
878
try :
869
879
self .bodyWin .addstr (lineNum , 0 , line , col )
870
880
except :
871
881
pass
872
882
873
- if station :
874
- if self ._cnf .browsing_station_service and sep_col :
875
- ticks = self ._cnf .online_browser .get_columns_separators (self .bodyMaxX , adjust_for_body = True )
876
- if ticks :
877
- for n in ticks :
878
- self .bodyWin .chgat (lineNum , n , 1 , sep_col )
883
+ if station and self ._cnf .browsing_station_service and sep_col :
884
+ ticks = self ._cnf .online_browser .get_columns_separators (self .bodyMaxX , adjust_for_body = True )
885
+ if ticks :
886
+ for n in ticks :
887
+ self .bodyWin .chgat (lineNum , n , 1 , sep_col )
879
888
880
889
def run (self ):
881
890
self ._register_signals_handlers ()
@@ -2997,7 +3006,8 @@ def _show_connect_to_server_message(self):
2997
3006
2998
3007
To be used with onlines services only
2999
3008
'''
3000
- txt = '''Connecting to service. Please wait...'''
3009
+ txt = '''Connecting to service.
3010
+ ____Please wait...'''
3001
3011
self ._show_help (txt , self .ws .NORMAL_MODE , caption = ' ' , prompt = ' ' , is_message = True )
3002
3012
3003
3013
def _open_playlist (self , a_url = None ):
@@ -6466,22 +6476,21 @@ def _find_renamed_selection(self, mode, search_path, search_file):
6466
6476
def _redisplay_stations_and_playlists (self ):
6467
6477
if self ._limited_height_mode :
6468
6478
return
6469
- self .bodyWin .erase ()
6470
6479
self .outerBodyWin .erase ()
6480
+ if self ._redisplay_list [- 1 ][0 ] == self .ws .BROWSER_SEARCH_MODE and \
6481
+ self ._redisplay_list [- 2 ][0 ] == self .ws .NORMAL_MODE :
6482
+ if logger .isEnabledFor (logging .DEBUG ):
6483
+ logger .debug ('---=== Not displaying stations (Radio Browser window follows) ===---' )
6484
+ self .outerBodyWin .refresh ()
6485
+ return
6486
+ self .bodyWin .erase ()
6471
6487
if self .maxY > 2 :
6472
6488
self .outerBodyWin .box ()
6473
6489
try :
6474
6490
self .bodyWin .move (1 , 1 )
6475
6491
self .bodyWin .move (0 , 0 )
6476
6492
except :
6477
6493
pass
6478
- if self ._redisplay_list [- 1 ][0 ] == self .ws .BROWSER_SEARCH_MODE and \
6479
- self ._redisplay_list [- 2 ][0 ] == self .ws .NORMAL_MODE :
6480
- if logger .isEnabledFor (logging .DEBUG ):
6481
- logger .debug ('---=== Not displaying stations (Radio Browser window follows) ===---' )
6482
- self .outerBodyWin .refresh ()
6483
- self .bodyWin .refresh ()
6484
- return
6485
6494
self ._print_body_header ()
6486
6495
pad = len (str (self .startPos + self .bodyMaxY ))
6487
6496
@@ -6493,17 +6502,25 @@ def _redisplay_stations_and_playlists(self):
6493
6502
self .__displayBodyLine (lineNum , pad , self .stations [i ])
6494
6503
else :
6495
6504
''' display browser empty lines (station=None) '''
6505
+ line = self .__displayBodyLine (0 , pad , None , return_line = True )
6496
6506
if self ._cnf .browsing_station_service :
6497
6507
for n in range (i + 1 , self .bodyMaxY + 1 ):
6498
- self .__displayBodyLine (lineNum , pad , None )
6508
+ try :
6509
+ self .bodyWin .addstr (lineNum , 0 , line , curses .color_pair (5 ))
6510
+ except :
6511
+ pass
6499
6512
lineNum += 1
6500
6513
break
6501
6514
else :
6502
6515
''' we have no stations to display '''
6503
6516
if self ._cnf .browsing_station_service :
6504
6517
''' we have to display emplty lines '''
6518
+ line = self .__displayBodyLine (0 , pad , None , return_line = True )
6505
6519
for n in range (0 , self .bodyMaxY + 1 ):
6506
- self .__displayBodyLine (n , pad , None )
6520
+ try :
6521
+ self .bodyWin .addstr (n , 0 , line , curses .color_pair (5 ))
6522
+ except :
6523
+ pass
6507
6524
6508
6525
if self ._cnf .browsing_station_service :
6509
6526
if self ._cnf .internal_header_height > 0 :
0 commit comments