@@ -456,6 +456,7 @@ def __del__(self):
456456 self .transientWin = None
457457
458458 def setup (self , stdscr ):
459+ # curses.savetty()
459460 self .setup_return_status = True
460461 if not curses .has_colors ():
461462 self .setup_return_status = False
@@ -499,7 +500,6 @@ def setup(self, stdscr):
499500 self .playbackTimeoutCounter ,
500501 self .connectionFailed ,
501502 self ._show_station_info_from_thread )
502- logger .error ('DE \n \n NEW_PROFILE_STRING = {}\n \n ' .format (self .player .NEW_PROFILE_STRING ))
503503 except :
504504 ''' no player '''
505505 self .ws .operation_mode = self .ws .NO_PLAYER_ERROR_MODE
@@ -593,7 +593,7 @@ def setupAndDrawScreen(self, init_from_setup=False):
593593 self .bodyWinEndY = self .maxY - 1
594594 if logger .isEnabledFor (logging .DEBUG ):
595595 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 (
597597 self .maxY - 4 - self ._cnf .internal_header_height ,
598598 self .maxX - 2 ,
599599 self .bodyWinStartY ,
@@ -615,6 +615,7 @@ def setupAndDrawScreen(self, init_from_setup=False):
615615 ''' for light color scheme '''
616616 # TODO
617617 self .outerBodyWin .bkgdset (' ' , curses .color_pair (5 ))
618+ self .outerBodyWin .erase ()
618619 self .bodyWin .bkgdset (' ' , curses .color_pair (5 ))
619620 self .initBody ()
620621
@@ -880,11 +881,11 @@ def __displayBodyLine(self, lineNum, pad, station, return_line=False):
880881 except :
881882 pass
882883
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 )
888889
889890 def run (self ):
890891 self ._register_signals_handlers ()
@@ -5883,6 +5884,8 @@ def keypress(self, char):
58835884 self ._cnf .jump_tag = - 1
58845885 self ._update_status_bar_right (status_suffix = '' )
58855886 if self ._cnf .browsing_station_service :
5887+ self ._print_not_implemented_yet ()
5888+ return
58865889 self .ws .operation_mode = self .ws .BROWSER_SEARCH_MODE
58875890 self ._browser_init_search (parent = self .outerBodyWin )
58885891 else :
@@ -6476,51 +6479,103 @@ def _find_renamed_selection(self, mode, search_path, search_file):
64766479 def _redisplay_stations_and_playlists (self ):
64776480 if self ._limited_height_mode :
64786481 return
6479- self .outerBodyWin .erase ()
64806482 if self ._redisplay_list [- 1 ][0 ] == self .ws .BROWSER_SEARCH_MODE and \
64816483 self ._redisplay_list [- 2 ][0 ] == self .ws .NORMAL_MODE :
64826484 if logger .isEnabledFor (logging .DEBUG ):
64836485 logger .debug ('---=== Not displaying stations (Radio Browser window follows) ===---' )
64846486 self .outerBodyWin .refresh ()
64856487 return
6486- self .bodyWin .erase ()
6488+
6489+ # self.bodyWin.erase()
64876490 if self .maxY > 2 :
64886491 self .outerBodyWin .box ()
64896492 try :
64906493 self .bodyWin .move (1 , 1 )
64916494 self .bodyWin .move (0 , 0 )
64926495 except :
6496+ if logger .isEnabledFor (logging .DEBUG ):
6497+ logger .debug ('====---- cursrm move failed ----====' )
64936498 pass
64946499 self ._print_body_header ()
64956500 pad = len (str (self .startPos + self .bodyMaxY ))
64966501
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 :
65166503 if self ._cnf .browsing_station_service :
6517- ''' we have to display emplty lines '''
6504+ ''' we have to fill the screen with emplty lines '''
65186505 line = self .__displayBodyLine (0 , pad , None , return_line = True )
65196506 for n in range (0 , self .bodyMaxY + 1 ):
65206507 try :
65216508 self .bodyWin .addstr (n , 0 , line , curses .color_pair (5 ))
65226509 except :
65236510 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
65246579
65256580 if self ._cnf .browsing_station_service :
65266581 if self ._cnf .internal_header_height > 0 :
@@ -6551,7 +6606,9 @@ def _redisplay_stations_and_playlists(self):
65516606 self .outerBodyWin .addstr (column_name [j ], curses .color_pair (2 ))
65526607 except :
65536608 pass
6609+ self .outerBodyWin .touchwin ()
65546610 self .outerBodyWin .refresh ()
6611+ self .bodyWin .touchwin ()
65556612 self .bodyWin .refresh ()
65566613
65576614 def _redisplay_config (self ):
0 commit comments