Skip to content

Commit ddc8a1b

Browse files
committed
- do not show 'config saved' messages in window title
- station history messages to status bar if window is small
1 parent e31b532 commit ddc8a1b

File tree

2 files changed

+37
-13
lines changed

2 files changed

+37
-13
lines changed

pyradio/log.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@ def write_start_log_station_and_title(self):
290290
@staticmethod
291291
def set_win_title(msg=None):
292292
default = 'Your Internet Radio Player'
293+
just_return = (
294+
'Config saved',
295+
'Online service Config',
296+
)
293297
do_not_update = (
294298
': Playback stopped',
295299
'Selected ',
@@ -320,6 +324,10 @@ def set_win_title(msg=None):
320324
Log.locked = True
321325
d_msg = default
322326
else:
327+
# no update
328+
for a_return_token in just_return:
329+
if a_return_token in msg:
330+
return
323331
# if stopped...
324332
for a_stop_token in do_not_update:
325333
if a_stop_token in msg:

pyradio/radio.py

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ def initHead(self, info):
790790
try:
791791
self.headWin.addstr(0, 0, info, curses.color_pair(4))
792792
if self._cnf.locked:
793-
self.headWin.addstr(' [', curses.color_pair(5))
793+
self.headWin.addstr('[', curses.color_pair(5))
794794
self.headWin.addstr('Session Locked', curses.color_pair(4))
795795
self.headWin.addstr('] ', curses.color_pair(5))
796796
else:
@@ -5211,15 +5211,22 @@ def _tag_a_title(self):
52115211
# self.refreshBody()
52125212

52135213
def _show_stations_history_notification(self, msg_id):
5214-
msg = (
5215-
'___Operation not suported!!!___\n____Connection timeout is 0 ',
5216-
'___Pelase wait for the player___\n__________to settle'
5217-
)
5218-
self._show_notification_with_delay(
5219-
txt=msg[msg_id],
5220-
mode_to_set=self.ws.NORMAL_MODE,
5221-
callback_function=self.refreshBody
5222-
)
5214+
if self._limited_height_mode or self._limited_width_mode:
5215+
msg = (
5216+
'Operation not supported',
5217+
'Please wait for the player to settle...'
5218+
)
5219+
self.log.write(msg=msg[msg_id], help_msg=True, suffix=self._status_suffix)
5220+
else:
5221+
msg = (
5222+
'___Operation not suported!!!___\n____Connection timeout is 0 ',
5223+
'___Please wait for the player___\n__________to settle'
5224+
)
5225+
self._show_notification_with_delay(
5226+
txt=msg[msg_id],
5227+
mode_to_set=self.ws.NORMAL_MODE,
5228+
callback_function=self.refreshBody
5229+
)
52235230

52245231
def keypress(self, char):
52255232
if self._system_asked_to_terminate:
@@ -7671,13 +7678,22 @@ def _show_delayed_notification(self, txt, delay=.75):
76717678
)
76727679

76737680
def _show_no_station_history_notification(self):
7674-
self._show_delayed_notification('___History is empty!!!___')
7681+
if self._limited_height_mode or self._limited_width_mode:
7682+
self.log.write(msg='History is empty!!!', help_msg=True, suffix=self._status_suffix)
7683+
else:
7684+
self._show_delayed_notification('___History is empty!!!___')
76757685

76767686
def _show_first_station_history_notification(self):
7677-
self._show_delayed_notification('___Already at first item!!!___')
7687+
if self._limited_height_mode or self._limited_width_mode:
7688+
self.log.write(msg='Already at first item!!!', help_msg=True, suffix=self._status_suffix)
7689+
else:
7690+
self._show_delayed_notification('___Already at first item!!!___')
76787691

76797692
def _show_last_station_history_notification(self):
7680-
self._show_delayed_notification('___Already at last item!!!___')
7693+
if self._limited_height_mode or self._limited_width_mode:
7694+
self.log.write(msg='Already at last item!!!', help_msg=True, suffix=self._status_suffix)
7695+
else:
7696+
self._show_delayed_notification('___Already at last item!!!___')
76817697

76827698
def _show_station_pasted(self):
76837699
self._show_delayed_notification('___Station pasted!!!___')

0 commit comments

Comments
 (0)