1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-11 10:15:39 +02:00

[149285] [ssh] multiple prompts and errors in case of incorrect username (Apply patch from Anna Dushistova)

This commit is contained in:
Martin Oberhuber 2008-04-25 21:39:14 +00:00
parent b309d5375c
commit e63686dc77
2 changed files with 44 additions and 33 deletions

View file

@ -20,6 +20,7 @@
* David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
* David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
* Yu-Fen Kuo (MontaVista) - Adapted from SystemCommandAction
* Martin Oberhuber (Wind River) - [149285] [ssh] multiple prompts and errors in case of incorrect username
********************************************************************************/
package org.eclipse.rse.internal.terminals.ui.actions;
@ -28,6 +29,7 @@ import java.util.Iterator;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.rse.core.filters.ISystemFilterReference;
@ -44,6 +46,7 @@ import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
import org.eclipse.rse.subsystems.terminals.core.ITerminalServiceSubSystem;
import org.eclipse.rse.subsystems.terminals.core.elements.TerminalElement;
import org.eclipse.rse.ui.SystemBasePlugin;
import org.eclipse.rse.ui.actions.SystemBaseAction;
import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
import org.eclipse.swt.custom.CTabItem;
@ -237,9 +240,11 @@ public class LaunchTerminalAction extends SystemBaseAction {
if (!terminalSubSystem.isConnected()) {
try {
terminalSubSystem.connect(new NullProgressMonitor(), false);
} catch (OperationCanceledException e) {
// user canceled, return silently
return;
} catch (Exception e) {
Activator.logError(e.getLocalizedMessage(), e);
SystemBasePlugin.logError(e.getLocalizedMessage(), e);
}
}
if (terminalSubSystem.isConnected()) {

View file

@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* Copyright (c) 2002, 2008 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 http://www.eclipse.org/legal/epl-v10.html
@ -14,12 +14,14 @@
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty()
* Martin Oberhuber (Wind River) - [187218] Fix error reporting for connect()
* Martin Oberhuber (Wind River) - [149285][ssh] multiple prompts and errors in case of incorrect username
********************************************************************************/
package org.eclipse.rse.internal.ui.actions;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.rse.core.subsystems.ISubSystem;
@ -55,6 +57,10 @@ public class SystemConnectAction extends SystemBaseAction
else
_subsystem.connect(monitor, true);
}
catch (OperationCanceledException e) {
// user cancelled
return Status.CANCEL_STATUS;
}
catch (SystemMessageException e) {
SystemMessageDialog.displayMessage(e);
}