diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6e5a7853897..64d9621930b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
### Added
- We added a dropdown menu to let users change the reference library during AUX file import. [#10472](https://github.com/JabRef/jabref/issues/10472)
+- We added a button to let users reset the cite command to the default value. [#10569](https://github.com/JabRef/jabref/issues/10569)
### Changed
diff --git a/src/main/java/org/jabref/gui/preferences/external/ExternalTab.fxml b/src/main/java/org/jabref/gui/preferences/external/ExternalTab.fxml
index 803d9bead9a..8db73e2b093 100644
--- a/src/main/java/org/jabref/gui/preferences/external/ExternalTab.fxml
+++ b/src/main/java/org/jabref/gui/preferences/external/ExternalTab.fxml
@@ -33,7 +33,7 @@
-
+
@@ -60,6 +60,15 @@
styleClass="icon-button,narrow"
prefHeight="20.0" prefWidth="20.0"
GridPane.columnIndex="2" GridPane.rowIndex="2"/>
+
diff --git a/src/main/java/org/jabref/gui/preferences/external/ExternalTab.java b/src/main/java/org/jabref/gui/preferences/external/ExternalTab.java
index 4a266a113c9..0ac80610051 100644
--- a/src/main/java/org/jabref/gui/preferences/external/ExternalTab.java
+++ b/src/main/java/org/jabref/gui/preferences/external/ExternalTab.java
@@ -101,4 +101,9 @@ void useTerminalCommandBrowse() {
void useFileBrowserSpecialCommandBrowse() {
viewModel.customFileBrowserBrowse();
}
+
+ @FXML
+ void resetCiteCommandToDefault() {
+ viewModel.resetCiteCommandToDefault();
+ }
}
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 59308f47c46..f8e7f96993c 100644
--- a/src/main/java/org/jabref/gui/preferences/external/ExternalTabViewModel.java
+++ b/src/main/java/org/jabref/gui/preferences/external/ExternalTabViewModel.java
@@ -227,4 +227,8 @@ public BooleanProperty useCustomFileBrowserProperty() {
public StringProperty customFileBrowserCommandProperty() {
return this.customFileBrowserCommandProperty;
}
+
+ public void resetCiteCommandToDefault() {
+ 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 !