From d20934e7af3d9d9ce5b7373372608a8620760850 Mon Sep 17 00:00:00 2001 From: SiboVG Date: Mon, 27 Jun 2022 19:11:48 +0200 Subject: [PATCH] [#1497] Add warning to launch preferences --- core/resources/l10n/messages.properties | 3 +++ .../dialogs/preferences/LaunchPreferencesPanel.java | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/core/resources/l10n/messages.properties b/core/resources/l10n/messages.properties index 8f0914a53..aa9ae51b7 100644 --- a/core/resources/l10n/messages.properties +++ b/core/resources/l10n/messages.properties @@ -286,6 +286,9 @@ pref.dlg.lbl.DefaultMach = Default Mach Number for C.P. Estimate: pref.dlg.ttip.DefaultMach1 = This setting will take effect the next time you start OpenRocket.
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.
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. diff --git a/swing/src/net/sf/openrocket/gui/dialogs/preferences/LaunchPreferencesPanel.java b/swing/src/net/sf/openrocket/gui/dialogs/preferences/LaunchPreferencesPanel.java index 4d6d1441d..3179a2c3b 100644 --- a/swing/src/net/sf/openrocket/gui/dialogs/preferences/LaunchPreferencesPanel.java +++ b/swing/src/net/sf/openrocket/gui/dialogs/preferences/LaunchPreferencesPanel.java @@ -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( + "%s", 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;