diff --git a/src/main/java/org/jabref/gui/preferences/external/ExternalTabViewModel.java b/src/main/java/org/jabref/gui/preferences/external/ExternalTabViewModel.java index ac6b1977d9c..f8e7f96993c 100644 --- a/src/main/java/org/jabref/gui/preferences/external/ExternalTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/external/ExternalTabViewModel.java @@ -24,7 +24,6 @@ import org.jabref.logic.l10n.Localization; import org.jabref.model.strings.StringUtil; import org.jabref.preferences.ExternalApplicationsPreferences; -import org.jabref.preferences.JabRefPreferences; import org.jabref.preferences.PreferencesService; import org.jabref.preferences.PushToApplicationPreferences; @@ -229,9 +228,7 @@ public StringProperty customFileBrowserCommandProperty() { return this.customFileBrowserCommandProperty; } - // Reset Cite Command - public void resetCiteCommandToDefault() { - this.citeCommandProperty.setValue(preferences.getDefaults().get(JabRefPreferences.CITE_COMMAND).toString()); + this.citeCommandProperty.setValue(preferences.getExternalApplicationsPreferences().getDefaultCiteCommand()); } } diff --git a/src/main/java/org/jabref/preferences/ExternalApplicationsPreferences.java b/src/main/java/org/jabref/preferences/ExternalApplicationsPreferences.java index 2b64ebbe884..45670b68a28 100644 --- a/src/main/java/org/jabref/preferences/ExternalApplicationsPreferences.java +++ b/src/main/java/org/jabref/preferences/ExternalApplicationsPreferences.java @@ -11,6 +11,8 @@ public class ExternalApplicationsPreferences { private final BooleanProperty shouldAutoOpenEmailAttachmentsFolder; private final StringProperty citeCommand; + private final StringProperty defaultCiteCommand; + private final BooleanProperty useCustomTerminal; private final StringProperty customTerminalCommand; private final BooleanProperty useCustomFileBrowser; @@ -20,6 +22,7 @@ public class ExternalApplicationsPreferences { public ExternalApplicationsPreferences(String eMailSubject, boolean shouldAutoOpenEmailAttachmentsFolder, String citeCommand, + String defaultCiteCommand, boolean useCustomTerminal, String customTerminalCommand, boolean useCustomFileBrowser, @@ -29,6 +32,7 @@ public ExternalApplicationsPreferences(String eMailSubject, this.eMailSubject = new SimpleStringProperty(eMailSubject); this.shouldAutoOpenEmailAttachmentsFolder = new SimpleBooleanProperty(shouldAutoOpenEmailAttachmentsFolder); this.citeCommand = new SimpleStringProperty(citeCommand); + this.defaultCiteCommand = new SimpleStringProperty(defaultCiteCommand); this.useCustomTerminal = new SimpleBooleanProperty(useCustomTerminal); this.customTerminalCommand = new SimpleStringProperty(customTerminalCommand); this.useCustomFileBrowser = new SimpleBooleanProperty(useCustomFileBrowser); @@ -131,4 +135,8 @@ public StringProperty kindleEmailProperty() { public void setKindleEmail(String kindleEmail) { this.kindleEmail.set(kindleEmail); } + + public String getDefaultCiteCommand() { + return defaultCiteCommand.getValue(); + } } diff --git a/src/main/java/org/jabref/preferences/JabRefPreferences.java b/src/main/java/org/jabref/preferences/JabRefPreferences.java index 64eb1845322..d3ec6d79e99 100644 --- a/src/main/java/org/jabref/preferences/JabRefPreferences.java +++ b/src/main/java/org/jabref/preferences/JabRefPreferences.java @@ -1791,6 +1791,7 @@ public ExternalApplicationsPreferences getExternalApplicationsPreferences() { get(EMAIL_SUBJECT), getBoolean(OPEN_FOLDERS_OF_ATTACHED_FILES), get(CITE_COMMAND), + (String) defaults.get(CITE_COMMAND), !getBoolean(USE_DEFAULT_CONSOLE_APPLICATION), // mind the ! get(CONSOLE_COMMAND), !getBoolean(USE_DEFAULT_FILE_BROWSER_APPLICATION), // mind the !