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

@@ -47,7 +47,14 @@ public class BaseBean
if( properties.getProperty(PRIVATE_BOOK) == null)
properties.setProperty(PRIVATE_BOOK, DEFAULT_PRIVATE_BOOK);
// Fetch theme
_theme = _context.readConfigFile(THEME_CONFIG_FILE).getProperty(PROP_THEME_NAME, DEFAULT_THEME);
Properties themeProps = _context.readConfigFile(THEME_CONFIG_FILE);
_theme = themeProps.getProperty(PROP_THEME_NAME);
// Ensure that theme config line exists in config file
if (_theme == null) {
_theme = DEFAULT_THEME;
themeProps.put(PROP_THEME_NAME, _theme);
_context.writeConfigFile(THEME_CONFIG_FILE, themeProps);
}
configLastLoaded = currentTime;
}
catch (Exception e) {