Compatibility with previous versions of Sonata -------------------- --

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# Compatibility with previous versions of Sonata:
# --------------------------------------------------------------------
if conf.has_option('connection', 'host'):
self.host[0] = conf.get('connection', 'host')
if conf.has_option('connection', 'port'):
self.port[0] = int(conf.get('connection', 'port'))
if conf.has_option('connection', 'password'):
self.password[0] = conf.get('connection', 'password')
if conf.has_option('connection', 'musicdir'):
self.musicdir[0] = self.sanitize_musicdir(conf.get('connection', 'musicdir'))
# --------------------------------------------------------------------
if conf.has_option('connection', 'auto'):
self.autoconnect = conf.getboolean('connection', 'auto')
if conf.has_option('connection', 'profile_num'):
self.profile_num = conf.getint('connection', 'profile_num')
if conf.has_option('player', 'x'):
self.x = conf.getint('player', 'x')
if conf.has_option('player', 'y'):
self.y = conf.getint('player', 'y')
if conf.has_option('player', 'w'):
self.w = conf.getint('player', 'w')
if conf.has_option('player', 'h'):
self.h = conf.getint('player', 'h')
if conf.has_option('player', 'expanded'):
self.expanded = conf.getboolean('player', 'expanded')
if conf.has_option('player', 'withdrawn'):
self.withdrawn = conf.getboolean('player', 'withdrawn')
if conf.has_option('player', 'screen'):
self.screen = conf.getint('player', 'screen')
if conf.has_option('player', 'covers'):
self.show_covers = conf.getboolean('player', 'covers')
if conf.has_option('player', 'covers_type'):
self.covers_type = conf.getint('player', 'covers_type')
if conf.has_option('player', 'stop_on_exit'):
self.stop_on_exit = conf.getboolean('player', 'stop_on_exit')
if conf.has_option('player', 'minimize'):
self.minimize_to_systray = conf.getboolean('player', 'minimize')
if conf.has_option('player', 'initial_run'):
self.initial_run = conf.getboolean('player', 'initial_run')
if conf.has_option('player', 'statusbar'):
self.show_statusbar = conf.getboolean('player', 'statusbar')
if conf.has_option('player', 'lyrics'):
self.show_lyrics = conf.getboolean('player', 'lyrics')
if conf.has_option('player', 'sticky'):
self.sticky = conf.getboolean('player', 'sticky')
if conf.has_option('player', 'ontop'):
self.ontop = conf.getboolean('player', 'ontop')
if conf.has_option('player', 'notification'):
self.show_notification = conf.getboolean('player', 'notification')
if conf.has_option('player', 'popup_time'):
self.popup_option = conf.getint('player', 'popup_time')
if conf.has_option('player', 'update_on_start'):
self.update_on_start = conf.getboolean('player', 'update_on_start')
if conf.has_option('player', 'notif_location'):
if not skip_gui:
self.traytips.notifications_location = conf.getint('player', 'notif_location')
if conf.has_option('player', 'playback'):
self.show_playback = conf.getboolean('player', 'playback')
if conf.has_option('player', 'progressbar'):
self.show_progress = conf.getboolean('player', 'progressbar')
if conf.has_option('player', 'crossfade'):
crossfade = conf.getint('player', 'crossfade')
# Backwards compatibility:
self.xfade = [1,2,3,5,10,15][crossfade]
if conf.has_option('player', 'xfade'):
self.xfade = conf.getint('player', 'xfade')
if conf.has_option('player', 'xfade_enabled'):
self.xfade_enabled = conf.getboolean('player', 'xfade_enabled')
if conf.has_option('player', 'covers_pref'):
self.covers_pref = conf.getint('player', 'covers_pref')
# Specifying remote artwork first is too confusing and probably
# rarely used, so we're removing this option and defaulting users
# back to the default 'local, then remote' option.
if self.covers_pref > self.ART_LOCAL_REMOTE:
self.covers_pref = self.ART_LOCAL_REMOTE
if conf.has_option('player', 'use_infofile'):
self.use_infofile = conf.getboolean('player', 'use_infofile')
if conf.has_option('player', 'infofile_path'):
self.infofile_path = conf.get('player', 'infofile_path')
if conf.has_option('player', 'trayicon'):
self.show_trayicon = conf.getboolean('player', 'trayicon')
if conf.has_option('player', 'view'):
self.lib_view = conf.getint('player', 'view')
if conf.has_option('player', 'search_num'):
self.last_search_num = conf.getint('player', 'search_num')
if conf.has_option('player', 'art_location'):
self.art_location = conf.getint('player', 'art_location')
if conf.has_option('player', 'art_location_custom_filename'):
self.art_location_custom_filename = conf.get('player', 'art_location_custom_filename')
if conf.has_option('player', 'lyrics_location'):
self.lyrics_location = conf.getint('player', 'lyrics_location')
if conf.has_option('player', 'info_song_expanded'):
self.info_song_expanded = conf.getboolean('player', 'info_song_expanded')
if conf.has_option('player', 'info_lyrics_expanded'):
self.info_lyrics_expanded = conf.getboolean('player', 'info_lyrics_expanded')
if conf.has_option('player', 'info_album_expanded'):
self.info_album_expanded = conf.getboolean('player', 'info_album_expanded')
if conf.has_option('player', 'info_song_more'):
self.info_song_more = conf.getboolean('player', 'info_song_more')
if conf.has_option('player', 'columnwidths'):
self.columnwidths = conf.get('player', 'columnwidths').split(",")
for col in range(len(self.columnwidths)):
self.columnwidths[col] = int(self.columnwidths[col])
self.colwidthpercents = [0] * len(self.columnwidths)
if conf.has_option('player', 'show_header'):
self.show_header = conf.getboolean('player', 'show_header')
if conf.has_option('player', 'tabs_expanded'):
self.tabs_expanded = conf.getboolean('player', 'tabs_expanded')
if conf.has_option('player', 'browser'):
self.url_browser = conf.get('player', 'browser')
if conf.has_option('player', 'info_art_enlarged'):
self.info_art_enlarged = conf.getboolean('player', 'info_art_enlarged')
if conf.has_option('player', 'existing_playlist'):
self.existing_playlist_option = conf.getint('player', 'existing_playlist')
if conf.has_section('notebook'):
if conf.has_option('notebook', 'current_tab_visible'):
self.current_tab_visible = conf.getboolean('notebook', 'current_tab_visible')
if conf.has_option('notebook', 'library_tab_visible'):
self.library_tab_visible = conf.getboolean('notebook', 'library_tab_visible')
if conf.has_option('notebook', 'playlists_tab_visible'):
self.playlists_tab_visible = conf.getboolean('notebook', 'playlists_tab_visible')
if conf.has_option('notebook', 'streams_tab_visible'):
self.streams_tab_visible = conf.getboolean('notebook', 'streams_tab_visible')
if conf.has_option('notebook', 'info_tab_visible'):
self.info_tab_visible = conf.getboolean('notebook', 'info_tab_visible')
if conf.has_option('notebook', 'current_tab_pos'):
try: self.current_tab_pos = conf.getint('notebook', 'current_tab_pos')
except: pass
if conf.has_option('notebook', 'library_tab_pos'):
try: self.library_tab_pos = conf.getint('notebook', 'library_tab_pos')
except: pass
if conf.has_option('notebook', 'playlists_tab_pos'):
try: self.playlists_tab_pos = conf.getint('notebook', 'playlists_tab_pos')
except: pass
if conf.has_option('notebook', 'streams_tab_pos'):
try: self.streams_tab_pos = conf.getint('notebook', 'streams_tab_pos')
except: pass
if conf.has_option('notebook', 'info_tab_pos'):
try: self.info_tab_pos = conf.getint('notebook', 'info_tab_pos')
except: pass