Skip to content

Commit

Permalink
Enable import button only if entry selected (#4761)
Browse files Browse the repository at this point in the history
  • Loading branch information
samiyac authored and Siedlerchr committed Mar 15, 2019
1 parent 46d2c7d commit 7ed15bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We grouped the toolbar icons and changed the Open Library and Copy icons. [#4584](https://github.com/JabRef/jabref/issues/4584)
- We added a browse button next to the path text field for aux-based groups. [#4586](https://github.com/JabRef/jabref/issues/4586)
- We changed the title of Group Dialog to "Add subgroup" from "Edit group" when we select Add subgroup option.
- We enable import button only if entries are selected. [#4755](https://github.com/JabRef/jabref/issues/4755)
- We made modifications to improve contrast of UI elements. [#4583](https://github.com/JabRef/jabref/issues/4583)

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import javax.inject.Inject;
import javax.swing.undo.UndoManager;

import javafx.beans.binding.Bindings;
import javafx.beans.binding.BooleanBinding;
import javafx.css.PseudoClass;
import javafx.fxml.FXML;
import javafx.scene.Node;
Expand Down Expand Up @@ -61,6 +63,10 @@ public ImportEntriesDialog(BibDatabaseContext database, BackgroundTask<List<BibE
.load()
.setAsDialogPane(this);

BooleanBinding booleanBind = Bindings.isEmpty(entriesListView.getCheckModel().getCheckedItems());
Button btn = (Button) this.getDialogPane().lookupButton(importButton);
btn.disableProperty().bind(booleanBind);

setResultConverter(button -> {
if (button == importButton) {
viewModel.importEntries(entriesListView.getCheckModel().getCheckedItems());
Expand Down

0 comments on commit 7ed15bc

Please sign in to comment.