mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-10 12:03:16 +02:00
Only enable edit/remove buttons if connection is closed.
Signed-off-by: Greg Watson <g.watson@computer.org>
This commit is contained in:
parent
c7f1824eec
commit
5315541ca6
1 changed files with 12 additions and 8 deletions
|
@ -155,8 +155,9 @@ public class ConnectionsPreferencePage extends PreferencePage implements IWorkbe
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private final String[] fTableColumnHeaders = { Messages.ConnectionsPreferencePage_Status, Messages.ConnectionsPreferencePage_Connection_Name,
|
private final String[] fTableColumnHeaders = { Messages.ConnectionsPreferencePage_Status,
|
||||||
Messages.ConnectionsPreferencePage_Host, Messages.ConnectionsPreferencePage_User };
|
Messages.ConnectionsPreferencePage_Connection_Name, Messages.ConnectionsPreferencePage_Host,
|
||||||
|
Messages.ConnectionsPreferencePage_User };
|
||||||
|
|
||||||
private final ColumnLayoutData[] fTableColumnLayouts = { new ColumnWeightData(15), new ColumnWeightData(35),
|
private final ColumnLayoutData[] fTableColumnLayouts = { new ColumnWeightData(15), new ColumnWeightData(35),
|
||||||
new ColumnWeightData(30), new ColumnWeightData(20) };
|
new ColumnWeightData(30), new ColumnWeightData(20) };
|
||||||
|
@ -481,12 +482,15 @@ public class ConnectionsPreferencePage extends PreferencePage implements IWorkbe
|
||||||
fOpenButton.setEnabled(false);
|
fOpenButton.setEnabled(false);
|
||||||
fCloseButton.setEnabled(false);
|
fCloseButton.setEnabled(false);
|
||||||
if (fSelectedConnection != null) {
|
if (fSelectedConnection != null) {
|
||||||
fEditButton
|
if (!fSelectedConnection.isOpen()) {
|
||||||
.setEnabled((fSelectedConnection.getRemoteServices().getCapabilities() & IRemoteServices.CAPABILITY_EDIT_CONNECTIONS) != 0);
|
fEditButton
|
||||||
fRemoveButton
|
.setEnabled((fSelectedConnection.getRemoteServices().getCapabilities() & IRemoteServices.CAPABILITY_EDIT_CONNECTIONS) != 0);
|
||||||
.setEnabled((fSelectedConnection.getRemoteServices().getCapabilities() & IRemoteServices.CAPABILITY_REMOVE_CONNECTIONS) != 0);
|
fRemoveButton
|
||||||
fOpenButton.setEnabled(!fSelectedConnection.isOpen());
|
.setEnabled((fSelectedConnection.getRemoteServices().getCapabilities() & IRemoteServices.CAPABILITY_REMOVE_CONNECTIONS) != 0);
|
||||||
fCloseButton.setEnabled(fSelectedConnection.isOpen());
|
fOpenButton.setEnabled(true);
|
||||||
|
} else {
|
||||||
|
fCloseButton.setEnabled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue