Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when opening script if the last directory isn't available #1441

Closed
petebankhead opened this issue Dec 13, 2023 · 1 comment · Fixed by #1481
Closed

Exception when opening script if the last directory isn't available #1441

petebankhead opened this issue Dec 13, 2023 · 1 comment · Fixed by #1481
Assignees
Labels
Milestone

Comments

@petebankhead
Copy link
Member

Bug report

Describe the bug
See https://forum.image.sc/t/qupath-script-editor-error-when-trying-to-open-saved-script/89826/1

To Reproduce
Steps to reproduce the behavior:

  1. Open a script in the script editor, with File → Open
  2. Delete or rename the folder containing the script
  3. Try to open a script in the script editor, with File → Open
  4. See the exception
18:07:12.434	[JavaFX Application Thread]	ERROR	qupath.lib.gui.QuPathUncaughtExceptionHandler	Folder parameter must be a valid folder	java.lang.IllegalArgumentException: Folder parameter must be a valid folder
	at com.sun.glass.ui.CommonDialogs.convertFolder(CommonDialogs.java:239)
	at com.sun.glass.ui.CommonDialogs.showFileChooser(CommonDialogs.java:191)
	at com.sun.javafx.tk.quantum.QuantumToolkit.showFileChooser(QuantumToolkit.java:1719)
	at javafx.stage.FileChooser.showDialog(FileChooser.java:419)
	at javafx.stage.FileChooser.showOpenDialog(FileChooser.java:354)

Expected behavior
The open dialog opens properly.

Desktop (please complete the following information):

  • OS: All (presumably, definitely macOS)
  • QuPath Version: 0.5.0

Additional context
This happens when the previous directory used in the dialog doesn't exist. Other commands may be affected as well.

@petebankhead petebankhead self-assigned this Dec 13, 2023
@petebankhead
Copy link
Member Author

The fix may be best added in qupath-fxtras at https://github.com/qupath/qupath-fxtras/blob/main/src/main/java/qupath/fx/dialogs/FileChoosers.java#L629 (and probably for the directory chooser).

@petebankhead petebankhead added this to the v0.5.1 milestone Mar 2, 2024
petebankhead added a commit to petebankhead/qupath-fxtras that referenced this issue Mar 2, 2024
Resolves issue with file/directory choosers in QuPath qupath/qupath#1441
@petebankhead petebankhead changed the title QuPath script editor error when trying to open saved script Exception when opening script if the last directory isn't available Mar 2, 2024
petebankhead added a commit to petebankhead/qupath that referenced this issue Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant