Skip to content

Commit

Permalink
Fix import into current library issuing wrong message (JabRef#6266)
Browse files Browse the repository at this point in the history
This change fixes JabRef#6266 in which an erroneous message "import cancelled" is displayed when importing into the current library. This fix was accomplished by modifying the parameter of the extends clause of the ImportEntriesDialog class to have a return type of Boolean rather than Void and making setResultConverter return false rather than null.
  • Loading branch information
jcampbell11245 committed Apr 10, 2020
1 parent 451e6d3 commit 0338e1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We fixed an issue with inconsistent capitalization of file extensions when downloading files [#6115](https://github.com/JabRef/jabref/issues/6115)
- We fixed the display of language and encoding in the preferences dialog. [#6130](https://github.com/JabRef/jabref/pull/6130)
- We fixed an issue where search full-text documents downloaded files with same name, overwriting existing files. [#6174](https://github.com/JabRef/jabref/pull/6174)
- We fixed an issue where when importing into current library an erroneous message "import cancelled" is displayed even though import is successful. [#6266](https://github.com/JabRef/jabref/issues/6266)

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import org.controlsfx.control.CheckListView;
import org.fxmisc.easybind.EasyBind;

public class ImportEntriesDialog extends BaseDialog<Void> {
public class ImportEntriesDialog extends BaseDialog<Boolean> {

public CheckListView<BibEntry> entriesListView;
public ButtonType importButton;
Expand Down Expand Up @@ -76,14 +76,14 @@ public ImportEntriesDialog(BibDatabaseContext database, BackgroundTask<ParserRes
Button btn = (Button) this.getDialogPane().lookupButton(importButton);
btn.disableProperty().bind(booleanBind);

setResultConverter(button -> {
setResultConverter(button -> {
if (button == importButton) {
viewModel.importEntries(entriesListView.getCheckModel().getCheckedItems());
} else {
dialogService.notify(Localization.lang("Import canceled"));
}

return null;
return false;
});
}

Expand Down

0 comments on commit 0338e1d

Please sign in to comment.