Skip to content

Commit

Permalink
Group order reset after adding a new group (#10066)
Browse files Browse the repository at this point in the history
  • Loading branch information
aqurilla authored Jul 11, 2023
1 parent ffedea2 commit db6934e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 1 addition & 6 deletions src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ private void onActiveDatabaseChanged(Optional<BibDatabaseContext> 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 -> {
Expand All @@ -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();
});
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit db6934e

Please sign in to comment.