From 6be94658a769efcbca2b6d9c8365df60cb485248 Mon Sep 17 00:00:00 2001 From: str4d Date: Sun, 22 Jul 2012 11:33:20 +0000 Subject: [PATCH] Use router console theme setting from themes.config in i2ptunnel --- .../java/src/net/i2p/i2ptunnel/web/IndexBean.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java index 75991e393..c329e1e33 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java @@ -45,6 +45,7 @@ import net.i2p.util.Log; */ public class IndexBean { protected final I2PAppContext _context; + private String _theme; protected final Log _log; protected final TunnelControllerGroup _group; private String _action; @@ -99,7 +100,8 @@ public class IndexBean { private static final List _nonces = new ArrayList(MAX_NONCES + 1); static final String CLIENT_NICKNAME = "shared clients"; - public static final String PROP_THEME_NAME = "routerconsole.theme"; + public static final String THEME_CONFIG_FILE = "themes.config"; + public static final String PROP_THEME = "routerconsole.theme"; public static final String DEFAULT_THEME = "light"; public static final String PROP_CSS_DISABLED = "routerconsole.css.disabled"; public static final String PROP_JS_DISABLED = "routerconsole.javascript.disabled"; @@ -113,6 +115,7 @@ public class IndexBean { addNonce(); _booleanOptions = new ConcurrentHashSet(4); _otherOptions = new ConcurrentHashMap(4); + _theme = _context.readConfigFile(THEME_CONFIG_FILE).getProperty(PROP_THEME, DEFAULT_THEME); } public static String getNextNonce() { @@ -393,8 +396,7 @@ public class IndexBean { //// public String getTheme() { - String theme = _context.getProperty(PROP_THEME_NAME, DEFAULT_THEME); - return "/themes/console/" + theme + "/"; + return "/themes/console/" + _theme + "/"; } public boolean allowCSS() {