From db6934ebc4d80d6268c99856d532ce8f14d8e927 Mon Sep 17 00:00:00 2001 From: Nitin Suresh Date: Mon, 10 Jul 2023 23:32:14 -0700 Subject: [PATCH] Group order reset after adding a new group (#10066) --- CHANGELOG.md | 1 + .../java/org/jabref/gui/groups/GroupTreeViewModel.java | 7 +------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7113d0c215d..6a28e1db60a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -74,6 +74,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - In the context of the "systematic literature functionality", we changed the name "database" to "catalog" to use a separate term for online catalogs in comparison to SQL databases. [#9951](https://github.com/JabRef/jabref/pull/9951) - We now show more fields (including Special Fields) in the dropdown selection for "Save sort order" in the library properties and for "Export sort order" in the preferences. [#10010](https://github.com/JabRef/jabref/issues/10010) - We now encrypt and store the custom API keys in the OS native credential store. [#10044](https://github.com/JabRef/jabref/issues/10044) +- We changed the behavior of group addition/edit, so that sorting by alphabetical order is not performed by default after the modification [#10017](https://github.com/JabRef/jabref/issues/10017) ### Fixed diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java b/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java index 4c9e8118590..8f50bdab229 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java @@ -154,8 +154,7 @@ private void onActiveDatabaseChanged(Optional newDatabase) { } /** - * Opens "New Group Dialog" and adds the resulting group as subgroup to the specified group while maintaining the - * alphabetical order + * Opens "New Group Dialog" and adds the resulting group as subgroup to the specified group */ public void addNewSubgroup(GroupNodeViewModel parent, GroupDialogHeader groupDialogHeader) { currentDatabase.ifPresent(database -> { @@ -176,8 +175,6 @@ public void addNewSubgroup(GroupNodeViewModel parent, GroupDialogHeader groupDia // TODO: Expand parent to make new group visible // parent.expand(); - sortAlphabeticallyRecursive(parent.getGroupNode()); - dialogService.notify(Localization.lang("Added group \"%0\".", group.getName())); writeGroupChangesToMetaData(); }); @@ -368,8 +365,6 @@ public void editGroup(GroupNodeViewModel oldGroup) { // undoAddPreviousEntries = UndoableChangeEntriesOfGroup.getUndoableEdit(null, addChange); // } - oldGroup.getParent().ifPresent(this::sortAlphabeticallyRecursive); - dialogService.notify(Localization.lang("Modified group \"%0\".", group.getName())); writeGroupChangesToMetaData(); // This is ugly but we have no proper update mechanism in place to propagate the changes, so redraw everything