@@ -975,6 +975,18 @@ def _show_help(self, txt,
975
975
self .helpWin .addstr ('┤' .encode ('utf-8' ), curses .color_pair (3 ))
976
976
self .helpWin .addstr (i + 1 , inner_width - len (a_line [1 :]) - 1 , a_line [1 :].replace ('_' , ' ' ), caption_col )
977
977
#self.helpWin.addstr(i + 1, int((inner_width-len(a_line[1:]))/2), a_line[1:].replace('_', ' '), caption_col)
978
+ elif a_line .startswith ('!' ):
979
+ self .helpWin .move (i + 1 , 2 )
980
+ lin = ' ' + a_line [1 :] + ' '
981
+ llin = len (lin )
982
+
983
+ wsp = inner_width - 4
984
+ try :
985
+ self .helpWin .addstr ('─' * wsp , curses .color_pair (3 ))
986
+ except :
987
+ self .helpWin .addstr ('─' .encode ('utf-8' ) * wsp , curses .color_pair (3 ))
988
+ self .helpWin .addstr (i + 1 , 5 , lin , caption_col )
989
+
978
990
else :
979
991
splited = a_line .split ('|' )
980
992
self .helpWin .move (i + 1 , 2 )
@@ -1083,28 +1095,33 @@ def _show_main_help(self):
1083
1095
txt = """Up|,|j|,|PgUp|,
1084
1096
Down|,|k|,|PgDown |Change station selection.
1085
1097
g| / |<n>G |Jump to first or n-th / last station.
1086
- M| / |P |Jump to |M|iddle / |P|laying station.
1098
+ H M L |Go to top / middle / bottom of screen.
1099
+ P |Go to |P|laying station.
1087
1100
Enter|,|Right|,|l |Play selected station.
1088
1101
r |Select and play a random station.
1089
1102
Space|,|Left|,|h |Stop / start playing selected station.
1103
+ Esc|,|q |Quit.
1104
+ !Volume management
1090
1105
-|/|+| or |,|/|. |Change volume.
1091
1106
m| / |v ||M|ute player / Save |v|olume (not in vlc).
1107
+ !Misc
1092
1108
o| / |s| / |R ||O|pen / |S|ave / |R|eload playlist.
1093
1109
t| / |T |Load |t|heme / |T|oggle transparency.
1094
- c |Open Configuration window.
1095
- /| / |n| / |N |Search, go to next / previous result.
1096
- Esc|,|q |Quit. """
1110
+ c |Open Configuration window."""
1097
1111
self ._show_help (txt , mode_to_set = self .ws .MAIN_HELP_MODE )
1098
1112
1099
1113
def _show_main_help_page_2 (self ):
1100
- txt = """a| / |A |Add / append new station.
1101
- e |Edit station.
1114
+ txt = """!Playlist editing
1115
+ a| / |A |Add / append new station.
1116
+ e |Edit current station.
1102
1117
E |Change station's encoding.
1103
1118
DEL|,|x |Delete selected station.
1104
- J |Create a |J|ump tag
1119
+ !Moving stations
1120
+ J |Create a |J|ump tag.
1105
1121
<n>^U|,|<n>^D |Move station |U|p / |D|own.
1106
- ||_________________|If a |jump tag| exists,
1107
- ||_________________|move the station there."""
1122
+ ||_________________|If a |jump tag| exists, move it there.
1123
+ !Searching
1124
+ /| / |n| / |N |Search, go to next / previous result."""
1108
1125
self ._show_help (txt , mode_to_set = self .ws .MAIN_HELP_MODE_PAGE_2 )
1109
1126
1110
1127
def _show_playlist_help (self ):
@@ -1482,9 +1499,11 @@ def _print_save_playlist_error_2(self):
1482
1499
is_message = True )
1483
1500
1484
1501
def _print_editor_name_error (self ):
1485
- txt = '''Station Name is empty!
1502
+ txt = '''
1503
+ ___Incomplete Station Data provided!___
1504
+
1505
+ ___Please provide a Station Name.___
1486
1506
1487
- Please provide a Station Name.
1488
1507
'''
1489
1508
self ._show_help (txt ,
1490
1509
mode_to_set = self .ws .EDIT_STATION_NAME_ERROR ,
@@ -1493,10 +1512,22 @@ def _print_editor_name_error(self):
1493
1512
is_message = True )
1494
1513
1495
1514
def _print_editor_url_error (self ):
1496
- txt = '''Station URL is invalid!
1515
+ if self ._station_editor ._line_editor [1 ].string .strip ():
1516
+ txt = '''
1517
+ ___Errorenous Station Data provided!___
1497
1518
1498
- Please provide a valid Station URL.
1499
- '''
1519
+ ___Station URL is invalid!___
1520
+ ___Please provide a valid Station URL.___
1521
+
1522
+ '''
1523
+ else :
1524
+ txt = '''
1525
+ ___Errorenous Station Data provided!___
1526
+
1527
+ ___Station URL is empty!___
1528
+ ___Please provide a valid Station URL.___
1529
+
1530
+ '''
1500
1531
self ._show_help (txt ,
1501
1532
mode_to_set = self .ws .EDIT_STATION_URL_ERROR ,
1502
1533
caption = ' Error ' ,
@@ -2015,15 +2046,31 @@ def keypress(self, char):
2015
2046
""" if no player, don't serve keyboard """
2016
2047
return
2017
2048
2049
+ elif char == ord ('H' ):
2050
+ if self .ws .operation_mode in \
2051
+ (self .ws .NORMAL_MODE , self .ws .PLAYLIST_MODE ):
2052
+ self .jumpnr = ''
2053
+ self ._random_requested = False
2054
+ self .selection = self .startPos
2055
+ self .refreshBody ()
2056
+ return
2057
+
2018
2058
elif char == ord ('M' ):
2019
- if ( self .ws .operation_mode == self . ws . NORMAL_MODE or \
2020
- self .ws .operation_mode == self .ws .PLAYLIST_MODE ):
2059
+ if self .ws .operation_mode in \
2060
+ ( self .ws .NORMAL_MODE , self .ws .PLAYLIST_MODE ):
2021
2061
self .jumpnr = ''
2022
2062
self ._random_requested = False
2023
- if self .number_of_items > 0 :
2024
- self .setStation (int (self .number_of_items / 2 ) - 1 )
2025
- self ._put_selection_in_the_middle (force = True )
2026
- self .refreshBody ()
2063
+ self .selection = self .startPos + int ((self .bodyMaxY - 3 ) / 2 )
2064
+ self .refreshBody ()
2065
+ return
2066
+
2067
+ elif char == ord ('L' ):
2068
+ if self .ws .operation_mode in \
2069
+ (self .ws .NORMAL_MODE , self .ws .PLAYLIST_MODE ):
2070
+ self .jumpnr = ''
2071
+ self ._random_requested = False
2072
+ self .selection = self .startPos + self .bodyMaxY - 3
2073
+ self .refreshBody ()
2027
2074
return
2028
2075
2029
2076
elif char in (ord ('t' ), ) and \
0 commit comments