Skip to content

Commit 4564a69

Browse files
committed
all stations history messages will go to status bar if small window
(title will auto update)
1 parent fcd0570 commit 4564a69

File tree

1 file changed

+39
-10
lines changed

1 file changed

+39
-10
lines changed

pyradio/radio.py

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5218,7 +5218,11 @@ def _show_stations_history_notification(self, msg_id):
52185218
'Operation not supported',
52195219
'Please wait for the player to settle...'
52205220
)
5221-
self.log.write(msg=msg[msg_id], help_msg=True, suffix=self._status_suffix)
5221+
if self.player.isPlaying():
5222+
self.log.write(msg=msg[msg_id])
5223+
self.player.threadUpdateTitle()
5224+
else:
5225+
self.log.write(msg=msg[msg_id], help_msg=True, suffix=self._status_suffix)
52225226
else:
52235227
msg = (
52245228
'___Operation not suported!!!___\n____Connection timeout is 0 ',
@@ -7681,21 +7685,51 @@ def _show_delayed_notification(self, txt, delay=.75):
76817685
callback_function=self.refreshBody
76827686
)
76837687

7688+
def _show_stations_history_playlist_modified(self):
7689+
if self._limited_height_mode or self._limited_width_mode:
7690+
msg= 'Playlist has been modified, cannot close it...'
7691+
if self.player.isPlaying():
7692+
self.log.write(msg=msg)
7693+
self.player.threadUpdateTitle()
7694+
else:
7695+
self.log.write(msg=mgd, help_msg=True, suffix=self._status_suffix)
7696+
else:
7697+
self._show_notification_with_delay(
7698+
txt='____Playlist has been modified____\n___Please save it and try again___',
7699+
delay=1.5,
7700+
mode_to_set=self.ws.operation_mode,
7701+
callback_function=self.refreshBody)
7702+
76847703
def _show_no_station_history_notification(self):
76857704
if self._limited_height_mode or self._limited_width_mode:
7686-
self.log.write(msg='History is empty!!!', help_msg=True, suffix=self._status_suffix)
7705+
msg= 'History is empty!!!'
7706+
if self.player.isPlaying():
7707+
self.log.write(msg=msg)
7708+
self.player.threadUpdateTitle()
7709+
else:
7710+
self.log.write(msg=mgd, help_msg=True, suffix=self._status_suffix)
76877711
else:
76887712
self._show_delayed_notification('___History is empty!!!___')
76897713

76907714
def _show_first_station_history_notification(self):
76917715
if self._limited_height_mode or self._limited_width_mode:
7692-
self.log.write(msg='Already at first item!!!', help_msg=True, suffix=self._status_suffix)
7716+
msg = 'Already at first item!!!'
7717+
if self.player.isPlaying():
7718+
self.log.write(msg=msg)
7719+
self.player.threadUpdateTitle()
7720+
else:
7721+
self.log.write(msg=msg, help_msg=True, suffix=self._status_suffix)
76937722
else:
76947723
self._show_delayed_notification('___Already at first item!!!___')
76957724

76967725
def _show_last_station_history_notification(self):
76977726
if self._limited_height_mode or self._limited_width_mode:
7698-
self.log.write(msg='Already at last item!!!', help_msg=True, suffix=self._status_suffix)
7727+
msg = 'Already at last item!!!'
7728+
if self.player.isPlaying():
7729+
self.log.write(msg=msg)
7730+
self.player.threadUpdateTitle()
7731+
else:
7732+
self.log.write(msg=msg, help_msg=True, suffix=self._status_suffix)
76997733
else:
77007734
self._show_delayed_notification('___Already at last item!!!___')
77017735

@@ -8529,11 +8563,7 @@ def _load_playlist_and_station_from_station_history(self, h_item, func):
85298563
''' I have to load a new playlist '''
85308564
if self._cnf.dirty_playlist:
85318565
self._cnf.stations_history.restore_index(func)
8532-
self._show_notification_with_delay(
8533-
txt='____Playlist has been modified____\n___Please save it and try again___',
8534-
delay=1.5,
8535-
mode_to_set=self.ws.operation_mode,
8536-
callback_function=self.refreshBody)
8566+
self._show_stations_history_playlist_modified()
85378567
return
85388568

85398569
ret = 0
@@ -8582,7 +8612,6 @@ def _load_playlist_and_station_from_station_history(self, h_item, func):
85828612
self._get_playlists_data_from_playlist_name(h_item[0])
85838613
self.saved_active_stations = [['', 0], ['', -1]]
85848614
if self._limited_height_mode or self._limited_width_mode:
8585-
logger.error('==== update body')
85868615
self._print_limited_info()
85878616
return
85888617

0 commit comments

Comments
 (0)