From 2379fbae955176bba4cb661c83db164dd5d2cf21 Mon Sep 17 00:00:00 2001 From: Daniel_M_Williams Date: Sun, 29 Oct 2017 18:00:43 -0400 Subject: [PATCH] [Resolves #377] new Configuration Button now updates to be available if motor mounts are present. --- .../gui/main/flightconfigpanel/FlightConfigurationPanel.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/swing/src/net/sf/openrocket/gui/main/flightconfigpanel/FlightConfigurationPanel.java b/swing/src/net/sf/openrocket/gui/main/flightconfigpanel/FlightConfigurationPanel.java index 2384b2120..42cf6de1f 100644 --- a/swing/src/net/sf/openrocket/gui/main/flightconfigpanel/FlightConfigurationPanel.java +++ b/swing/src/net/sf/openrocket/gui/main/flightconfigpanel/FlightConfigurationPanel.java @@ -54,6 +54,7 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe this.document = doc; this.rocket = doc.getRocket(); + this.rocket.addChangeListener(this); //JPanel panel = new JPanel(new MigLayout("fill","[grow][][][][][grow]")); @@ -159,7 +160,6 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe FlightConfigurationId currentId = this.motorConfigurationPanel.getSelectedConfigurationId(); if (currentId == null) return; - System.err.println(this.rocket.toDebugConfigs()); document.removeFlightConfigurationAndSimulations(currentId); configurationChanged(); } @@ -180,7 +180,6 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe motorConfigurationPanel.fireTableDataChanged(); recoveryConfigurationPanel.fireTableDataChanged(); separationConfigurationPanel.fireTableDataChanged(); - updateButtonState(); } private void updateButtonState() { @@ -199,7 +198,7 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe // Count the number of stages int stageCount = rocket.getStageCount(); - // Enable the new configuration button only when a motor mount is defined. + // Enable the new configuration button only when a motor mount is defined. newConfButton.setEnabled(motorMountCount > 0); // Only enable the recovery tab if there is a motor mount and there is a recovery device