diff --git a/src/net/java/sip/communicator/plugin/jabberaccregwizz/FirstWizardPage.java b/src/net/java/sip/communicator/plugin/jabberaccregwizz/FirstWizardPage.java index d46874d44..f3cc4eb1d 100644 --- a/src/net/java/sip/communicator/plugin/jabberaccregwizz/FirstWizardPage.java +++ b/src/net/java/sip/communicator/plugin/jabberaccregwizz/FirstWizardPage.java @@ -26,6 +26,9 @@ public class FirstWizardPage extends JPanel public static final String FIRST_PAGE_IDENTIFIER = "FirstPageIdentifier"; + private static final String GOOGLE_USER_SUFFIX = "gmail.com"; + private static final String GOOGLE_CONNECT_SRV = "talk.google.com"; + private JPanel uinPassPanel = new JPanel(new BorderLayout(10, 10)); private JPanel labelsPanel = new JPanel(new GridLayout(0, 1, 10, 10)); @@ -201,17 +204,14 @@ public void pageNext() { registration.setUin(uinField.getText()); registration.setPassword(new String(passField.getPassword())); registration.setRememberPassword(rememberPassBox.isSelected()); - if(enableAdvOpButton.isSelected()) + + registration.setServerAddress(serverField.getText()); + try { - registration.setOverrideDefOptions(true); - registration.setServerAddress(serverField.getText()); - try - { - registration.setPort(Integer.parseInt(portField.getText())); - } - catch (NumberFormatException ex) - {} + registration.setPort(Integer.parseInt(portField.getText())); } + catch (NumberFormatException ex) + {} } /** @@ -288,7 +288,13 @@ private void setServerFieldAccordingToUIN() String uin = uinField.getText(); int delimIndex = uin.indexOf("@"); if (delimIndex != -1) - serverField.setText(uin.substring(delimIndex + 1)); + { + String newServerAddr = uin.substring(delimIndex + 1); + if(newServerAddr.equals(GOOGLE_USER_SUFFIX)) + serverField.setText(GOOGLE_CONNECT_SRV); + else + serverField.setText(newServerAddr); + } } } diff --git a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistration.java b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistration.java index b5fe6cd03..84c5b14e5 100755 --- a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistration.java +++ b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistration.java @@ -20,8 +20,6 @@ public class JabberAccountRegistration { private boolean rememberPassword; - private boolean overrideDefOptions; - private String serverAddress; private int port; @@ -85,15 +83,6 @@ public int getPort() return port; } - /** - * Whether server and port are pointed by the user - * @return boolean - */ - public boolean isOverrideDefOptions() - { - return overrideDefOptions; - } - /** * Sets the UIN of the jabber registration account. * @param uin the UIN of the jabber registration account. @@ -119,13 +108,4 @@ public void setPort(int port) { this.port = port; } - - /** - * Setting whether user has choosen advance options for server and port - * @param overrideDefOptions boolean - */ - public void setOverrideDefOptions(boolean overrideDefOptions) - { - this.overrideDefOptions = overrideDefOptions; - } } diff --git a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationWizard.java index df834cc44..6ae94d447 100644 --- a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationWizard.java @@ -131,14 +131,11 @@ public ProtocolProviderService installAccount( accountProperties.put(ProtocolProviderFactory.PASSWORD, passwd); } - if(registration.isOverrideDefOptions()) - { - accountProperties.put(ProtocolProviderFactory.SERVER_ADDRESS, + accountProperties.put(ProtocolProviderFactory.SERVER_ADDRESS, registration.getServerAddress()); - accountProperties.put(ProtocolProviderFactory.SERVER_PORT, + accountProperties.put(ProtocolProviderFactory.SERVER_PORT, String.valueOf(registration.getPort())); - } if(protocolProvider != null) { providerFactory.uninstallAccount(protocolProvider.getAccountID());