I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 238ab910 authored by str4d's avatar str4d
Browse files

Implement full tunnel wizard model

parent 0af8ed90
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ package net.i2p.android.i2ptunnel.activity; ...@@ -3,7 +3,7 @@ package net.i2p.android.i2ptunnel.activity;
import android.content.Context; import android.content.Context;
import net.i2p.android.wizard.model.AbstractWizardModel; import net.i2p.android.wizard.model.AbstractWizardModel;
import net.i2p.android.wizard.model.BranchPage; import net.i2p.android.wizard.model.BranchPage;
import net.i2p.android.wizard.model.MultipleFixedChoicePage; import net.i2p.android.wizard.model.Conditional;
import net.i2p.android.wizard.model.PageList; import net.i2p.android.wizard.model.PageList;
import net.i2p.android.wizard.model.SingleFixedBooleanPage; import net.i2p.android.wizard.model.SingleFixedBooleanPage;
import net.i2p.android.wizard.model.SingleFixedChoicePage; import net.i2p.android.wizard.model.SingleFixedChoicePage;
...@@ -16,32 +16,49 @@ public class TunnelWizardModel extends AbstractWizardModel { ...@@ -16,32 +16,49 @@ public class TunnelWizardModel extends AbstractWizardModel {
@Override @Override
protected PageList onNewRootPageList() { protected PageList onNewRootPageList() {
Conditional cTunnelType = new Conditional();
Conditional cClientType = new Conditional();
Conditional cServerType = new Conditional();
return new PageList( return new PageList(
new BranchPage(this, "Client or Server") new BranchPage(this, "Client or Server")
.addBranch("Client tunnel", .addBranch("Client tunnel",
new SingleFixedChoicePage(this, "Tunnel type") new SingleFixedChoicePage(this, "Tunnel type")
.setChoices("Standard", "HTTP", "IRC", "SOCKS 4/4a/5", "SOCKS IRC", "CONNECT", "Streamr") .setChoices("Standard", "HTTP", "IRC", "SOCKS 4/4a/5", "SOCKS IRC", "CONNECT", "Streamr")
.setRequired(true)) .setRequired(true)
.makeConditional(cClientType))
.addBranch("Server tunnel", .addBranch("Server tunnel",
new SingleFixedChoicePage(this, "Tunnel type") new SingleFixedChoicePage(this, "Tunnel type")
.setChoices("Standard", "HTTP", "HTTP bidir", "IRC", "Streamr") .setChoices("Standard", "HTTP", "HTTP bidir", "IRC", "Streamr")
.setRequired(true)) .setRequired(true)
.setRequired(true), .makeConditional(cServerType))
.setRequired(true)
.makeConditional(cTunnelType),
new SingleTextFieldPage(this, "Name") new SingleTextFieldPage(this, "Name")
.setDescription("The name of the tunnel, for identification in the tunnel list.") .setDescription("The name of the tunnel, for identification in the tunnel list.")
.setRequired(true), .setRequired(true),
new SingleTextFieldPage(this, "Description") new SingleTextFieldPage(this, "Description")
.setDescription("A description of the tunnel. This is optional and purely informative."), .setDescription("A description of the tunnel. This is optional and purely informative."),
new SingleTextFieldPage(this, "Destination") new SingleTextFieldPage(this, "Destination")
.setDescription("Type in the I2P destination of the service that this client tunnel should connect to. This could be the full base 64 destination key, or an I2P URL from your address book."), .setDescription("Type in the I2P destination of the service that this client tunnel should connect to. This could be the full base 64 destination key, or an I2P URL from your address book.")
new SingleTextFieldPage(this, "Reachable on") .setEqualAnyCondition(cClientType, "Standard", "IRC", "Streamr"),
.setDescription("This limits what computers or smartphones can access this tunnel."), new SingleTextFieldPage(this, "Outproxies")
new SingleTextFieldPage(this, "Binding port") .setDescription("If you know of any outproxies for this type of tunnel (either HTTP or SOCKS), fill them in. Separate multiple proxies with commas.")
.setDescription("This is the port that the client tunnel will be accessed from locally. This is also the client port for the HTTP bidir server tunnel."), .setEqualAnyCondition(cClientType, "HTTP", "CONNECT", "SOCKS 4/4a/5", "SOCKS IRC"),
new SingleTextFieldPage(this, "Target host") new SingleTextFieldPage(this, "Target host")
.setDescription("This is the IP that your service is running on, this is usually on the same machine so 127.0.0.1 is autofilled."), .setDescription("This is the IP that your service is running on, this is usually on the same machine so 127.0.0.1 is autofilled.")
.setEqualCondition(cClientType, "Streamr")
.setEqualAnyCondition(cServerType, "Standard", "HTTP", "HTTP bidir", "IRC"),
new SingleTextFieldPage(this, "Target port") new SingleTextFieldPage(this, "Target port")
.setDescription("This is the port that the service is accepting connections on."), .setDescription("This is the port that the service is accepting connections on.")
.setEqualCondition(cTunnelType, "Server tunnel"),
new SingleTextFieldPage(this, "Reachable on")
.setDescription("This limits what computers or smartphones can access this tunnel.")
.setEqualAnyCondition(cClientType, "Standard", "HTTP", "IRC", "SOCKS 4/4a/5", "SOCKS IRC", "CONNECT")
.setEqualAnyCondition(cServerType, "HTTP bidir", "Streamr"),
new SingleTextFieldPage(this, "Binding port")
.setDescription("This is the port that the client tunnel will be accessed from locally. This is also the client port for the HTTP bidir server tunnel.")
.setEqualCondition(cTunnelType, "Client tunnel")
.setEqualCondition(cServerType, "HTTP bidir"),
new SingleFixedBooleanPage(this, "Auto start") new SingleFixedBooleanPage(this, "Auto start")
.setDescription("Should the tunnel automatically start when the router starts?") .setDescription("Should the tunnel automatically start when the router starts?")
.setRequired(true) .setRequired(true)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment