Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Oberlies2012-01-02 13:38:21 +0000
committerTobias Oberlies2012-01-09 14:23:37 +0000
commitc56d3086f43989513d7e3d2a149a0b6b1f82e9a7 (patch)
tree2fe59ce961a71a129c10520bf4d0ae582ad34639 /bundles/org.eclipse.equinox.p2.ui
parent47549f93278cc0296730577528c106b452b43420 (diff)
downloadrt.equinox.p2-c56d3086f43989513d7e3d2a149a0b6b1f82e9a7.tar.gz
rt.equinox.p2-c56d3086f43989513d7e3d2a149a0b6b1f82e9a7.tar.xz
rt.equinox.p2-c56d3086f43989513d7e3d2a149a0b6b1f82e9a7.zip
348366 Only remember cancel if dialog explicitly signals cancelv20120109-1423
- Introduced a new constant in UIServices to give the implementations the possibility to explicitly indicate that the user cancelled a prompt for password. - Only remember cancel in class Credentials on explicit user cancels. This ensures that the authentication prompt is shown at least once. Bug: 348366 - [repository] Cannot update from update site with authentication
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui')
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ValidationDialogServiceUI.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ValidationDialogServiceUI.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ValidationDialogServiceUI.java
index b731d0e33..ff6209f26 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ValidationDialogServiceUI.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ValidationDialogServiceUI.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -63,8 +63,11 @@ public class ValidationDialogServiceUI extends UIServices {
Shell shell = ProvUI.getDefaultParentShell();
String message = NLS.bind(ProvUIMessages.ServiceUI_LoginDetails, location);
UserValidationDialog dialog = new UserValidationDialog(shell, ProvUIMessages.ServiceUI_LoginRequired, null, message);
- if (dialog.open() == Window.OK) {
+ int dialogCode = dialog.open();
+ if (dialogCode == Window.OK) {
result[0] = dialog.getResult();
+ } else if (dialogCode == Window.CANCEL) {
+ result[0] = AUTHENTICATION_PROMPT_CANCELED;
}
}
@@ -170,8 +173,11 @@ public class ValidationDialogServiceUI extends UIServices {
message = NLS.bind(ProvUIMessages.ProvUIMessages_NotAccepted_EnterFor_0, location);
UserValidationDialog dialog = new UserValidationDialog(previousInfo, shell, ProvUIMessages.ServiceUI_LoginRequired, null, message);
- if (dialog.open() == Window.OK) {
+ int dialogCode = dialog.open();
+ if (dialogCode == Window.OK) {
result[0] = dialog.getResult();
+ } else if (dialogCode == Window.CANCEL) {
+ result[0] = AUTHENTICATION_PROMPT_CANCELED;
}
}

Back to the top