1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-08 16:55:38 +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() { private void addConnection() {
if (fIsDirty) { if (fIsDirty) {
MessageDialog dialog = new MessageDialog(getShell(), Messages.ConnectionsPreferencePage_Confirm_Actions, null, MessageDialog dialog = new MessageDialog(getShell(), Messages.ConnectionsPreferencePage_Confirm_Actions, null,
Messages.ConnectionsPreferencePage_There_are_unsaved_changes, MessageDialog.QUESTION, new String[] { Messages.ConnectionsPreferencePage_There_are_unsaved_changes, MessageDialog.QUESTION,
IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0); new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0);
if (dialog.open() == 1) { if (dialog.open() == 1) {
return; return;
} }
performOk(); performOk();
} }
IRemoteUIConnectionWizard wizard = fUIConnectionManager.getConnectionWizard(getShell()); if (fUIConnectionManager != null) {
if (wizard != null) { IRemoteUIConnectionWizard wizard = fUIConnectionManager.getConnectionWizard(getShell());
wizard.setConnectionName(initialConnectionName()); if (wizard != null) {
wizard.setInvalidConnectionNames(invalidConnectionNames()); wizard.setConnectionName(initialConnectionName());
IRemoteConnectionWorkingCopy conn = wizard.open(); wizard.setInvalidConnectionNames(invalidConnectionNames());
if (conn != null) { IRemoteConnectionWorkingCopy conn = wizard.open();
fWorkingCopies.put(conn.getName(), conn); if (conn != null) {
fConnectionViewer.refresh(); fWorkingCopies.put(conn.getName(), conn);
fIsDirty = true; if (!fConnectionViewer.getTable().isDisposed()) {
fConnectionViewer.refresh();
}
fIsDirty = true;
}
} }
} }
} }
@ -595,17 +599,14 @@ public class ConnectionsPreferencePage extends PreferencePage implements IWorkbe
IRemoteConnection conn = getOriginalIfClean(fSelectedConnection); IRemoteConnection conn = getOriginalIfClean(fSelectedConnection);
if (conn.hasService(IRemoteConnectionControlService.class)) { if (conn.hasService(IRemoteConnectionControlService.class)) {
if (!conn.isOpen()) { if (!conn.isOpen()) {
fEditButton fEditButton.setEnabled(conn.getConnectionType().canEdit());
.setEnabled(conn.getConnectionType().canEdit()); fRemoveButton.setEnabled(conn.getConnectionType().canRemove());
fRemoveButton
.setEnabled(conn.getConnectionType().canRemove());
fOpenButton.setEnabled(true); fOpenButton.setEnabled(true);
} else { } else {
fCloseButton.setEnabled(true); fCloseButton.setEnabled(true);
} }
} else { } else {
fEditButton fEditButton.setEnabled(conn.getConnectionType().canEdit());
.setEnabled(conn.getConnectionType().canEdit());
} }
} }
} }