Skip to content

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

Closed
AmlanDalai wants to merge 4 commits intosumit3203:masterfrom
AmlanDalai:fix/createopenproject-currentdir-and-deadcode
Closed

fix(CreateOpenProjectGUI): fix broken file chooser directory memory and remove dead code#110
AmlanDalai wants to merge 4 commits intosumit3203:masterfrom
AmlanDalai:fix/createopenproject-currentdir-and-deadcode

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

- Replace reference equality (==) with .equals() for ActionEvent dispatch
  in doAction() — same class of bug fixed in GuiPanel (PR sumit3203#6)
- Remove System.out.println debug statements from doAction() and updateClassifier()
- Add full Javadoc to all methods and class
@AmlanDalai AmlanDalai closed this Mar 11, 2026
@AmlanDalai AmlanDalai reopened this Mar 11, 2026
@AmlanDalai
Copy link
Copy Markdown
Contributor Author

Superseded by #111 — recreated from clean upstream master to avoid unrelated file changes.

@AmlanDalai AmlanDalai closed this Mar 11, 2026
@AmlanDalai AmlanDalai changed the title Fifix(CreateOpenProjectGUI): fix broken file chooser directory memory and remove dead code fix(CreateOpenProjectGUI): fix broken file chooser directory memory and remove dead code Mar 11, 2026
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