Closed bobjacobsen closed 1 year ago
See discussion at https://groups.io/g/layoutcommandcontrol/topic/97184619
On Wed, Mar 1, 2023 at 5:36 AM Bob Jacobsen @.***> wrote:
@.**** commented on this pull request.
In src/org/openlcb/cdi/swing/CdiPanel.java https://github.com/openlcb/OpenLCB_Java/pull/214#discussion_r1121740613:
public void runRestore() {
// First select a file to save to. fci.setDialogTitle("Open configuration restore file"); fci.rescanCurrentDirectory();
- fci.setSelectedFile(new File("config." + rep.getRemoteNodeAsString() + ".txt"));
- fci.setSelectedFile(new File(generateFileName()));
You're right that this won't end up selecting a file. This goes to the saved directory (if any), but doesn't select a file.
Unfortunately, no, there's no glob capability in the JFileChooser. Coding one is possible, but it's a non-trivial amount of work.
Another approach might be to present the last filename used by a Save (in the same session) and select that.
This sounds like an ok behavior. If there wasn't anything in the current session, then just show the directory with *.txt in the chooser.
Message ID: @.***>
Thanks. Changes made.
Changes the default filename when doing a backup from the CDI pane. The new form is id-name-softwareversion-date-time, e.g.