Skip to content

Commit

Permalink
Remove notifications for autosave (partial fix for JabRef#5555)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ka0o0 committed Nov 3, 2019
1 parent 629e2d9 commit 071070b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public AutosaveUIManager(BasePanel panel) {
@Subscribe
public void listen(@SuppressWarnings("unused") AutosaveEvent event) {
try {
new SaveDatabaseAction(panel, Globals.prefs, Globals.entryTypesManager).save();
new SaveDatabaseAction(panel, Globals.prefs, Globals.entryTypesManager).save(true);
} catch (Throwable e) {
LOGGER.error("Problem occured while saving.", e);
}
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ private void saveWithDifferentEncoding(Path file, boolean selectedOnly, Charset
}

private boolean doSave() {
panel.setSaving(true);
Path targetPath = panel.getBibDatabaseContext().getDatabasePath().get();
try {
// Save the database
Expand Down Expand Up @@ -158,9 +159,14 @@ private boolean doSave() {
}

public boolean save() {
return save(false);
}

public boolean save(boolean silent) {
if (panel.getBibDatabaseContext().getDatabasePath().isPresent()) {
panel.frame().getDialogService().notify(Localization.lang("Saving library") + "...");
panel.setSaving(true);
if (!silent) {
panel.frame().getDialogService().notify(Localization.lang("Saving library") + "...");
}
return doSave();
} else {
Optional<Path> savePath = getSavePath();
Expand Down

0 comments on commit 071070b

Please sign in to comment.