When deleting a flight configuration, first change the configuration to
a different one.
This commit is contained in:
parent
1e0ac22592
commit
6641f959c5
@ -545,7 +545,14 @@ public class Rocket extends RocketComponent {
|
||||
checkState();
|
||||
if (id == null)
|
||||
return;
|
||||
// Get current configuration:
|
||||
String currentId = getDefaultConfiguration().getFlightConfigurationID();
|
||||
// If we're removing the current configuration, we need to switch to a different one first.
|
||||
if (currentId != null && currentId.equals(id)) {
|
||||
getDefaultConfiguration().setFlightConfigurationID(null);
|
||||
}
|
||||
flightConfigurationIDs.remove(id);
|
||||
// FIXME - remove corresponding simulations?
|
||||
fireComponentChangeEvent(ComponentChangeEvent.MOTOR_CHANGE);
|
||||
}
|
||||
|
||||
|
@ -156,7 +156,6 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe
|
||||
if (currentId == null)
|
||||
return;
|
||||
rocket.removeFlightConfigurationID(currentId);
|
||||
rocket.getDefaultConfiguration().setFlightConfigurationID(null);
|
||||
configurationChanged();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user