From 7ba6f5a7553bd47b19b6486078c981834aabb551 Mon Sep 17 00:00:00 2001 From: zzz Date: Fri, 15 Jul 2011 21:41:38 +0000 Subject: [PATCH] add gui option --- .../java/src/net/i2p/i2ptunnel/web/EditBean.java | 6 ++++++ .../src/net/i2p/i2ptunnel/web/IndexBean.java | 16 +++++++++++++++- apps/i2ptunnel/jsp/editClient.jsp | 9 +++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java index 63f119bca..100e87bb6 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java @@ -21,6 +21,7 @@ import net.i2p.data.Signature; import net.i2p.data.SigningPrivateKey; import net.i2p.i2ptunnel.I2PTunnelHTTPClient; import net.i2p.i2ptunnel.I2PTunnelHTTPClientBase; +import net.i2p.i2ptunnel.I2PTunnelIRCClient; import net.i2p.i2ptunnel.TunnelController; import net.i2p.i2ptunnel.TunnelControllerGroup; import net.i2p.util.Addresses; @@ -170,6 +171,11 @@ public class EditBean extends IndexBean { return getBooleanProperty(tunnel, "i2cp.encryptLeaseSet"); } + /** @since 0.8.9 */ + public boolean getDCC(int tunnel) { + return getBooleanProperty(tunnel, I2PTunnelIRCClient.PROP_DCC); + } + public String getEncryptKey(int tunnel) { return getProperty(tunnel, "i2cp.leaseSetKey", ""); } 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 eb36a64bc..c69a03e09 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java @@ -27,6 +27,7 @@ import net.i2p.data.PrivateKeyFile; import net.i2p.data.SessionKey; import net.i2p.i2ptunnel.I2PTunnelHTTPClient; import net.i2p.i2ptunnel.I2PTunnelHTTPClientBase; +import net.i2p.i2ptunnel.I2PTunnelIRCClient; import net.i2p.i2ptunnel.TunnelController; import net.i2p.i2ptunnel.TunnelControllerGroup; import net.i2p.util.ConcurrentHashSet; @@ -675,6 +676,11 @@ public class IndexBean { _booleanOptions.add("i2cp.encryptLeaseSet"); } + /** @since 0.8.9 */ + public void setDCC(String moo) { + _booleanOptions.add(I2PTunnelIRCClient.PROP_DCC); + } + protected static final String PROP_ENABLE_ACCESS_LIST = "i2cp.enableAccessList"; protected static final String PROP_ENABLE_BLACKLIST = "i2cp.enableBlackList"; @@ -980,13 +986,20 @@ public class IndexBean { else config.setProperty("interface", ""); } + + if ("ircclient".equals(_type)) { + config.setProperty("option." + I2PTunnelIRCClient.PROP_DCC, + "" + _booleanOptions.contains(I2PTunnelIRCClient.PROP_DCC)); + } + return config; } private static final String _noShowOpts[] = { "inbound.length", "outbound.length", "inbound.lengthVariance", "outbound.lengthVariance", "inbound.backupQuantity", "outbound.backupQuantity", "inbound.quantity", "outbound.quantity", - "inbound.nickname", "outbound.nickname", "i2p.streaming.connectDelay", "i2p.streaming.maxWindowSize" + "inbound.nickname", "outbound.nickname", "i2p.streaming.connectDelay", "i2p.streaming.maxWindowSize", + I2PTunnelIRCClient.PROP_DCC }; private static final String _booleanClientOpts[] = { "i2cp.reduceOnIdle", "i2cp.closeOnIdle", "i2cp.newDestOnResume", "persistentClientKey", "i2cp.delayOpen" @@ -1008,6 +1021,7 @@ public class IndexBean { PROP_MAX_TOTAL_CONNS_MIN, PROP_MAX_TOTAL_CONNS_HOUR, PROP_MAX_TOTAL_CONNS_DAY, PROP_MAX_STREAMS }; + protected static final Set _noShowSet = new HashSet(64); static { _noShowSet.addAll(Arrays.asList(_noShowOpts)); diff --git a/apps/i2ptunnel/jsp/editClient.jsp b/apps/i2ptunnel/jsp/editClient.jsp index b95452b12..ad2d14aa2 100644 --- a/apps/i2ptunnel/jsp/editClient.jsp +++ b/apps/i2ptunnel/jsp/editClient.jsp @@ -173,6 +173,15 @@ class="tickbox" /> <%=intl._("(Check the Box for 'YES')")%> + <% if ("ircclient".equals(tunnelType)) { %> +
+ + class="tickbox" /> + <%=intl._("(Check the Box for 'YES')")%> +
+ <% } // ircclient %>