Skip to content

Commit 81aec8b

Browse files
committed
Config window: Implementing "Encoding selection"
1 parent cbed61f commit 81aec8b

File tree

6 files changed

+1120
-385
lines changed

6 files changed

+1120
-385
lines changed

pyradio/common.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
""" Modes of Operation """
2+
NO_PLAYER_ERROR_MODE = -1
3+
NORMAL_MODE = 0
4+
PLAYLIST_MODE = 1
5+
SEARCH_NORMAL_MODE = 2
6+
SEARCH_PLAYLIST_MODE = 3
7+
CONFIG_MODE = 4
8+
SELECT_PLAYER_MODE = 5
9+
SELECT_ENCODING_MODE = 6
10+
REMOVE_STATION_MODE = 50
11+
SAVE_PLAYLIST_MODE = 51
12+
ASK_TO_SAVE_PLAYLIST_MODE = 52
13+
MAIN_HELP_MODE = 100
14+
PLAYLIST_HELP_MODE = 101
15+
THEME_HELP_MODE = 102
16+
CONFIG_HELP_MODE = 103
17+
SELECT_PLAYER_HELP_MODE = 104
18+
SELECT_ENCODING_HELP_MODE = 105
19+
PLAYLIST_LOAD_ERROR_MODE = 200
20+
PLAYLIST_RELOAD_ERROR_MODE = 201
21+
PLAYLIST_RELOAD_CONFIRM_MODE = 202
22+
PLAYLIST_DIRTY_RELOAD_CONFIRM_MODE = 203
23+
PLAYLIST_SCAN_ERROR_MODE = 204
24+
SAVE_PLAYLIST_ERROR_1_MODE = 205
25+
SAVE_PLAYLIST_ERROR_2_MODE = 206
26+
FOREIGN_PLAYLIST_ASK_MODE = 300
27+
FOREIGN_PLAYLIST_MESSAGE_MODE = 301
28+
FOREIGN_PLAYLIST_COPY_ERROR_MODE = 302
29+
THEME_MODE = 400
30+
NOT_IMPLEMENTED_YET_MODE = 1000
31+
32+

pyradio/config.py

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -774,39 +774,3 @@ def read_playlist_file(self, stationFile=''):
774774
stationFile = self.default_playlist
775775
return super(PyRadioConfig, self).read_playlist_file(stationFile)
776776

777-
class PyRadioConfigWindow(object):
778-
779-
parent = None
780-
_win = None
781-
782-
_title = ' PyRadio Configuration '
783-
784-
def __init__(self, parent):
785-
self.parent = parent
786-
self.init_config_win()
787-
self.refresh_config_win()
788-
789-
@property
790-
def parent(self):
791-
return self.__parent
792-
793-
@parent.setter
794-
def parent(self, val):
795-
self.__parent = val
796-
self.init_config_win()
797-
798-
def init_config_win(self):
799-
self._win = None
800-
self.maxY, self.maxX = self.__parent.getmaxyx()
801-
self._win = curses.newwin(self.maxY, self.maxX, 0, 1)
802-
803-
def refresh_config_win(self):
804-
self._win.bkgdset(' ', curses.color_pair(3))
805-
self._win.erase()
806-
self._win.box()
807-
self.bodyWin.addstr(0,
808-
int((self.bodyMaxX - len(self._title)) / 2),
809-
curses.color_pair(5))
810-
811-
def keypress(self, char):
812-
pass

0 commit comments

Comments
 (0)