Fixed text representation in save dialog file chooser. More reasonable initial location for save dialog.

This commit is contained in:
jppetrakis 2023-03-03 22:19:35 -05:00
parent 5c2ee50e0e
commit f1400c5c0f
2 changed files with 9 additions and 3 deletions

View File

@ -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.

View File

@ -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;
}