diff --git a/CHANGELOG.md b/CHANGELOG.md index b392fb82590..bab3e63099a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,7 +76,6 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We fixed an issue where the list of XMP Exclusion fields in the preferences was not be saved [#4072](https://github.com/JabRef/jabref/issues/4072) - We fixed an issue where the ArXiv Fetcher did not support HTTP URLs [koppor#328](https://github.com/koppor/jabref/issues/328) - We fixed an issue where only one PDF file could be imported [#4422](https://github.com/JabRef/jabref/issues/4422) -- We fixed an issue where the preference checkbox for automatically updating the timestamp wasn't properly enabled [#4427](https://github.com/JabRef/jabref/issues/4427) diff --git a/src/main/java/org/jabref/gui/preferences/GeneralTab.java b/src/main/java/org/jabref/gui/preferences/GeneralTab.java index aeb0780055c..8e065aab85c 100644 --- a/src/main/java/org/jabref/gui/preferences/GeneralTab.java +++ b/src/main/java/org/jabref/gui/preferences/GeneralTab.java @@ -26,6 +26,8 @@ import org.jabref.model.entry.InternalBibtexFields; import org.jabref.preferences.JabRefPreferences; +import static javafx.beans.binding.Bindings.not; + class GeneralTab extends Pane implements PrefsTab { private final CheckBox useOwner; @@ -59,10 +61,7 @@ public GeneralTab(DialogService dialogService, JabRefPreferences prefs) { updateTimeStamp = new CheckBox(Localization.lang("Update timestamp on modification")); useTimeStamp = new CheckBox(Localization.lang("Mark new entries with addition date") + ". " + Localization.lang("Date format") + ':'); - if (!useTimeStamp.isSelected()) { - updateTimeStamp.setDisable(true); - } - useTimeStamp.setOnAction(e->setDisableUpdateTimeStamp()); + updateTimeStamp.disableProperty().bind(not(useTimeStamp.selectedProperty())); overwriteOwner = new CheckBox(Localization.lang("Overwrite")); overwriteTimeStamp = new CheckBox(Localization.lang("If a pasted or imported entry already has the field set, overwrite.")); enforceLegalKeys = new CheckBox(Localization.lang("Enforce legal characters in BibTeX keys")); @@ -133,16 +132,11 @@ public Node getBuilder() { return builder; } - private void setDisableUpdateTimeStamp() { - updateTimeStamp.setDisable(!useTimeStamp.isSelected()); - } - @Override public void setValues() { useOwner.setSelected(prefs.getBoolean(JabRefPreferences.USE_OWNER)); overwriteOwner.setSelected(prefs.getBoolean(JabRefPreferences.OVERWRITE_OWNER)); useTimeStamp.setSelected(prefs.getBoolean(JabRefPreferences.USE_TIME_STAMP)); - setDisableUpdateTimeStamp(); overwriteTimeStamp.setSelected(prefs.getBoolean(JabRefPreferences.OVERWRITE_TIME_STAMP)); updateTimeStamp.setSelected(prefs.getBoolean(JabRefPreferences.UPDATE_TIMESTAMP)); updateTimeStamp.setSelected(useTimeStamp.isSelected());