Merge pull request #1498 from SiboVG/issue-1497

[#1497] Add warning to launch preferences
This commit is contained in:
SiboVG 2022-06-27 20:27:05 +02:00 committed by GitHub
commit bfb0644c7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -286,6 +286,9 @@ pref.dlg.lbl.DefaultMach = Default Mach Number for C.P. Estimate:
pref.dlg.ttip.DefaultMach1 = <HTML><b>This setting will take effect the next time you start OpenRocket.</b> <BR>
pref.dlg.ttip.DefaultMach2 = To change the CP Mach number during this session use Tools->Component Analysis.
pref.dlg.lbl.launchWarning = NOTE: the settings below apply only to newly created simulations.<br>To change the settings for an existing simulation, select that simulation and edit it.
pref.dlg.lbl.launchWarning.ttip = You would not be the first one to be confused by this :)
pref.dlg.lbl.Positiontoinsert = Position to insert new body components:
pref.dlg.lbl.PositiontoinsertStages = Position to insert new stages:
pref.dlg.lbl.Confirmdeletion = Confirm deletion of simulations.

View File

@ -1,5 +1,6 @@
package net.sf.openrocket.gui.dialogs.preferences;
import java.awt.Color;
import java.awt.LayoutManager;
import javax.swing.BorderFactory;
@ -16,6 +17,7 @@ import net.sf.openrocket.gui.SpinnerEditor;
import net.sf.openrocket.gui.adaptors.BooleanModel;
import net.sf.openrocket.gui.adaptors.DoubleModel;
import net.sf.openrocket.gui.components.BasicSlider;
import net.sf.openrocket.gui.components.StyledLabel;
import net.sf.openrocket.gui.components.UnitSelector;
import net.sf.openrocket.models.atmosphere.ExtendedISAModel;
import net.sf.openrocket.simulation.SimulationOptions;
@ -32,6 +34,14 @@ public class LaunchPreferencesPanel extends PreferencesPanel {
public LaunchPreferencesPanel() {
super(new MigLayout("fillx, ins 30lp n n n"));
// Warning message
StyledLabel warning = new StyledLabel(String.format(
"<html>%s</html>", trans.get("pref.dlg.lbl.launchWarning")),
0.5f, StyledLabel.Style.BOLD);
warning.setFontColor(Color.RED);
warning.setToolTipText(trans.get("pref.dlg.lbl.launchWarning.ttip"));
add(warning, "spanx, growx 0, gapbottom para, wrap");
JPanel sub;
String tip;
UnitSelector unit;