Changeset 5042
- Timestamp:
- 2003-07-25T16:49:22+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/Preferences.java
r4675 r5042 3 3 import java.awt.*; 4 4 import java.awt.event.*; 5 import java.net.*; 5 6 import java.util.*; 6 7 import javax.swing.*; … … 33 34 private JCheckBox workflow_preview; 34 35 private JTabbedPane tab_pane; 36 private JTextField library_path_field; 35 37 private JTextField proxy_host_field; 36 38 private JTextField proxy_port_field; … … 97 99 98 100 private JPanel createConnectionPreferences() { 101 JPanel library_path_pane = new JPanel(); 102 library_path_pane.setPreferredSize(ROW_SIZE); 103 JLabel library_path_label = new JLabel("Preferences.Connection.Library_Path"); 104 library_path_label.setPreferredSize(LABEL_SIZE); 105 library_path_field = new JTextField(Gatherer.config.getString("general.exec_address", true)); 106 library_path_field.setCaretPosition(0); 107 99 108 boolean currently_enabled = Gatherer.config.get("general.use_proxy", true); 100 109 // Creation … … 116 125 117 126 // Connection 127 Gatherer.dictionary.register(library_path_label, null, false); 118 128 Gatherer.dictionary.register(use_proxy_checkbox, null, false); 119 129 Gatherer.dictionary.register(proxy_host_label, null, false); … … 121 131 use_proxy_checkbox.addActionListener(new UseProxyListener()); 122 132 // Layout 133 library_path_pane.setLayout(new BorderLayout()); 134 library_path_pane.add(library_path_label, BorderLayout.WEST); 135 library_path_pane.add(library_path_field, BorderLayout.CENTER); 136 123 137 proxy_host_pane.setLayout(new BorderLayout()); 124 138 proxy_host_pane.add(proxy_host_label, BorderLayout.WEST); … … 130 144 131 145 connection_pane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); 146 connection_pane.add(library_path_pane); 132 147 connection_pane.add(use_proxy_checkbox); 133 148 connection_pane.add(proxy_host_pane); … … 275 290 // Submit the various changes. 276 291 // Connection preferences 292 String library_path_string = library_path_field.getText(); 293 Gatherer.config.setString("general.exec_address", true, library_path_string); 294 if (!library_path_string.equals("")) { 295 try { 296 Gatherer.config.exec_address = new URL(library_path_string); 297 } 298 catch (MalformedURLException error) { 299 ///ystem.err.println("Error: Bad address: " + exec_address_string); 300 } 301 } 302 277 303 Gatherer.config.set("general.use_proxy", true, use_proxy_checkbox.isSelected()); 278 304 Gatherer.config.setString("general.proxy_host", true, proxy_host_field.getText());
Note:
See TracChangeset
for help on using the changeset viewer.