From f1400c5c0f05c76c9eacac3d8b1d6b409de255ea Mon Sep 17 00:00:00 2001 From: jppetrakis <> Date: Fri, 3 Mar 2023 22:19:35 -0500 Subject: [PATCH] Fixed text representation in save dialog file chooser. More reasonable initial location for save dialog. --- core/resources/l10n/messages.properties | 2 ++ .../net/sf/openrocket/gui/main/SimulationPanel.java | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/resources/l10n/messages.properties b/core/resources/l10n/messages.properties index 73d55d855..8899954bc 100644 --- a/core/resources/l10n/messages.properties +++ b/core/resources/l10n/messages.properties @@ -537,6 +537,8 @@ simpanel.pop.run = Run simpanel.pop.delete = Delete simpanel.pop.duplicate = Duplicate simpanel.pop.export_to_csv = Export table as CSV file +simpanel.pop.export_to_csv.save.dialog.title = Save as CSV file +simpanel.pop.export_to_csv.save.button.text = Save simpanel.dlg.no.simulation.table.rows = Simulation table has no entries... run a simulation please simpanel.checkbox.donotask = Do not ask me again simpanel.lbl.defpref = You can change the default operation in the preferences. diff --git a/swing/src/net/sf/openrocket/gui/main/SimulationPanel.java b/swing/src/net/sf/openrocket/gui/main/SimulationPanel.java index f3b90939d..00d0d4257 100644 --- a/swing/src/net/sf/openrocket/gui/main/SimulationPanel.java +++ b/swing/src/net/sf/openrocket/gui/main/SimulationPanel.java @@ -661,7 +661,11 @@ public class SimulationPanel extends JPanel { private JFileChooser setUpFileChooser() { JFileChooser fch = new JFileChooser(); - + String saveDialogTitle = trans.get("simpanel.pop.export_to_csv.save.dialog.title"); + String saveButtonText = trans.get("simpanel.pop.export_to_csv.save.button.text"); + fch.setApproveButtonText(saveButtonText); + fch.setDialogTitle(saveDialogTitle); + fch.setApproveButtonToolTipText(saveDialogTitle); // set up to filter for .csv's fch.setFileFilter(new FileFilter() { @Override @@ -675,7 +679,7 @@ public class SimulationPanel extends JPanel { @Override public String getDescription() { - return ".csv"; + return trans.get("FileHelper.CSV_FILTER"); } }); @@ -684,7 +688,7 @@ public class SimulationPanel extends JPanel { String documentFileName = document.getRocket().getName(); documentFileName += ".csv"; fch.setSelectedFile(new File(documentFileName)); - String csvFileLocation = System.getProperty("user.dir"); + String csvFileLocation = System.getProperty("user.home") + "/Documents"; if (!lastSelectedLocation.equals("")) { csvFileLocation = lastSelectedLocation; }