1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-08 08:45:44 +02:00

Merge remote-tracking branch 'origin/R2_0_maintenance'

This commit is contained in:
Greg Watson 2015-09-28 10:29:21 -04:00
commit 58c1857c15

View file

@ -236,22 +236,26 @@ public class ConnectionsPreferencePage extends PreferencePage implements IWorkbe
private void addConnection() {
if (fIsDirty) {
MessageDialog dialog = new MessageDialog(getShell(), Messages.ConnectionsPreferencePage_Confirm_Actions, null,
Messages.ConnectionsPreferencePage_There_are_unsaved_changes, MessageDialog.QUESTION, new String[] {
IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0);
Messages.ConnectionsPreferencePage_There_are_unsaved_changes, MessageDialog.QUESTION,
new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0);
if (dialog.open() == 1) {
return;
}
performOk();
}
IRemoteUIConnectionWizard wizard = fUIConnectionManager.getConnectionWizard(getShell());
if (wizard != null) {
wizard.setConnectionName(initialConnectionName());
wizard.setInvalidConnectionNames(invalidConnectionNames());
IRemoteConnectionWorkingCopy conn = wizard.open();
if (conn != null) {
fWorkingCopies.put(conn.getName(), conn);
fConnectionViewer.refresh();
fIsDirty = true;
if (fUIConnectionManager != null) {
IRemoteUIConnectionWizard wizard = fUIConnectionManager.getConnectionWizard(getShell());
if (wizard != null) {
wizard.setConnectionName(initialConnectionName());
wizard.setInvalidConnectionNames(invalidConnectionNames());
IRemoteConnectionWorkingCopy conn = wizard.open();
if (conn != null) {
fWorkingCopies.put(conn.getName(), conn);
if (!fConnectionViewer.getTable().isDisposed()) {
fConnectionViewer.refresh();
}
fIsDirty = true;
}
}
}
}
@ -595,17 +599,14 @@ public class ConnectionsPreferencePage extends PreferencePage implements IWorkbe
IRemoteConnection conn = getOriginalIfClean(fSelectedConnection);
if (conn.hasService(IRemoteConnectionControlService.class)) {
if (!conn.isOpen()) {
fEditButton
.setEnabled(conn.getConnectionType().canEdit());
fRemoveButton
.setEnabled(conn.getConnectionType().canRemove());
fEditButton.setEnabled(conn.getConnectionType().canEdit());
fRemoveButton.setEnabled(conn.getConnectionType().canRemove());
fOpenButton.setEnabled(true);
} else {
fCloseButton.setEnabled(true);
}
} else {
fEditButton
.setEnabled(conn.getConnectionType().canEdit());
fEditButton.setEnabled(conn.getConnectionType().canEdit());
}
}
}