Skip to content

fix(CreateOpenProjectGUI): fix broken file chooser directory memory and remove dead code#111

Open
AmlanDalai wants to merge 1 commit intosumit3203:masterfrom
AmlanDalai:fix/currentdir-deadcode-v2
Open

fix(CreateOpenProjectGUI): fix broken file chooser directory memory and remove dead code#111
AmlanDalai wants to merge 1 commit intosumit3203:masterfrom
AmlanDalai:fix/currentdir-deadcode-v2

Conversation

@AmlanDalai
Copy link
Copy Markdown
Contributor

Changes

1. Removed dead code (line 70)

setDefaultCloseOperation(EXIT_ON_CLOSE) was immediately overwritten
by setDefaultCloseOperation(DO_NOTHING_ON_CLOSE) on the next line.
Removed the dead first call.

2. Fixed file chooser "remember directory" bug (lines 133-137)

The currentDir check was placed AFTER showOpenDialog(), meaning
the dialog had already closed by the time we tried to set the directory.

Before: File chooser always opened at default directory
After: File chooser remembers and opens at the last-used directory

Fix details

  • Moved currentDir check BEFORE showOpenDialog()
  • Changed setSelectedFile() to setCurrentDirectory(currentDir.getParentFile())
    for proper directory navigation

Testing

  • Verified exit confirmation dialog still works correctly after removing dead code
  • Verified file chooser now remembers the last directory after opening a file
  • Verified 0 compilation errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant