@@ -629,6 +629,7 @@ def __init__(self, pyradio_config,
629
629
self.ws.SCHEDULE_STATION_SEARCH_MODE: self._redisplay_search_show,
630
630
self.ws.SCHEDULE_PLAYLIST_SEARCH_MODE: self._redisplay_search_show,
631
631
self.ws.GROUP_SEARCH_MODE: self._redisplay_search_show,
632
+ self.ws.CONFIG_SEARCH_MODE: self._redisplay_search_show,
632
633
self.ws.THEME_MODE: self._redisplay_theme_mode,
633
634
self.ws.ASK_TO_CREATE_NEW_THEME_MODE: self._redisplay_ask_to_create_new_theme,
634
635
self.ws.ADD_STATION_MODE: self._show_station_editor,
@@ -689,6 +690,7 @@ def __init__(self, pyradio_config,
689
690
self.ws.BROWSER_SEARCH_MODE: 'H_RB_SEARCH',
690
691
self.ws.SEARCH_NORMAL_MODE: 'H_SEARCH',
691
692
self.ws.SEARCH_PLAYLIST_MODE: 'H_SEARCH',
693
+ self.ws.CONFIG_SEARCH_MODE: 'H_SEARCH',
692
694
self.ws.SELECT_STATION_ENCODING_MODE: 'H_CONFIG_ENCODING',
693
695
self.ws.SELECT_ENCODING_MODE: 'H_CONFIG_ENCODING',
694
696
self.ws.EDIT_STATION_ENCODING_MODE: 'H_CONFIG_ENCODING',
@@ -702,8 +704,9 @@ def __init__(self, pyradio_config,
702
704
2 - theme search
703
705
3 - paste mode
704
706
4 - group selection
707
+ 5 - config search
705
708
'''
706
- self._search_classes = [None, None, None, None, None]
709
+ self._search_classes = [None, None, None, None, None, None ]
707
710
708
711
''' the files that the search terms are stored to '''
709
712
self._search_files = (
@@ -712,6 +715,7 @@ def __init__(self, pyradio_config,
712
715
path.join(self._cnf.state_dir, 'search-theme.txt'),
713
716
path.join(self._cnf.state_dir, 'search-paste.txt'),
714
717
path.join(self._cnf.state_dir, 'search-group.txt'),
718
+ path.join(self._cnf.state_dir, 'search-config.txt'),
715
719
)
716
720
717
721
''' points to list in which the search will be performed '''
@@ -728,6 +732,7 @@ def __init__(self, pyradio_config,
728
732
self.ws.THEME_MODE: 2,
729
733
self.ws.PASTE_MODE: 3,
730
734
self.ws.GROUP_SELECTION_MODE: 4,
735
+ self.ws.CONFIG_MODE: 5,
731
736
}
732
737
733
738
''' which search mode opens from each allowed mode '''
@@ -741,12 +746,14 @@ def __init__(self, pyradio_config,
741
746
self.ws.GROUP_SELECTION_MODE: self.ws.GROUP_SEARCH_MODE,
742
747
self.ws.SCHEDULE_PLAYLIST_SELECT_MODE: self.ws.SCHEDULE_PLAYLIST_SEARCH_MODE,
743
748
self.ws.SCHEDULE_STATION_SELECT_MODE: self.ws.SCHEDULE_STATION_SEARCH_MODE,
749
+ self.ws.CONFIG_MODE: self.ws.CONFIG_SEARCH_MODE,
744
750
}
745
751
746
752
''' search modes opened from main windows '''
747
753
self.search_main_window_modes = (
748
754
self.ws.SEARCH_NORMAL_MODE,
749
755
self.ws.SEARCH_PLAYLIST_MODE,
756
+ self.ws.CONFIG_SEARCH_MODE
750
757
)
751
758
752
759
''' volume functions '''
@@ -2333,8 +2340,7 @@ def _give_me_a_search_class(self, operation_mode):
2333
2340
'''
2334
2341
try:
2335
2342
if self._search_classes[self._mode_to_search[operation_mode]] is None:
2336
- self._search_classes[self._mode_to_search[operation_mode]] \
2337
- = \
2343
+ self._search_classes[self._mode_to_search[operation_mode]] = \
2338
2344
PyRadioSearch(
2339
2345
parent=self.outerBodyWin,
2340
2346
width=33,
@@ -2355,10 +2361,11 @@ def _give_me_a_search_class(self, operation_mode):
2355
2361
return
2356
2362
self.search = self._search_classes[self._mode_to_search[operation_mode]]
2357
2363
#self.search.pure_ascii = True
2358
- if self.ws.previous_operation_mode == self.ws.CONFIG_MODE:
2364
+ if self.ws.operation_mode == self.ws.CONFIG_MODE or \
2365
+ self.ws.previous_operation_mode == self.ws.CONFIG_MODE:
2359
2366
self.search.box_color = curses.color_pair(3)
2360
- else:
2361
- self.search.box_color = curses.color_pair(5 )
2367
+ self.search.caption_color=curses.color_pair(11)
2368
+ self.search.edit_color= curses.color_pair(10 )
2362
2369
2363
2370
def ctrl_c_handler(self, signum, frame, save_playlist=True):
2364
2371
# ok
@@ -6797,6 +6804,7 @@ def keypress(self, char):
6797
6804
win_del_old_inst()
6798
6805
return
6799
6806
6807
+ logger.error('self.ws.operation_mode in self._search_modes = {}'.format(self.ws.operation_mode in self._search_modes))
6800
6808
if self.ws.operation_mode in (
6801
6809
self.ws.DEPENDENCY_ERROR,
6802
6810
self.ws.NO_PLAYER_ERROR_MODE,
@@ -7526,7 +7534,9 @@ def keypress(self, char):
7526
7534
self.refreshBody()
7527
7535
7528
7536
elif self.ws.operation_mode == self.ws.CONFIG_MODE and \
7529
- char not in self._chars_to_bypass:
7537
+ char not in self._chars_to_bypass and \
7538
+ char not in self._chars_to_bypass_for_search:
7539
+
7530
7540
if char in (kbkey['revert_saved'], kbkey['revert_def']) or \
7531
7541
check_localized(char, (kbkey['revert_saved'], kbkey['revert_def'])):
7532
7542
self._player_select_win = None
0 commit comments