@@ -1036,12 +1036,9 @@ def _format_playlist_line(self, lineNum, pad, station):
1036
1036
def _print_help (self ):
1037
1037
#logger.error('DE \n\nself.ws.operation_mode = {}'.format(self.ws.operation_mode))
1038
1038
if self .ws .operation_mode in self ._display_help .keys ():
1039
- #logger.error('DE in display help')
1040
1039
self ._display_help [self .ws .operation_mode ]()
1041
1040
else :
1042
- #logger.error('DE in redisplay')
1043
1041
self ._redisplay [self .ws .operation_mode ]()
1044
- #logger.error('DE end _print_help')
1045
1042
1046
1043
def _show_playlist_recovered (self ):
1047
1044
txt = 'Playlist recoverd!'
@@ -1098,7 +1095,6 @@ def _show_main_help(self):
1098
1095
self ._show_help (txt , mode_to_set = self .ws .MAIN_HELP_MODE )
1099
1096
1100
1097
def _show_main_help_page_2 (self ):
1101
- logger .error ('DE I am here: _show_main_help_page_2' )
1102
1098
txt = """a| / |A |Add / append new station.
1103
1099
e |Edit station.
1104
1100
E |Change station's encoding.
@@ -2207,6 +2203,28 @@ def keypress(self, char):
2207
2203
self .ws .close_window ()
2208
2204
self ._station_editor = None
2209
2205
self .refreshBody ()
2206
+ elif ret == 1 :
2207
+ # ok
2208
+ if self .ws .operation_mode == self .ws .EDIT_STATION_MODE :
2209
+ if self .stations [self .selection ] != self ._station_editor .new_station :
2210
+ self ._cnf .dirty_playlist = True
2211
+ self .stations [self .selection ] = self ._station_editor .new_station
2212
+ else :
2213
+ if self ._station_editor .append :
2214
+ self .stations .append (self ._station_editor .new_station )
2215
+ self .number_of_items = len (self .stations )
2216
+ self .selection = self .number_of_items - 1
2217
+ self .startPos = self .number_of_items - self .bodyMaxY + 2
2218
+ else :
2219
+ pass
2220
+ ret , self .number_of_items = self ._cnf .insert_station (self ._station_editor .new_station , self .selection + 1 )
2221
+ self .stations = self ._cnf .stations
2222
+ self .selection += 1
2223
+ if self .selection >= self .startPos + self .bodyMaxY - 2 :
2224
+ self .startPos += 1
2225
+
2226
+ self .ws .close_window ()
2227
+ self .refreshBody ()
2210
2228
elif ret == 2 :
2211
2229
# display line editor help
2212
2230
self ._show_line_editor_help ()
@@ -2809,7 +2827,7 @@ def keypress(self, char):
2809
2827
if char in ( ord ('a' ), ord ('A' ) ):
2810
2828
self ._station_editor = PyRadioEditor (self .stations , self .selection , self .bodyWin )
2811
2829
if char == ord ('A' ):
2812
- self ._station_editor .apend = True
2830
+ self ._station_editor .append = True
2813
2831
self ._station_editor .show ()
2814
2832
self ._station_editor .item = [ '' , '' , '' ]
2815
2833
self .ws .operation_mode = self .ws .ADD_STATION_MODE
0 commit comments