Skip to content

Commit

Permalink
Fix cancelling ignored when generating an entry from id
Browse files Browse the repository at this point in the history
  • Loading branch information
HoussemNasri committed Dec 26, 2023
1 parent b711863 commit d0edf3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
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 d0edf3a

Please sign in to comment.