Skip to content

Commit

Permalink
Sync 'Run for project' to available images
Browse files Browse the repository at this point in the history
Fixes #1291
  • Loading branch information
petebankhead committed Aug 24, 2023
1 parent 127e801 commit 8fdda5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This is a work-in-progress for the next QuPath release.
* `isOverlayNG` should be turned on by default (https://github.com/qupath/qupath/issues/1244)
* Labeled image instance export doesn't work as expected for z-stacks (https://github.com/qupath/qupath/issues/1267)
* Fix PathClass singleton creation when a derived PathClass is requested (https://github.com/qupath/qupath/pull/1286)
* 'Run for project' does not recognize when previous images have been deleted (https://github.com/qupath/qupath/issues/1291)

### Dependency updates
* Bio-Formats 7.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,8 @@ private void initializeActions() {
beautifySourceAction.setAccelerator(new KeyCodeCombination(KeyCode.L, KeyCombination.SHORTCUT_DOWN, KeyCombination.ALT_DOWN));
beautifySourceAction.disabledProperty().bind(canBeautifyBinding);
compressSourceAction.disabledProperty().bind(canCompressBinding);


// Reset previous images when the project changes
qupath.projectProperty().addListener((v, o, n) -> {
previousImages.clear();
});
Expand Down Expand Up @@ -1535,7 +1536,11 @@ void handleRunProject(final boolean doSave) {
// FilteredList<ProjectImageEntry<?>> sourceList = new FilteredList<>(FXCollections.observableArrayList(project.getImageList()));

String sameImageWarning = "A selected image is open in the viewer!\nAny unsaved changes will be ignored.";
var listSelectionView = ProjectDialogs.createImageChoicePane(qupath, project.getImageList(), previousImages, sameImageWarning);
var imageList = project.getImageList();
// Remove any images that have been removed from the project
// See https://github.com/qupath/qupath/issues/1291
previousImages.retainAll(new HashSet<>(imageList));
var listSelectionView = ProjectDialogs.createImageChoicePane(qupath, imageList, previousImages, sameImageWarning);

Dialog<ButtonType> dialog = new Dialog<>();
dialog.initOwner(qupath.getStage());
Expand Down

0 comments on commit 8fdda5f

Please sign in to comment.