Skip to content

Commit fe3798c

Browse files
ZodGazSiedlerchr
andauthored
Group tab is now empty when there are no libraries open (#13473)
* Fix issue #13382, that was probably related to the cleanup logic in GroupTreeViewModel not being triggered properly. Setting the activeDatabase to null when the last LibraryTab is closed seems to fix the issue. * Update CHANGELOG.md * Fix title bar DB name and an uncaught exception - Fixed issue where the database name remained in the title bar after closing all databases. - Fixed exception triggered by action "Close all" when the welcome tab was open. --------- Co-authored-by: Christoph <siedlerkiller@gmail.com>
1 parent 73524e6 commit fe3798c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
7878
- We fixed an issue where Document Viewer showed technical exceptions when opening entries with non-PDF files. [#13198](https://github.com/JabRef/jabref/issues/13198)
7979
- When creating a library, if you drag a PDF file containing only a single column, the dialog will now automatically close. [#13262](https://github.com/JabRef/jabref/issues/13262)
8080
- We fixed an issue where the tab showing the fulltext search results would appear blank after switching library. [#13241](https://github.com/JabRef/jabref/issues/13241)
81+
- We fixed an issue where the groups were still displayed after closing all libraries. [#13382](https://github.com/JabRef/jabref/issues/13382)
8182
- Enhanced field selection logic in the Merge Entries dialog when fetching from DOI to prefer valid years and entry types. [#12549](https://github.com/JabRef/jabref/issues/12549)
8283

8384
### Removed

jabgui/src/main/java/org/jabref/gui/frame/JabRefFrame.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ private void initBindings() {
419419
.noneMatch(ltab -> ((LibraryTab) ltab).getBibDatabaseContext().getUid().equals(activeUID));
420420
if (wasClosed) {
421421
tabbedPane.getSelectionModel().selectNext();
422-
return;
423422
}
424423
}
425424

@@ -595,6 +594,10 @@ public boolean closeTabs(@NonNull List<LibraryTab> tabs) {
595594
// Trigger org.jabref.gui.LibraryTab.onClosed
596595
Event.fireEvent(libraryTab, new Event(this, libraryTab, Tab.CLOSED_EVENT));
597596
}
597+
// Force group update in the GroupTreeViewModel when all the libraries are closed
598+
if (tabbedPane.getTabs().isEmpty()) {
599+
stateManager.setActiveDatabase(null);
600+
}
598601
return true;
599602
}
600603

@@ -722,6 +725,7 @@ private class CloseAllDatabaseAction extends SimpleCommand {
722725

723726
@Override
724727
public void execute() {
728+
tabbedPane.getTabs().removeIf(t -> t instanceof WelcomeTab);
725729
for (Tab tab : tabbedPane.getTabs()) {
726730
Platform.runLater(() -> closeTab((LibraryTab) tab));
727731
}

0 commit comments

Comments
 (0)