translate theme when we upgrade config file and check be sure that the current roster_theme exists
This commit is contained in:
parent
0bb2e5c1d0
commit
e7d7200e04
|
@ -145,16 +145,24 @@ class OptionsParser:
|
||||||
'accountfontattrs', 'grouptextcolor', 'groupbgcolor', 'groupfont',
|
'accountfontattrs', 'grouptextcolor', 'groupbgcolor', 'groupfont',
|
||||||
'groupfontattrs', 'contacttextcolor', 'contactbgcolor', 'contactfont',
|
'groupfontattrs', 'contacttextcolor', 'contactbgcolor', 'contactfont',
|
||||||
'contactfontattrs', 'bannertextcolor', 'bannerbgcolor']
|
'contactfontattrs', 'bannertextcolor', 'bannerbgcolor']
|
||||||
for theme_name in ('grocery', 'plain'):
|
for theme_name in (_('grocery'), _('plain')):
|
||||||
if theme_name not in gajim.config.get_per('themes'):
|
if theme_name not in gajim.config.get_per('themes'):
|
||||||
gajim.config.add_per('themes', theme_name)
|
gajim.config.add_per('themes', theme_name)
|
||||||
theme = gajim.config.themes_default[theme_name]
|
theme = gajim.config.themes_default[theme_name]
|
||||||
for o in d:
|
for o in d:
|
||||||
gajim.config.set_per('themes', theme_name, o, theme[d.index(o)])
|
gajim.config.set_per('themes', theme_name, o, theme[d.index(o)])
|
||||||
# Remove cyan theme if it's not the current theme
|
# Remove cyan theme if it's not the current theme
|
||||||
if gajim.config.get('roster_theme') != 'cyan' and \
|
if 'cyan' in gajim.config.get_per('themes'):
|
||||||
'cyan' in gajim.config.get_per('themes'):
|
|
||||||
gajim.config.del_per('themes', 'cyan')
|
gajim.config.del_per('themes', 'cyan')
|
||||||
|
if _('cyan') in gajim.config.get_per('themes'):
|
||||||
|
gajim.config.del_per('themes', _('cyan'))
|
||||||
|
# If we removed our roster_theme, choose the default green one or another
|
||||||
|
# one if doesn't exists in config
|
||||||
|
if gajim.config.get('roster_theme') not in gajim.config.get_per('themes'):
|
||||||
|
theme = _('green')
|
||||||
|
if theme not in gajim.config.get_per('themes'):
|
||||||
|
theme = gajim.config.get_per('themes')[0]
|
||||||
|
gajim.config.set('roster_theme', theme)
|
||||||
# new proxies in accounts.name.file_transfer_proxies
|
# new proxies in accounts.name.file_transfer_proxies
|
||||||
for account in gajim.config.get_per('accounts'):
|
for account in gajim.config.get_per('accounts'):
|
||||||
proxies = gajim.config.get_per('accounts', account,
|
proxies = gajim.config.get_per('accounts', account,
|
||||||
|
|
Loading…
Reference in New Issue