From 9eeab57dc2259b0ccdc1d9f657b01c059845667f Mon Sep 17 00:00:00 2001 From: Robert Goldmann <deadlocker@gmx.de> Date: Mon, 21 Aug 2017 18:12:25 +0200 Subject: [PATCH] Fixed #154 - Report set initial export file name on month change --- .../ui/controller/ReportController.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/de/deadlocker8/budgetmaster/ui/controller/ReportController.java b/src/de/deadlocker8/budgetmaster/ui/controller/ReportController.java index 5b6e20264..5839021d4 100644 --- a/src/de/deadlocker8/budgetmaster/ui/controller/ReportController.java +++ b/src/de/deadlocker8/budgetmaster/ui/controller/ReportController.java @@ -77,6 +77,7 @@ public class ReportController implements Refreshable private Controller controller; private ColumnFilter columnFilter; private File reportPath; + private String initialReportPath; public void init(Controller controller) { @@ -528,11 +529,7 @@ public class ReportController implements Refreshable } else { - DateTime currentDate = controller.getCurrentDate(); - String currentMonth = currentDate.toString("MM"); - String currentYear = currentDate.toString("YYYY"); - - fileChooser.setInitialFileName( Localization.getString(Strings.REPORT_INITIAL_FILENAME, currentYear, currentMonth)); + fileChooser.setInitialFileName( Localization.getString(initialReportPath)); } fileChooser.getExtensionFilters().add(extFilter); File file = fileChooser.showSaveDialog(controller.getStage()); @@ -665,5 +662,11 @@ public class ReportController implements Refreshable } refreshTableView(); + + DateTime currentDate = controller.getCurrentDate(); + String currentMonth = currentDate.toString("MM"); + String currentYear = currentDate.toString("YYYY"); + + initialReportPath = Localization.getString(Strings.REPORT_INITIAL_FILENAME, currentYear, currentMonth); } } \ No newline at end of file -- GitLab