From e3a978655103a914763e314928fa31830b4e2ad9 Mon Sep 17 00:00:00 2001 From: SiboVG Date: Wed, 26 Jul 2023 12:13:49 +0200 Subject: [PATCH] Allow for discontinuous row selection No idea why this was once implemented --- core/resources/l10n/messages.properties | 1 + swing/src/net/sf/openrocket/gui/main/SimulationPanel.java | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/resources/l10n/messages.properties b/core/resources/l10n/messages.properties index 4d6cbbf11..2a6e0831d 100644 --- a/core/resources/l10n/messages.properties +++ b/core/resources/l10n/messages.properties @@ -617,6 +617,7 @@ simpanel.ttip.notSimulated = Not simulated yet
Click Run simulat simpanel.ttip.noData = No simulation data available. simpanel.ttip.noWarnings = No warnings. simpanel.ttip.warnings = Warnings: +simpanel.msg.invalidCopySelection = Invalid copy selection ! SimulationRunDialog SimuRunDlg.title.RunSim = Running simulations\u2026 diff --git a/swing/src/net/sf/openrocket/gui/main/SimulationPanel.java b/swing/src/net/sf/openrocket/gui/main/SimulationPanel.java index c5be48302..ff1fc55f7 100644 --- a/swing/src/net/sf/openrocket/gui/main/SimulationPanel.java +++ b/swing/src/net/sf/openrocket/gui/main/SimulationPanel.java @@ -489,8 +489,9 @@ public class SimulationPanel extends JPanel { int numRows = simulationTable.getSelectedRowCount(); int[] rowsSelected = simulationTable.getSelectedRows(); - if (numRows != (rowsSelected[rowsSelected.length-1] - rowsSelected[0] + 1) || numRows != rowsSelected.length) { - JOptionPane.showMessageDialog(null, "Invalid Copy Selection", "Invalid Copy Selection", JOptionPane.ERROR_MESSAGE); + if (numRows != rowsSelected.length) { + JOptionPane.showMessageDialog(this, trans.get("simpanel.msg.invalidCopySelection"), + trans.get("simpanel.msg.invalidCopySelection"), JOptionPane.ERROR_MESSAGE); return; }