summaryrefslogtreecommitdiff
path: root/NET/worlds/console/ProxyServerDialog.java
blob: adc62f0bfe26df28e9768071592c6398a42110eb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*    */ package NET.worlds.console;
/*    */ 
/*    */ import NET.worlds.core.IniFile;
/*    */ import java.awt.Button;
/*    */ 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;
/* 23 */   private Label ipLabel = new Label("Proxy IP");
/* 24 */   private TextField ipText = new TextField("", 15);
/* 25 */   private Label portLabel = new Label("Proxy Port");
/* 26 */   private TextField portText = new TextField("", 3);
/*    */   
/*    */   public ProxyServerDialog()
/*    */   {
/* 30 */     super(Console.getFrame(), null, Console.message("Proxy-Server"), "Cancel", "Ok", "", false);
/* 31 */     this.ipText.setText(IniFile.gamma().getIniString("Proxy Server IP", ""));
/* 32 */     this.portText.setText(IniFile.gamma().getIniString("Proxy Server Port", ""));
/*    */   }
/*    */   
/*    */   protected synchronized boolean done(boolean confirmed)
/*    */   {
/* 37 */     if (confirmed) {
/* 38 */       Properties p = System.getProperties();
/* 39 */       IniFile.gamma().setIniString("Proxy Server IP", this.ipText.getText());
/* 40 */       IniFile.gamma().setIniString("Proxy Server Port", 
/* 41 */         this.portText.getText());
/* 42 */       p.remove("socksProxyHost");
/* 43 */       p.remove("socksProxyPort");
/* 44 */       p.put("socksProxyHost", this.ipText.getText());
/* 45 */       p.put("socksProxyPort", this.portText.getText());
/* 46 */       System.setProperties(p);
/*    */     }
/*    */     
/* 49 */     return super.done(confirmed);
/*    */   }
/*    */   
/*    */   public void build()
/*    */   {
/* 54 */     GridBagConstraints c = new GridBagConstraints();
/*    */     
/* 56 */     c.gridx = 1;
/* 57 */     c.gridy = 1;
/* 58 */     c.weightx = 1.0D;
/* 59 */     c.weighty = 1.0D;
/*    */     
/* 61 */     add(this.gbag, this.ipLabel, c);
/*    */     
/* 63 */     c.gridy = 2;
/* 64 */     add(this.gbag, this.portLabel, c);
/*    */     
/* 66 */     c.gridx = 2;
/* 67 */     c.gridy = 1;
/* 68 */     c.weightx = 3.0D;
/* 69 */     add(this.gbag, this.ipText, c);
/*    */     
/* 71 */     c.gridy = 2;
/* 72 */     add(this.gbag, this.portText, c);
/*    */     
/* 74 */     this.okButton.setFont(bfont);
/* 75 */     this.cancelButton.setFont(bfont);
/*    */     
/* 77 */     c.gridx = 1;
/* 78 */     c.gridy = 3;
/* 79 */     c.weightx = 1.0D;
/* 80 */     add(this.gbag, this.okButton, c);
/*    */     
/* 82 */     c.gridx = 4;
/* 83 */     add(this.gbag, this.cancelButton, c);
/*    */   }
/*    */ }


/* Location:              C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\ProxyServerDialog.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */