From 08e83e1d853fbbedd17a2fb29c0618fa1b5b2651 Mon Sep 17 00:00:00 2001 From: Michael Andreasen Date: Tue, 18 Jan 2022 13:53:27 +0000 Subject: [PATCH] saves last used directories --- nextion.properties | 2 +- src/systems/proto/nsflash/MakeChunksFrame.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/nextion.properties b/nextion.properties index 895ef13..3e44360 100644 --- a/nextion.properties +++ b/nextion.properties @@ -1,3 +1,3 @@ -#Sun Jan 16 20:33:21 GMT 2022 +#Tue Jan 18 13:52:34 GMT 2022 chunk_dir=C\:\\GIT-Proto\\openhab\\chunks tft_file=C\:\\GIT-Proto\\openhab\\nspanel\\ns-panel.tft diff --git a/src/systems/proto/nsflash/MakeChunksFrame.java b/src/systems/proto/nsflash/MakeChunksFrame.java index 32b5d71..3dffda1 100644 --- a/src/systems/proto/nsflash/MakeChunksFrame.java +++ b/src/systems/proto/nsflash/MakeChunksFrame.java @@ -188,6 +188,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { private void findFileBNActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_findFileBNActionPerformed JFileChooser chooser = new JFileChooser(); + if (tftFile!=null) { + chooser.setCurrentDirectory(tftFile.getParentFile()); + } int stat = chooser.showOpenDialog(this); tftFile = chooser.getSelectedFile(); fileTF.setText(tftFile.getAbsolutePath()); @@ -201,6 +204,9 @@ private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS private void findDirBNActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_findDirBNActionPerformed JFileChooser chooser = new JFileChooser(); + if (chunkDir!=null) { + chooser.setCurrentDirectory(chunkDir); + } chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); int stat = chooser.showOpenDialog(this); chunkDir = chooser.getSelectedFile();