@@ -456,6 +456,7 @@ def __del__(self):
456
456
self .transientWin = None
457
457
458
458
def setup (self , stdscr ):
459
+ # curses.savetty()
459
460
self .setup_return_status = True
460
461
if not curses .has_colors ():
461
462
self .setup_return_status = False
@@ -499,7 +500,6 @@ def setup(self, stdscr):
499
500
self .playbackTimeoutCounter ,
500
501
self .connectionFailed ,
501
502
self ._show_station_info_from_thread )
502
- logger .error ('DE \n \n NEW_PROFILE_STRING = {}\n \n ' .format (self .player .NEW_PROFILE_STRING ))
503
503
except :
504
504
''' no player '''
505
505
self .ws .operation_mode = self .ws .NO_PLAYER_ERROR_MODE
@@ -593,7 +593,7 @@ def setupAndDrawScreen(self, init_from_setup=False):
593
593
self .bodyWinEndY = self .maxY - 1
594
594
if logger .isEnabledFor (logging .DEBUG ):
595
595
logger .debug ('body starts at line {0}, ends at line {1}' .format (self .bodyWinStartY , self .bodyWinEndY ))
596
- self .bodyWin = curses . newwin (
596
+ self .bodyWin = self . outerBodyWin . subwin (
597
597
self .maxY - 4 - self ._cnf .internal_header_height ,
598
598
self .maxX - 2 ,
599
599
self .bodyWinStartY ,
@@ -615,6 +615,7 @@ def setupAndDrawScreen(self, init_from_setup=False):
615
615
''' for light color scheme '''
616
616
# TODO
617
617
self .outerBodyWin .bkgdset (' ' , curses .color_pair (5 ))
618
+ self .outerBodyWin .erase ()
618
619
self .bodyWin .bkgdset (' ' , curses .color_pair (5 ))
619
620
self .initBody ()
620
621
@@ -880,11 +881,11 @@ def __displayBodyLine(self, lineNum, pad, station, return_line=False):
880
881
except :
881
882
pass
882
883
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 )
884
+ if station and self ._cnf .browsing_station_service and sep_col :
885
+ ticks = self ._cnf .online_browser .get_columns_separators (self .bodyMaxX , adjust_for_body = True )
886
+ if ticks :
887
+ for n in ticks :
888
+ self .bodyWin .chgat (lineNum , n , 1 , sep_col )
888
889
889
890
def run (self ):
890
891
self ._register_signals_handlers ()
@@ -5883,6 +5884,8 @@ def keypress(self, char):
5883
5884
self ._cnf .jump_tag = - 1
5884
5885
self ._update_status_bar_right (status_suffix = '' )
5885
5886
if self ._cnf .browsing_station_service :
5887
+ self ._print_not_implemented_yet ()
5888
+ return
5886
5889
self .ws .operation_mode = self .ws .BROWSER_SEARCH_MODE
5887
5890
self ._browser_init_search (parent = self .outerBodyWin )
5888
5891
else :
@@ -6476,51 +6479,103 @@ def _find_renamed_selection(self, mode, search_path, search_file):
6476
6479
def _redisplay_stations_and_playlists (self ):
6477
6480
if self ._limited_height_mode :
6478
6481
return
6479
- self .outerBodyWin .erase ()
6480
6482
if self ._redisplay_list [- 1 ][0 ] == self .ws .BROWSER_SEARCH_MODE and \
6481
6483
self ._redisplay_list [- 2 ][0 ] == self .ws .NORMAL_MODE :
6482
6484
if logger .isEnabledFor (logging .DEBUG ):
6483
6485
logger .debug ('---=== Not displaying stations (Radio Browser window follows) ===---' )
6484
6486
self .outerBodyWin .refresh ()
6485
6487
return
6486
- self .bodyWin .erase ()
6488
+
6489
+ # self.bodyWin.erase()
6487
6490
if self .maxY > 2 :
6488
6491
self .outerBodyWin .box ()
6489
6492
try :
6490
6493
self .bodyWin .move (1 , 1 )
6491
6494
self .bodyWin .move (0 , 0 )
6492
6495
except :
6496
+ if logger .isEnabledFor (logging .DEBUG ):
6497
+ logger .debug ('====---- cursrm move failed ----====' )
6493
6498
pass
6494
6499
self ._print_body_header ()
6495
6500
pad = len (str (self .startPos + self .bodyMaxY ))
6496
6501
6497
- ''' display the content '''
6498
- if self .number_of_items > 0 :
6499
- for lineNum in range (self .bodyMaxY ):
6500
- i = lineNum + self .startPos
6501
- if i < len (self .stations ):
6502
- self .__displayBodyLine (lineNum , pad , self .stations [i ])
6503
- else :
6504
- ''' display browser empty lines (station=None) '''
6505
- line = self .__displayBodyLine (0 , pad , None , return_line = True )
6506
- if self ._cnf .browsing_station_service :
6507
- for n in range (i + 1 , self .bodyMaxY + 1 ):
6508
- try :
6509
- self .bodyWin .addstr (lineNum , 0 , line , curses .color_pair (5 ))
6510
- except :
6511
- pass
6512
- lineNum += 1
6513
- break
6514
- else :
6515
- ''' we have no stations to display '''
6502
+ if self .number_of_items == 0 :
6516
6503
if self ._cnf .browsing_station_service :
6517
- ''' we have to display emplty lines '''
6504
+ ''' we have to fill the screen with emplty lines '''
6518
6505
line = self .__displayBodyLine (0 , pad , None , return_line = True )
6519
6506
for n in range (0 , self .bodyMaxY + 1 ):
6520
6507
try :
6521
6508
self .bodyWin .addstr (n , 0 , line , curses .color_pair (5 ))
6522
6509
except :
6523
6510
pass
6511
+ pass
6512
+ else :
6513
+ self .bodyWin .erase ()
6514
+ else :
6515
+ for lineNum in range (self .bodyMaxY ):
6516
+ i = lineNum + self .startPos
6517
+ if i < len (self .stations ):
6518
+ if not self ._cnf .browsing_station_service and \
6519
+ self .ws .operation_mode == self .ws .NORMAL_MODE :
6520
+ try :
6521
+ self .bodyWin .move (lineNum , 0 )
6522
+ self .bodyWin .clrtoeol ()
6523
+ except :
6524
+ if logger .isEnabledFor (logging .DEBUG ):
6525
+ logger .debug ('====---- clear line move failed----====' )
6526
+ self .__displayBodyLine (lineNum , pad , self .stations [i ])
6527
+ else :
6528
+ if self ._cnf .browsing_station_service :
6529
+ ''' display browser empty lines (station=None) '''
6530
+ line = self .__displayBodyLine (0 , pad , None , return_line = True )
6531
+ if self ._cnf .browsing_station_service :
6532
+ for n in range (i + 1 , self .bodyMaxY + 1 ):
6533
+ try :
6534
+ self .bodyWin .addstr (lineNum , 0 , line , curses .color_pair (5 ))
6535
+ except :
6536
+ pass
6537
+ lineNum += 1
6538
+ break
6539
+ else :
6540
+ logger .error ('clearing window from line {} to end.' .format (i ))
6541
+ try :
6542
+ self .bodyWin .move (i , 0 )
6543
+ self .bodyWin .clrtobot ()
6544
+ except :
6545
+ if logger .isEnabledFor (logging .DEBUG ):
6546
+ logger .debug ('====---- clear to end of window failed----====' )
6547
+ break
6548
+
6549
+
6550
+
6551
+
6552
+ #''' display the content '''
6553
+ #if self.number_of_items > 0:
6554
+ # for lineNum in range(self.bodyMaxY):
6555
+ # i = lineNum + self.startPos
6556
+ # if i < len(self.stations):
6557
+ # self.__displayBodyLine(lineNum, pad, self.stations[i])
6558
+ # else:
6559
+ # ''' display browser empty lines (station=None) '''
6560
+ # line = self.__displayBodyLine(0, pad, None, return_line = True)
6561
+ # if self._cnf.browsing_station_service:
6562
+ # for n in range(i+1, self.bodyMaxY + 1):
6563
+ # try:
6564
+ # self.bodyWin.addstr(lineNum, 0, line, curses.color_pair(5))
6565
+ # except:
6566
+ # pass
6567
+ # lineNum += 1
6568
+ # break
6569
+ #else:
6570
+ # ''' we have no stations to display '''
6571
+ # if self._cnf.browsing_station_service:
6572
+ # ''' we have to display emplty lines '''
6573
+ # line = self.__displayBodyLine(0, pad, None, return_line = True)
6574
+ # for n in range(0, self.bodyMaxY + 1):
6575
+ # try:
6576
+ # self.bodyWin.addstr(n, 0, line, curses.color_pair(5))
6577
+ # except:
6578
+ # pass
6524
6579
6525
6580
if self ._cnf .browsing_station_service :
6526
6581
if self ._cnf .internal_header_height > 0 :
@@ -6551,7 +6606,9 @@ def _redisplay_stations_and_playlists(self):
6551
6606
self .outerBodyWin .addstr (column_name [j ], curses .color_pair (2 ))
6552
6607
except :
6553
6608
pass
6609
+ self .outerBodyWin .touchwin ()
6554
6610
self .outerBodyWin .refresh ()
6611
+ self .bodyWin .touchwin ()
6555
6612
self .bodyWin .refresh ()
6556
6613
6557
6614
def _redisplay_config (self ):
0 commit comments