Skip to content

Commit

Permalink
Fix cancelling ignored when generating an entry from id (#10727)
Browse files Browse the repository at this point in the history
* Fix cancelling ignored when generating an entry from id

* Add changelog entry
  • Loading branch information
HoussemNasri authored Dec 27, 2023
1 parent 45264bd commit 23b75db
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv

### Fixed

- We fixed an issue where attempting to cancel the importing/generation of an entry from id is ignored. [#10508](https://github.com/JabRef/jabref/issues/10508)

### Removed

## [5.12] – 2023-12-24
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/jabref/gui/EntryTypeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public EntryTypeView(LibraryTab libraryTab, DialogService dialogService, Prefere
.setAsDialogPane(this);

ControlHelper.setAction(generateButton, this.getDialogPane(), event -> viewModel.runFetcherWorker());
setOnCloseRequest(e -> viewModel.cancelFetcherWorker());

setResultConverter(button -> {
// The buttonType will always be "cancel", even if we pressed one of the entry type buttons
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/jabref/gui/EntryTypeViewModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,8 @@ public void runFetcherWorker() {
});
taskExecutor.execute(fetcherWorker);
}

public void cancelFetcherWorker() {
fetcherWorker.cancel();
}
}

0 comments on commit 23b75db

Please sign in to comment.