When fetching a theme, if theme config key is not found, write out the default

This is required in order to get the theme config keys of the various apps into
themes.config; this way, the routerconsole requires no knowledge of what apps
support universal theming, and can just blanket apply themes to all known keys.
This commit is contained in:
str4d
2012-07-22 13:13:43 +00:00
parent 6be94658a7
commit a7c8a7201a
4 changed files with 33 additions and 8 deletions

View File

@ -289,7 +289,14 @@ public class SnarkManager implements Snark.CompleteListener {
if (!_config.containsKey(PROP_STARTUP_DELAY))
_config.setProperty(PROP_STARTUP_DELAY, Integer.toString(DEFAULT_STARTUP_DELAY));
// Fetch theme
_theme = _context.readConfigFile(THEME_CONFIG_FILE).getProperty(PROP_THEME, DEFAULT_THEME);
Properties themeProps = _context.readConfigFile(THEME_CONFIG_FILE);
_theme = themeProps.getProperty(PROP_THEME);
// Ensure that theme config line exists in config file
if (_theme == null) {
_theme = DEFAULT_THEME;
themeProps.put(PROP_THEME, _theme);
_context.writeConfigFile(THEME_CONFIG_FILE, themeProps);
}
updateConfig();
}
/**