Author: nextgens
Date: 2006-08-16 20:30:10 +0000 (Wed, 16 Aug 2006)
New Revision: 10130

Modified:
   trunk/freenet/src/freenet/clients/http/QueueToadlet.java
   trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
Log:
implement a new configuration option about showing the panic button or not on 
the /queue/ page ... the default beeing not to show it

Modified: trunk/freenet/src/freenet/clients/http/QueueToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/QueueToadlet.java    2006-08-16 
20:13:20 UTC (rev 10129)
+++ trunk/freenet/src/freenet/clients/http/QueueToadlet.java    2006-08-16 
20:30:10 UTC (rev 10130)
@@ -18,7 +18,6 @@
 import freenet.node.RequestStarter;
 import freenet.node.fcp.ClientGet;
 import freenet.node.fcp.ClientPut;
-import freenet.node.fcp.ClientPutBase;
 import freenet.node.fcp.ClientPutDir;
 import freenet.node.fcp.ClientPutMessage;
 import freenet.node.fcp.ClientRequest;
@@ -375,7 +374,7 @@
                        legendRow.addChild("td", "class", "priority" + i, 
"Priority " + i);
                }

-               if (reqs.length > 1) {
+               if (reqs.length > 1 && 
SimpleToadletServer.isPanicButtonToBeShown) {
                        contentNode.addChild(createPanicBox(pageMaker));
                }


Modified: trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java     
2006-08-16 20:13:20 UTC (rev 10129)
+++ trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java     
2006-08-16 20:30:10 UTC (rev 10130)
@@ -55,6 +55,7 @@
        private boolean advancedDarknetEnabled;
        private final PageMaker pageMaker;

+       static boolean isPanicButtonToBeShown;
        static final int DEFAULT_FPROXY_PORT = 8888;

        class FProxyPortCallback implements IntCallback {
@@ -221,7 +222,19 @@
                                new FProxyCSSNameCallback());
                fproxyConfig.register("advancedDarknetEnabled", false, 1, 
false, "Enable Advanced Darknet?", "Whether to show or not informations meant 
for advanced users/devs. This setting should be turned to false in most cases.",
                                new FProxyAdvancedDarknetEnabledCallback(this));
-
+               fproxyConfig.register("showPanicButton", false, 1, true, "Show 
the panic button?", "Whether to show or not the panic button on the /queue/ 
page.",
+                               new BooleanCallback(){
+                               public boolean get(){
+                                       return 
SimpleToadletServer.isPanicButtonToBeShown;
+                               }
+                       
+                               public void set(boolean value){
+                                       if(value == 
SimpleToadletServer.isPanicButtonToBeShown) return;
+                                       else    
SimpleToadletServer.isPanicButtonToBeShown = value;
+                               }
+               });
+               
+               SimpleToadletServer.isPanicButtonToBeShown = 
fproxyConfig.getBoolean("showPanicButton");
                this.bf = core.tempBucketFactory;
                port = fproxyConfig.getInt("port");
                bindTo = fproxyConfig.getString("bindTo");


Reply via email to