diff options
author | Damian Minkov <damencho@jitsi.org> | 2010-03-17 17:25:14 +0000 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2010-03-17 17:25:14 +0000 |
commit | 67106df9d350bbb8eeb8fe9f8ff010fdc78ce8e8 (patch) | |
tree | f0d41ddd5283fa31561e836048e87c20d4cd92bf /src/net/java/sip/communicator/plugin/aimaccregwizz | |
parent | 96fe4b483e7fbaa9cc84e5fab89dec43c4c682f0 (diff) | |
download | jitsi-67106df9d350bbb8eeb8fe9f8ff010fdc78ce8e8.zip jitsi-67106df9d350bbb8eeb8fe9f8ff010fdc78ce8e8.tar.gz jitsi-67106df9d350bbb8eeb8fe9f8ff010fdc78ce8e8.tar.bz2 |
Add global proxy config. Add support for the global proxy config in protocols like ICQ/AIM and Jabber.
Diffstat (limited to 'src/net/java/sip/communicator/plugin/aimaccregwizz')
3 files changed, 17 insertions, 243 deletions
diff --git a/src/net/java/sip/communicator/plugin/aimaccregwizz/AimAccountRegistration.java b/src/net/java/sip/communicator/plugin/aimaccregwizz/AimAccountRegistration.java index 2b4ab7b..c02f3d4 100644 --- a/src/net/java/sip/communicator/plugin/aimaccregwizz/AimAccountRegistration.java +++ b/src/net/java/sip/communicator/plugin/aimaccregwizz/AimAccountRegistration.java @@ -35,16 +35,6 @@ public class AimAccountRegistration */ private boolean rememberPassword = true; - private String proxyPort; - - private String proxy; - - private String proxyType = "http"; - - private String proxyUsername; - - private String proxyPassword; - /** * Returns the password of the aim registration account. * @return the password of the aim registration account. @@ -104,94 +94,4 @@ public class AimAccountRegistration { this.uin = uin; } - - /** - * Returns the proxy that will be used for this aim account. - * @return the proxy that will be used for this aim account. - */ - public String getProxy() - { - return proxy; - } - - /** - * Sets the proxy for this aim account. - * @param proxy the proxy for this aim account. - */ - public void setProxy(String proxy) - { - this.proxy = proxy; - } - - /** - * Returns the proxy port that will be used for this aim account. - * @return the proxy port that will be used for this aim account. - */ - public String getProxyPort() - { - return proxyPort; - } - - /** - * Sets the proxy port for this aim account. - * @param proxyPort the proxy port for this aim account. - */ - public void setProxyPort(String proxyPort) - { - this.proxyPort = proxyPort; - } - - /** - * Returns the proxy type that will be used for this aim account. - * @return the proxy type that will be used for this aim account. - */ - public String getProxyType() - { - return proxyType; - } - - /** - * Sets the proxy type for this aim account. - * @param proxyType the proxy type for this aim account - */ - public void setProxyType(String proxyType) - { - this.proxyType = proxyType; - } - - /** - * Returns the proxy password of the aim registration account. - * @return the proxy password of the aim registration account. - */ - public String getProxyPassword() - { - return proxyPassword; - } - - /** - * Sets the proxy password of the aim registration account. - * @param password the proxy password of the aim registration account. - */ - public void setProxyPassword(String password) - { - this.proxyPassword = password; - } - - /** - * Returns the proxy username of the aim registration account. - * @return the proxy username of the aim registration account. - */ - public String getProxyUsername() - { - return proxyUsername; - } - - /** - * Sets the proxy username of the aim registration account. - * @param username the proxy username of the aim registration account - */ - public void setProxyUsername(String username) - { - this.proxyUsername = username; - } } diff --git a/src/net/java/sip/communicator/plugin/aimaccregwizz/AimAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/aimaccregwizz/AimAccountRegistrationWizard.java index a82f66e..1b00a51 100644 --- a/src/net/java/sip/communicator/plugin/aimaccregwizz/AimAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/plugin/aimaccregwizz/AimAccountRegistrationWizard.java @@ -24,6 +24,9 @@ import org.osgi.framework.*; public class AimAccountRegistrationWizard implements AccountRegistrationWizard { + /** + * The logger. + */ private final Logger logger = Logger.getLogger(AimAccountRegistrationWizard.class); @@ -116,34 +119,14 @@ public class AimAccountRegistrationWizard summaryTable.put(Resources.getString("service.gui.REMEMBER_PASSWORD"), Boolean.toString(registration.isRememberPassword())); - if (registration.getProxy() != null) - summaryTable.put(Resources.getString("plugin.aimaccregwizz.PROXY"), - registration.getProxy()); - - if (registration.getProxyPort() != null) - summaryTable.put(Resources.getString("plugin.aimaccregwizz.PROXY"), - registration.getProxyPort()); - - if (registration.getProxyType() != null) - summaryTable.put( - Resources.getString("plugin.aimaccregwizz.PROXY_TYPE"), - registration.getProxyType()); - - if (registration.getProxyPort() != null) - summaryTable.put( - Resources.getString("plugin.aimaccregwizz.PROXY_USERNAME"), - registration.getProxyPort()); - - if (registration.getProxyType() != null) - summaryTable.put( - Resources.getString("plugin.aimaccregwizz.PROXY_PASSWORD"), - registration.getProxyType()); - return summaryTable.entrySet().iterator(); } /** * Installs the account created through this wizard. + * @return the <tt>ProtocolProviderService</tt> for the newly created + * account. + * @throws OperationFailedException */ public ProtocolProviderService signin() throws OperationFailedException @@ -159,6 +142,8 @@ public class AimAccountRegistrationWizard * * @param userName the user name to sign in with * @param password the password to sign in with + * @return the <tt>ProtocolProviderService</tt> for the new account. + * @throws OperationFailedException */ public ProtocolProviderService signin(String userName, String password) throws OperationFailedException @@ -177,6 +162,7 @@ public class AimAccountRegistrationWizard * @param user the user identifier * @param passwd the password * @return the <tt>ProtocolProviderService</tt> for the new account. + * @throws OperationFailedException */ public ProtocolProviderService installAccount( ProtocolProviderFactory providerFactory, String user, String passwd) @@ -190,31 +176,6 @@ public class AimAccountRegistrationWizard accountProperties.put(ProtocolProviderFactory.PASSWORD, passwd); } - if (registration.getProxy() != null - && registration.getProxy().length() != 0) - accountProperties.put(ProtocolProviderFactory.PROXY_ADDRESS, - registration.getProxy()); - - if (registration.getProxyPort() != null - && registration.getProxyPort().length() != 0) - accountProperties.put(ProtocolProviderFactory.PROXY_PORT, - registration.getProxyPort()); - - if (registration.getProxyType() != null - && registration.getProxyType().length() != 0) - accountProperties.put(ProtocolProviderFactory.PROXY_TYPE, - registration.getProxyType()); - - if (registration.getProxyUsername() != null - && registration.getProxyUsername().length() != 0) - accountProperties.put(ProtocolProviderFactory.PROXY_USERNAME, - registration.getProxyUsername()); - - if (registration.getProxyPassword() != null - && registration.getProxyPassword().length() != 0) - accountProperties.put(ProtocolProviderFactory.PROXY_PASSWORD, - registration.getProxyPassword()); - if (isModification) { providerFactory.modifyAccount( protocolProvider, diff --git a/src/net/java/sip/communicator/plugin/aimaccregwizz/FirstWizardPage.java b/src/net/java/sip/communicator/plugin/aimaccregwizz/FirstWizardPage.java index ad4641e..39a0d7b 100644 --- a/src/net/java/sip/communicator/plugin/aimaccregwizz/FirstWizardPage.java +++ b/src/net/java/sip/communicator/plugin/aimaccregwizz/FirstWizardPage.java @@ -38,15 +38,6 @@ public class FirstWizardPage private JPanel valuesPanel = new TransparentPanel(); - private JPanel advancedOpPanel = - new TransparentPanel(new BorderLayout(10, 10)); - - private JPanel labelsAdvOpPanel = - new TransparentPanel(new GridLayout(0, 1, 10, 10)); - - private JPanel valuesAdvOpPanel = - new TransparentPanel(new GridLayout(0, 1, 10, 10)); - private JLabel uinLabel = new JLabel( Resources.getString("plugin.aimaccregwizz.USERNAME")); @@ -78,32 +69,6 @@ public class FirstWizardPage new JButton(Resources.getString( "plugin.aimaccregwizz.REGISTER_NEW_ACCOUNT")); - private JLabel proxyLabel = new JLabel( - Resources.getString("plugin.aimaccregwizz.PROXY")); - - private JLabel proxyPortLabel = - new JLabel(Resources.getString("plugin.aimaccregwizz.PROXY")); - - private JLabel proxyUsernameLabel = - new JLabel(Resources.getString("plugin.aimaccregwizz.PROXY_USERNAME")); - - private JLabel proxyPasswordLabel = - new JLabel(Resources.getString("plugin.aimaccregwizz.PROXY_PASSWORD")); - - private JLabel proxyTypeLabel = - new JLabel(Resources.getString("plugin.aimaccregwizz.PROXY_TYPE")); - - private JTextField proxyField = new JTextField(); - - private JTextField proxyPortField = new JTextField(); - - private JTextField proxyUsernameField = new JTextField(); - - private JPasswordField proxyPassField = new JPasswordField(); - - private JComboBox proxyTypeCombo = new JComboBox(new Object[] - { "http", "socks5", "socks4" }); - private JPanel mainPanel = new TransparentPanel(); private Object nextPageIdentifier = WizardPage.SUMMARY_PAGE_IDENTIFIER; @@ -178,28 +143,6 @@ public class FirstWizardPage mainPanel.add(uinPassPanel); - proxyTypeCombo.setSelectedItem(wizard.getRegistration().getProxyType()); - - labelsAdvOpPanel.add(proxyLabel); - labelsAdvOpPanel.add(proxyPortLabel); - labelsAdvOpPanel.add(proxyTypeLabel); - labelsAdvOpPanel.add(proxyUsernameLabel); - labelsAdvOpPanel.add(proxyPasswordLabel); - - valuesAdvOpPanel.add(proxyField); - valuesAdvOpPanel.add(proxyPortField); - valuesAdvOpPanel.add(proxyTypeCombo); - valuesAdvOpPanel.add(proxyUsernameField); - valuesAdvOpPanel.add(proxyPassField); - - advancedOpPanel.add(labelsAdvOpPanel, BorderLayout.WEST); - advancedOpPanel.add(valuesAdvOpPanel, BorderLayout.CENTER); - - advancedOpPanel.setBorder(BorderFactory.createTitledBorder(Resources - .getString("plugin.aimaccregwizz.ADVANCED_OPTIONS"))); - - mainPanel.add(advancedOpPanel); - this.buttonPanel.add(registerButton); this.registerArea.setEditable(false); @@ -280,18 +223,6 @@ public class FirstWizardPage registration.setPassword(new String(passField.getPassword())); registration.setRememberPassword(rememberPassBox.isSelected()); - registration.setProxy(proxyField.getText()); - registration.setProxyPort(proxyPortField.getText()); - registration.setProxyUsername(proxyUsernameField.getText()); - - if (proxyTypeCombo.getSelectedItem() != null) - registration.setProxyType(proxyTypeCombo.getSelectedItem() - .toString()); - - if (proxyPassField.getPassword() != null) - registration.setProxyPassword(new String(proxyPassField - .getPassword())); - nextPageIdentifier = SUMMARY_PAGE_IDENTIFIER; isCommitted = true; @@ -373,32 +304,6 @@ public class FirstWizardPage this.rememberPassBox.setSelected( wizard.getRegistration().isRememberPassword()); } - - String proxyAddress = - accountID - .getAccountPropertyString(ProtocolProviderFactory.PROXY_ADDRESS); - - String proxyPort = - accountID - .getAccountPropertyString(ProtocolProviderFactory.PROXY_PORT); - - String proxyType = - accountID - .getAccountPropertyString(ProtocolProviderFactory.PROXY_TYPE); - - String proxyUsername = - accountID - .getAccountPropertyString(ProtocolProviderFactory.PROXY_USERNAME); - - String proxyPassword = - accountID - .getAccountPropertyString(ProtocolProviderFactory.PROXY_PASSWORD); - - proxyField.setText(proxyAddress); - proxyPortField.setText(proxyPort); - proxyTypeCombo.setSelectedItem(proxyType); - proxyUsernameField.setText(proxyUsername); - proxyPassField.setText(proxyPassword); } public void actionPerformed(ActionEvent e) @@ -406,11 +311,19 @@ public class FirstWizardPage wizard.webSignup(); } + /** + * The simple form for this wizard. + * @return + */ public Object getSimpleForm() { return uinPassPanel; } + /** + * Whether is committed. + * @return + */ public boolean isCommitted() { return isCommitted; |