1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 02:36:01 +02:00

RESOLVED - bug 196454: [terminal] Initial connection settings dialog should not be blank

https://bugs.eclipse.org/bugs/show_bug.cgi?id=196454
This commit is contained in:
Michael Scharf 2008-07-07 20:59:17 +00:00
parent 57b23fb8c4
commit d3ae5340e6

View file

@ -15,6 +15,7 @@
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified * Martin Oberhuber (Wind River) - fixed copyright headers and beautified
* Martin Oberhuber (Wind River) - [168197] Replace JFace MessagDialog by SWT MessageBox * Martin Oberhuber (Wind River) - [168197] Replace JFace MessagDialog by SWT MessageBox
* Martin Oberhuber (Wind River) - [168186] Add Terminal User Docs * Martin Oberhuber (Wind River) - [168186] Add Terminal User Docs
* Michael Scharf (Wind River) - [196454] Initial connection settings dialog should not be blank
*******************************************************************************/ *******************************************************************************/
package org.eclipse.tm.internal.terminal.view; package org.eclipse.tm.internal.terminal.view;
@ -181,13 +182,30 @@ class TerminalSettingsDlg extends Dialog {
private void initFields() { private void initFields() {
// Load controls // Load controls
for (int i = 0; i < fConnectors.length; i++) { for (int i = 0; i < fConnectors.length; i++) {
String name=fConnectors[i].getName(); fCtlConnTypeCombo.add(fConnectors[i].getName());
fCtlConnTypeCombo.add(name);
if(fSelectedConnector==i) {
fCtlConnTypeCombo.select(i);
selectPage(i);
}
} }
int selectedConnector=getInitialConnector();
if(selectedConnector>=0) {
fCtlConnTypeCombo.select(selectedConnector);
selectPage(selectedConnector);
}
}
/**
* @return the connector to show when the dialog opens
*/
private int getInitialConnector() {
// if there is a selection, use it
if(fSelectedConnector>=0)
return fSelectedConnector;
// try the telnet connector, because it is the cheapest
for (int i = 0; i < fConnectors.length; i++) {
if("org.eclipse.tm.internal.terminal.telnet.TelnetConnector".equals(fConnectors[i].getId())) //$NON-NLS-1$
return i;
}
// if no telnet connector available, use the first one in the list
if(fConnectors.length>0)
return 0;
return -1;
} }
private boolean validateSettings() { private boolean validateSettings() {
if(fSelectedConnector<0) if(fSelectedConnector<0)