From c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 12 Feb 2026 22:33:32 -0800 Subject: Initial commit --- NET/worlds/console/ProxyServerDialog.java | 63 +++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 NET/worlds/console/ProxyServerDialog.java (limited to 'NET/worlds/console/ProxyServerDialog.java') diff --git a/NET/worlds/console/ProxyServerDialog.java b/NET/worlds/console/ProxyServerDialog.java new file mode 100644 index 0000000..310a9a8 --- /dev/null +++ b/NET/worlds/console/ProxyServerDialog.java @@ -0,0 +1,63 @@ +package NET.worlds.console; + +import NET.worlds.core.IniFile; +import java.awt.GridBagConstraints; +import java.awt.Label; +import java.awt.TextField; +import java.util.Properties; + +class ProxyServerDialog extends OkCancelDialog { + private static final long serialVersionUID = 8421990344972629940L; + private Label ipLabel = new Label("Proxy IP"); + private TextField ipText = new TextField("", 15); + private Label portLabel = new Label("Proxy Port"); + private TextField portText = new TextField("", 3); + + public ProxyServerDialog() { + super(Console.getFrame(), null, Console.message("Proxy-Server"), "Cancel", "Ok", "", false); + this.ipText.setText(IniFile.gamma().getIniString("Proxy Server IP", "")); + this.portText.setText(IniFile.gamma().getIniString("Proxy Server Port", "")); + } + + @Override + protected synchronized boolean done(boolean confirmed) { + if (confirmed) { + Properties p = System.getProperties(); + IniFile.gamma().setIniString("Proxy Server IP", this.ipText.getText()); + IniFile.gamma().setIniString("Proxy Server Port", this.portText.getText()); + p.remove("socksProxyHost"); + p.remove("socksProxyPort"); + p.put("socksProxyHost", this.ipText.getText()); + p.put("socksProxyPort", this.portText.getText()); + System.setProperties(p); + } + + return super.done(confirmed); + } + + @Override + public void build() { + GridBagConstraints c = new GridBagConstraints(); + c.gridx = 1; + c.gridy = 1; + c.weightx = 1.0; + c.weighty = 1.0; + this.add(this.gbag, this.ipLabel, c); + c.gridy = 2; + this.add(this.gbag, this.portLabel, c); + c.gridx = 2; + c.gridy = 1; + c.weightx = 3.0; + this.add(this.gbag, this.ipText, c); + c.gridy = 2; + this.add(this.gbag, this.portText, c); + this.okButton.setFont(bfont); + this.cancelButton.setFont(bfont); + c.gridx = 1; + c.gridy = 3; + c.weightx = 1.0; + this.add(this.gbag, this.okButton, c); + c.gridx = 4; + this.add(this.gbag, this.cancelButton, c); + } +} -- cgit v1.2.3