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:
parent
57b23fb8c4
commit
d3ae5340e6
1 changed files with 24 additions and 6 deletions
|
@ -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) {
|
int selectedConnector=getInitialConnector();
|
||||||
fCtlConnTypeCombo.select(i);
|
if(selectedConnector>=0) {
|
||||||
selectPage(i);
|
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)
|
||||||
|
|
Loading…
Add table
Reference in a new issue