Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
text="%Warn about unresolved duplicates when closing inspection window"/>

<CheckBox fx:id="confirmDelete" text="%Show confirmation dialog when deleting entries"/>
<CheckBox fx:id="shouldAskForIncludingCrossReferences" text="%Ask whether to include cross-references when copying to another library"/>
<CheckBox fx:id="confirmHideTabBar" text="%Hide tab bar when single library is present"/>

<Label styleClass="sectionHeader" text="%Single instance" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class GeneralTab extends AbstractPreferenceTabView<GeneralTabViewModel> i
@FXML private CheckBox inspectionWarningDuplicate;

@FXML private CheckBox confirmDelete;
@FXML private CheckBox shouldAskForIncludingCrossReferences;
@FXML private CheckBox confirmHideTabBar;
@FXML private ComboBox<BibDatabaseMode> biblatexMode;
@FXML private CheckBox alwaysReformatBib;
Expand Down Expand Up @@ -120,6 +121,7 @@ public void initialize() {
showAdvancedHints.selectedProperty().bindBidirectional(viewModel.showAdvancedHintsProperty());
inspectionWarningDuplicate.selectedProperty().bindBidirectional(viewModel.inspectionWarningDuplicateProperty());
confirmDelete.selectedProperty().bindBidirectional(viewModel.confirmDeleteProperty());
shouldAskForIncludingCrossReferences.selectedProperty().bindBidirectional(viewModel.shouldAskForIncludingCrossReferences());
confirmHideTabBar.selectedProperty().bindBidirectional(viewModel.confirmHideTabBarProperty());

new ViewModelListCellFactory<BibDatabaseMode>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public class GeneralTabViewModel implements PreferenceTabViewModel {
private final BooleanProperty showAdvancedHintsProperty = new SimpleBooleanProperty();
private final BooleanProperty inspectionWarningDuplicateProperty = new SimpleBooleanProperty();
private final BooleanProperty confirmDeleteProperty = new SimpleBooleanProperty();
private final BooleanProperty shouldAskForIncludingCrossReferencesProperty = new SimpleBooleanProperty();
private final BooleanProperty hideTabBarProperty = new SimpleBooleanProperty();

private final ListProperty<BibDatabaseMode> bibliographyModeListProperty = new SimpleListProperty<>();
Expand Down Expand Up @@ -185,6 +186,7 @@ public void setValues() {
inspectionWarningDuplicateProperty.setValue(workspacePreferences.shouldWarnAboutDuplicatesInInspection());

confirmDeleteProperty.setValue(workspacePreferences.shouldConfirmDelete());
shouldAskForIncludingCrossReferencesProperty.setValue(preferences.getCopyToPreferences().getShouldAskForIncludingCrossReferences());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Unrelated to PR)
@calixtus shouldn't this preference have gone to WorkspacePreferences instead of the root preference class?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always depends on how complex it is. If possible, maintain flat hierarchies. If necessary, introduce a new preference class. Otherwise you wont find anything anymore and it gets harder for newcomers to read the code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#12526 (comment)

@subhramit, after the updates, should I move this to Workspace Preferences or not?

hideTabBarProperty.setValue(workspacePreferences.shouldHideTabBar());

bibliographyModeListProperty.setValue(FXCollections.observableArrayList(BibDatabaseMode.values()));
Expand Down Expand Up @@ -227,6 +229,7 @@ public void storeSettings() {
workspacePreferences.setWarnAboutDuplicatesInInspection(inspectionWarningDuplicateProperty.getValue());

workspacePreferences.setConfirmDelete(confirmDeleteProperty.getValue());
preferences.getCopyToPreferences().setShouldAskForIncludingCrossReferences(shouldAskForIncludingCrossReferencesProperty.getValue());
workspacePreferences.setHideTabBar(confirmHideTabBarProperty().getValue());

libraryPreferences.setDefaultBibDatabaseMode(selectedBiblatexModeProperty.getValue());
Expand Down Expand Up @@ -374,6 +377,10 @@ public BooleanProperty confirmDeleteProperty() {
return this.confirmDeleteProperty;
}

public BooleanProperty shouldAskForIncludingCrossReferences() {
return this.shouldAskForIncludingCrossReferencesProperty;
}

public BooleanProperty confirmHideTabBarProperty() {
return this.hideTabBarProperty;
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2859,6 +2859,7 @@ Would\ you\ like\ to\ include\ cross-reference\ entries\ in\ the\ current\ opera

Entries\ copied\ successfully,\ including\ cross-references.=Entries copied successfully, including cross-references.
Entries\ copied\ successfully,\ without\ cross-references.=Entries copied successfully, without cross-references.
Ask\ whether\ to\ include\ cross-references\ when\ copying\ to\ another\ library=Ask whether to include cross-references when copying to another library

All\ patterns=All patterns
Author\ related=Author related
Expand Down