From efc69be2a35ac3c4d536ab4836924d7aad7458de Mon Sep 17 00:00:00 2001 From: Gennadiy Date: Sun, 5 Apr 2020 16:17:00 +0300 Subject: [PATCH] Add disable/enable calculation of items in group (#6233) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Init changes * Init changes * Восстановлено исходное состояние мастера * Просто коммит * Issue #6042 fixed * Issue #6042 fixed Corrected resources file after not passing the test * - Added new property to PreferencesService and JabRefPreferences - Used this property in GroupsTabView - DisplayGroupQuantity renamed into DisplayGroupCount in GroupsTabView & GroupsTabViewModel * - removed line from JabRef_en.properties * Updated Properties file - removed line from ...da.properties; - added line to ...en.properties; * Changed GroupTreeView according to comments from Tobiasdiez Main task - disable calling "group.getHits()" method to avoid calculation of items in group. * Remove empty line Co-authored-by: Tobias Diez --- CHANGELOG.md | 1 + .../org/jabref/gui/groups/GroupTreeView.java | 6 +- .../org/jabref/gui/preferences/GroupsTab.fxml | 1 + .../jabref/gui/preferences/GroupsTabView.java | 2 + .../gui/preferences/GroupsTabViewModel.java | 5 + .../jabref/preferences/JabRefPreferences.java | 7 + .../preferences/PreferencesService.java | 2 + src/main/resources/l10n/JabRef_da.properties | 2 + src/main/resources/l10n/JabRef_en.properties | 2 + src/test/resources/testbib/testjabref.bib | 1645 ++++++++++++++++- 10 files changed, 1669 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d713bed9d8f..309becc5f96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We made the filters more easily accessible in the integrity check dialog. [#5955](https://github.com/JabRef/jabref/pull/5955) - We reimplemented and improved the dialog "Customize entry types". [#4719](https://github.com/JabRef/jabref/issues/4719) - We added an [American Physical Society](https://journals.aps.org/) fetcher. [#818](https://github.com/JabRef/jabref/issues/818) +- We added possibility to enable/disable items quantity in groups. [#6042](https://github.com/JabRef/jabref/issues/6042) ### Fixed diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeView.java b/src/main/java/org/jabref/gui/groups/GroupTreeView.java index 856edb67a19..0e96156f96d 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeView.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeView.java @@ -120,7 +120,7 @@ public void initialize() { .withTooltip(GroupNodeViewModel::getDescription) .install(mainColumn); - // Number of hits + // Number of hits (only if user wants to see them) PseudoClass anySelected = PseudoClass.getPseudoClass("any-selected"); PseudoClass allSelected = PseudoClass.getPseudoClass("all-selected"); new ViewModelTreeTableCellFactory() @@ -134,7 +134,9 @@ public void initialize() { group.allSelectedEntriesMatchedProperty()); } Text text = new Text(); - text.textProperty().bind(group.getHits().asString()); + if (preferencesService.getDisplayGroupCount()) { + text.textProperty().bind(group.getHits().asString()); + } text.getStyleClass().setAll("text"); node.getChildren().add(text); node.setMaxWidth(Control.USE_PREF_SIZE); diff --git a/src/main/java/org/jabref/gui/preferences/GroupsTab.fxml b/src/main/java/org/jabref/gui/preferences/GroupsTab.fxml index ee38f7d5e34..418230824d9 100644 --- a/src/main/java/org/jabref/gui/preferences/GroupsTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/GroupsTab.fxml @@ -25,6 +25,7 @@ +