From 3d07229dd5e2bcb56eab3a728b1c73353a3c5e91 Mon Sep 17 00:00:00 2001 From: relves Date: Tue, 26 Jun 2007 20:01:19 +0000 Subject: REOPENED - bug 190660: Repository settings wizards don't persist individual proxy settings https://bugs.eclipse.org/bugs/show_bug.cgi?id=190660 --- .../ui/wizards/AbstractRepositorySettingsPage.java | 100 +++++++++++---------- 1 file changed, 52 insertions(+), 48 deletions(-) diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java index ea09add79..f44b36f98 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java @@ -212,6 +212,41 @@ public abstract class AbstractRepositorySettingsPage extends WizardPage { } public void createControl(Composite parent) { + + if (repository != null) { + originalUrl = repository.getUrl(); + oldUsername = repository.getUserName(); + oldPassword = repository.getPassword(); + + if (repository.getHttpUser() != null && repository.getHttpPassword() != null) { + oldHttpAuthUserId = repository.getHttpUser(); + oldHttpAuthPassword = repository.getHttpPassword(); + } else { + oldHttpAuthPassword = ""; + oldHttpAuthUserId = ""; + } + + oldProxyHostname = repository.getProperty(TaskRepository.PROXY_HOSTNAME); + oldProxyPort = repository.getProperty(TaskRepository.PROXY_PORT); + if (oldProxyHostname == null) + oldProxyHostname = ""; + if (oldProxyPort == null) + oldProxyPort = ""; + + oldProxyUsername = repository.getProxyUsername(); + oldProxyPassword = repository.getProxyPassword(); + if (oldProxyUsername == null) + oldProxyUsername = ""; + if (oldProxyPassword == null) + oldProxyPassword = ""; + + } else { + oldUsername = ""; + oldPassword = ""; + oldHttpAuthPassword = ""; + oldHttpAuthUserId = ""; + } + compositeContainer = new Composite(parent, SWT.NULL); FillLayout layout = new FillLayout(); compositeContainer.setLayout(layout); @@ -316,6 +351,22 @@ public abstract class AbstractRepositorySettingsPage extends WizardPage { } }; + if (repository != null) { + try { + String repositoryLabel = repository.getProperty(IRepositoryConstants.PROPERTY_LABEL); + if (repositoryLabel != null && repositoryLabel.length() > 0) { + // repositoryLabelCombo.add(repositoryLabel); + // repositoryLabelCombo.select(0); + repositoryLabelEditor.setStringValue(repositoryLabel); + } + serverUrlCombo.setText(repository.getUrl()); + repositoryUserNameEditor.setStringValue(repository.getUserName()); + repositoryPasswordEditor.setStringValue(repository.getPassword()); + } catch (Throwable t) { + StatusHandler.fail(t, "could not set field value for: " + repository, false); + } + } + if (needsAnonymousLogin()) { if (repository != null) { setAnonymous(repository.isAnonymous()); @@ -468,6 +519,7 @@ public abstract class AbstractRepositorySettingsPage extends WizardPage { GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).span(2, SWT.DEFAULT).applyTo(httpAuthButton); httpAuthButton.setText("Enabled"); + httpAuthButton.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { setHttpAuth(httpAuthButton.getSelection()); @@ -497,7 +549,6 @@ public abstract class AbstractRepositorySettingsPage extends WizardPage { httpAuthComp); ((RepositoryStringFieldEditor) httpAuthPasswordEditor).getTextControl().setEchoChar('*'); - // httpAuthGroup.setEnabled(httpAuthButton.getSelection()); httpAuthUserNameEditor.setEnabled(httpAuthButton.getSelection(), httpAuthComp); httpAuthPasswordEditor.setEnabled(httpAuthButton.getSelection(), httpAuthComp); @@ -507,53 +558,6 @@ public abstract class AbstractRepositorySettingsPage extends WizardPage { httpAuthExpComposite.setExpanded(httpAuthButton.getSelection()); } - if (repository != null) { - originalUrl = repository.getUrl(); - oldUsername = repository.getUserName(); - oldPassword = repository.getPassword(); - - if (repository.getHttpUser() != null && repository.getHttpPassword() != null) { - oldHttpAuthUserId = repository.getHttpUser(); - oldHttpAuthPassword = repository.getHttpPassword(); - } else { - oldHttpAuthPassword = ""; - oldHttpAuthUserId = ""; - } - - oldProxyHostname = repository.getProperty(TaskRepository.PROXY_HOSTNAME); - oldProxyPort = repository.getProperty(TaskRepository.PROXY_PORT); - if (oldProxyHostname == null) - oldProxyHostname = ""; - if (oldProxyPort == null) - oldProxyPort = ""; - - oldProxyUsername = repository.getProxyUsername(); - oldProxyPassword = repository.getProxyPassword(); - if (oldProxyUsername == null) - oldProxyUsername = ""; - if (oldProxyPassword == null) - oldProxyPassword = ""; - - try { - String repositoryLabel = repository.getProperty(IRepositoryConstants.PROPERTY_LABEL); - if (repositoryLabel != null && repositoryLabel.length() > 0) { - // repositoryLabelCombo.add(repositoryLabel); - // repositoryLabelCombo.select(0); - repositoryLabelEditor.setStringValue(repositoryLabel); - } - serverUrlCombo.setText(repository.getUrl()); - repositoryUserNameEditor.setStringValue(repository.getUserName()); - repositoryPasswordEditor.setStringValue(repository.getPassword()); - } catch (Throwable t) { - StatusHandler.fail(t, "could not set field value for: " + repository, false); - } - } else { - oldUsername = ""; - oldPassword = ""; - oldHttpAuthPassword = ""; - oldHttpAuthUserId = ""; - } - if (needsProxy()) { addProxySection(); } -- cgit v1.2.3