Skip to content

Commit

Permalink
Fix closing of library not handling backup and autosave manager shutd…
Browse files Browse the repository at this point in the history
…own (#4794)
  • Loading branch information
CaptainDaVinci authored and LinusDietz committed Mar 26, 2019
1 parent 8e6b177 commit 83c8022
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,10 @@ public void addTab(BasePanel basePanel, boolean raisePanel) {
// add tab
Tab newTab = new Tab(basePanel.getTabTitle(), basePanel);
tabbedPane.getTabs().add(newTab);
newTab.setOnCloseRequest(event -> {
closeTab((BasePanel) newTab.getContent());
event.consume();
});

// update all tab titles
updateAllTabTitles();
Expand Down Expand Up @@ -1340,6 +1344,8 @@ private void closeTab(BasePanel panel) {
if (panel.isModified() && (context.getLocation() == DatabaseLocation.LOCAL)) {
if (confirmClose(panel)) {
removeTab(panel);
} else {
return;
}
} else if (context.getLocation() == DatabaseLocation.SHARED) {
context.convertToLocalDatabase();
Expand Down

0 comments on commit 83c8022

Please sign in to comment.