Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set auto-update checkbox enable/disable when reading preferences #4446

Merged
merged 4 commits into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ 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)



Expand Down
11 changes: 8 additions & 3 deletions src/main/java/org/jabref/gui/preferences/GeneralTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public GeneralTab(DialogService dialogService, JabRefPreferences prefs) {
if (!useTimeStamp.isSelected()) {
updateTimeStamp.setDisable(true);
}
useTimeStamp.setOnAction(e->updateTimeStamp.setDisable(!useTimeStamp.isSelected()));
useTimeStamp.setOnAction(e->setDisableUpdateTimeStamp());
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"));
Expand Down Expand Up @@ -133,11 +133,16 @@ public Node getBuilder() {
return builder;
}

private void setDisableUpdateTimeStamp() {
updateTimeStamp.setDisable(!useTimeStamp.isSelected());
Siedlerchr marked this conversation as resolved.
Show resolved Hide resolved
}

@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());
sbeitzel marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -182,9 +187,9 @@ public void storeSettings() {
// Update name of the time stamp field based on preferences
InternalBibtexFields.updateTimeStampField(prefs.get(JabRefPreferences.TIME_STAMP_FIELD));
prefs.setDefaultEncoding(encodings.getValue());
prefs.putBoolean(JabRefPreferences.BIBLATEX_DEFAULT_MODE, biblatexMode.getValue().equals(BibDatabaseMode.BIBLATEX));
prefs.putBoolean(JabRefPreferences.BIBLATEX_DEFAULT_MODE, biblatexMode.getValue() == BibDatabaseMode.BIBLATEX);

if (!languageSelection.getValue().equals(prefs.getLanguage())) {
if (languageSelection.getValue() != prefs.getLanguage()) {
prefs.setLanguage(languageSelection.getValue());
Localization.setLanguage(languageSelection.getValue());

Expand Down