diff --git a/apps/susidns/src/java/src/i2p/susi/dns/BaseBean.java b/apps/susidns/src/java/src/i2p/susi/dns/BaseBean.java index a5cc49e2da2bccdd0990ed2972689f8f0be1d6eb..7d229cd84133694716e83ccfc2f0327705da6c4b 100644 --- a/apps/susidns/src/java/src/i2p/susi/dns/BaseBean.java +++ b/apps/susidns/src/java/src/i2p/susi/dns/BaseBean.java @@ -4,24 +4,30 @@ import java.io.FileInputStream; import java.io.IOException; import java.util.Properties; +import net.i2p.I2PAppContext; + /** * Holds methods common to several Beans. * @since 0.9.1 */ public class BaseBean { + private final I2PAppContext _context; protected final Properties properties; + private String _theme; private long configLastLoaded = 0; private static final String PRIVATE_BOOK = "private_addressbook"; private static final String DEFAULT_PRIVATE_BOOK = "../privatehosts.txt"; - public static final String PROP_THEME_NAME = "theme"; + public static final String THEME_CONFIG_FILE = "themes.config"; + public static final String PROP_THEME_NAME = "susidns.theme"; public static final String DEFAULT_THEME = "light"; public static final String BASE_THEME_PATH = "/themes/susidns/"; public BaseBean() { + _context = I2PAppContext.getGlobalContext(); properties = new Properties(); } @@ -40,6 +46,8 @@ public class BaseBean // added in 0.5, for compatibility with 0.4 config.txt 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); configLastLoaded = currentTime; } catch (Exception e) { @@ -57,8 +65,7 @@ public class BaseBean public String getTheme() { loadConfig(); String url = BASE_THEME_PATH; - String theme = properties.getProperty(PROP_THEME_NAME, DEFAULT_THEME); - url += theme + "/"; + url += _theme + "/"; return url; } } diff --git a/apps/susidns/src/jsp/config.jsp b/apps/susidns/src/jsp/config.jsp index 95e904c3a3f9b5530d3b30cc7c88490c7afcd6d1..10cc5958086f18ec309b9be9aa86a4e6b0235131 100644 --- a/apps/susidns/src/jsp/config.jsp +++ b/apps/susidns/src/jsp/config.jsp @@ -130,9 +130,6 @@ <li><b>log</b> - <%=intl._("File to log activity to (change to /dev/null if you like)")%> </li> -<li><b>theme</b> - -<%=intl._("Name of the theme to use (defaults to 'light')")%> -</li> </ul> </div><hr> <div id="footer">