diff --git a/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.fxml b/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.fxml
index 574112bc8ab..6675f474304 100644
--- a/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.fxml
+++ b/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.fxml
@@ -21,6 +21,10 @@
+
+
+
+
diff --git a/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.java b/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.java
index f842ba1233e..2a9073041d0 100644
--- a/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.java
+++ b/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.java
@@ -33,6 +33,8 @@ public class WebSearchTab extends AbstractPreferenceTabView defaultPlainCitationParser;
@FXML private CheckBox useCustomDOI;
@@ -76,6 +78,10 @@ public void initialize() {
downloadLinkedOnlineFiles.selectedProperty().bindBidirectional(viewModel.shouldDownloadLinkedOnlineFiles());
keepDownloadUrl.selectedProperty().bindBidirectional(viewModel.shouldKeepDownloadUrl());
+ addImportedEntries.selectedProperty().bindBidirectional(viewModel.getAddImportedEntries());
+ addImportedEntriesGroupName.textProperty().bindBidirectional(viewModel.getAddImportedEntriesGroupName());
+ addImportedEntriesGroupName.disableProperty().bind(addImportedEntries.selectedProperty().not());
+
new ViewModelListCellFactory()
.withText(PlainCitationParserChoice::getLocalizedName)
.install(defaultPlainCitationParser);
diff --git a/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTabViewModel.java b/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTabViewModel.java
index ced3fc6a146..800303a513b 100644
--- a/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTabViewModel.java
+++ b/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTabViewModel.java
@@ -21,6 +21,7 @@
import org.jabref.gui.preferences.PreferenceTabViewModel;
import org.jabref.gui.slr.StudyCatalogItem;
import org.jabref.logic.FilePreferences;
+import org.jabref.logic.LibraryPreferences;
import org.jabref.logic.importer.ImportFormatPreferences;
import org.jabref.logic.importer.ImporterPreferences;
import org.jabref.logic.importer.SearchBasedFetcher;
@@ -48,6 +49,9 @@ public class WebSearchTabViewModel implements PreferenceTabViewModel {
new SimpleListProperty<>(FXCollections.observableArrayList(PlainCitationParserChoice.values()));
private final ObjectProperty defaultPlainCitationParser = new SimpleObjectProperty<>();
+ private final BooleanProperty addImportedEntries = new SimpleBooleanProperty();
+ private final StringProperty addImportedEntriesGroupName = new SimpleStringProperty("");
+
private final BooleanProperty useCustomDOIProperty = new SimpleBooleanProperty();
private final StringProperty useCustomDOINameProperty = new SimpleStringProperty("");
@@ -67,6 +71,7 @@ public class WebSearchTabViewModel implements PreferenceTabViewModel {
private final ImporterPreferences importerPreferences;
private final FilePreferences filePreferences;
private final ImportFormatPreferences importFormatPreferences;
+ private final LibraryPreferences libraryPreferences;
private final ReadOnlyBooleanProperty refAiEnabled;
@@ -78,6 +83,7 @@ public WebSearchTabViewModel(CliPreferences preferences, DialogService dialogSer
this.doiPreferences = preferences.getDOIPreferences();
this.filePreferences = preferences.getFilePreferences();
this.importFormatPreferences = preferences.getImportFormatPreferences();
+ this.libraryPreferences = preferences.getLibraryPreferences();
this.refAiEnabled = refAiEnabled;
@@ -128,6 +134,12 @@ public void setValues() {
warnAboutDuplicatesOnImportProperty.setValue(importerPreferences.shouldWarnAboutDuplicatesOnImport());
shouldDownloadLinkedOnlineFiles.setValue(filePreferences.shouldDownloadLinkedFiles());
shouldkeepDownloadUrl.setValue(filePreferences.shouldKeepDownloadUrl());
+ addImportedEntries.setValue(libraryPreferences.isAddImportedEntriesEnabled());
+ if (libraryPreferences.getAddImportedEntriesGroupName().isEmpty()) {
+ addImportedEntriesGroupName.setValue(Localization.lang("Imported entries"));
+ } else {
+ addImportedEntriesGroupName.setValue(libraryPreferences.getAddImportedEntriesGroupName());
+ }
defaultPlainCitationParser.setValue(importerPreferences.getDefaultPlainCitationParser());
useCustomDOIProperty.setValue(doiPreferences.isUseCustom());
@@ -159,7 +171,14 @@ public void storeSettings() {
importerPreferences.setWarnAboutDuplicatesOnImport(warnAboutDuplicatesOnImportProperty.getValue());
filePreferences.setDownloadLinkedFiles(shouldDownloadLinkedOnlineFiles.getValue());
filePreferences.setKeepDownloadUrl(shouldkeepDownloadUrl.getValue());
+ libraryPreferences.setAddImportedEntries(addImportedEntries.getValue());
+ if (addImportedEntriesGroupName.getValue().isEmpty() || addImportedEntriesGroupName.getValue().startsWith(" ")) {
+ libraryPreferences.setAddImportedEntriesGroupName("");
+ } else {
+ libraryPreferences.setAddImportedEntriesGroupName(addImportedEntriesGroupName.getValue());
+ }
importerPreferences.setDefaultPlainCitationParser(defaultPlainCitationParser.getValue());
+
grobidPreferences.setGrobidEnabled(grobidEnabledProperty.getValue());
grobidPreferences.setGrobidUseAsked(grobidPreferences.isGrobidUseAsked());
grobidPreferences.setGrobidURL(grobidURLProperty.getValue());
@@ -189,6 +208,14 @@ public ObjectProperty defaultPlainCitationParserPrope
return defaultPlainCitationParser;
}
+ public BooleanProperty getAddImportedEntries() {
+ return addImportedEntries;
+ }
+
+ public StringProperty getAddImportedEntriesGroupName() {
+ return addImportedEntriesGroupName;
+ }
+
public BooleanProperty useCustomDOIProperty() {
return this.useCustomDOIProperty;
}
diff --git a/src/main/java/org/jabref/logic/LibraryPreferences.java b/src/main/java/org/jabref/logic/LibraryPreferences.java
index 64ca8501de0..31ae85d78a2 100644
--- a/src/main/java/org/jabref/logic/LibraryPreferences.java
+++ b/src/main/java/org/jabref/logic/LibraryPreferences.java
@@ -4,6 +4,8 @@
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleObjectProperty;
+import javafx.beans.property.SimpleStringProperty;
+import javafx.beans.property.StringProperty;
import org.jabref.model.database.BibDatabaseMode;
@@ -12,13 +14,17 @@ public class LibraryPreferences {
private final ObjectProperty defaultBibDatabaseMode;
private final BooleanProperty alwaysReformatOnSave;
private final BooleanProperty autoSave;
+ private final BooleanProperty addImportedEntries;
+ private final StringProperty addImportedEntriesGroupName;
public LibraryPreferences(BibDatabaseMode defaultBibDatabaseMode,
boolean alwaysReformatOnSave,
- boolean autoSave) {
+ boolean autoSave, boolean addImportedEntries, String addImportedEntriesGroupName) {
this.defaultBibDatabaseMode = new SimpleObjectProperty<>(defaultBibDatabaseMode);
this.alwaysReformatOnSave = new SimpleBooleanProperty(alwaysReformatOnSave);
this.autoSave = new SimpleBooleanProperty(autoSave);
+ this.addImportedEntries = new SimpleBooleanProperty(addImportedEntries);
+ this.addImportedEntriesGroupName = new SimpleStringProperty(addImportedEntriesGroupName);
}
public BibDatabaseMode getDefaultBibDatabaseMode() {
@@ -56,4 +62,28 @@ public BooleanProperty autoSaveProperty() {
public void setAutoSave(boolean shouldAutoSave) {
this.autoSave.set(shouldAutoSave);
}
+
+ public boolean isAddImportedEntriesEnabled() {
+ return addImportedEntries.get();
+ }
+
+ public BooleanProperty addImportedEntriesProperty() {
+ return addImportedEntries;
+ }
+
+ public void setAddImportedEntries(boolean addImportedEntries) {
+ this.addImportedEntries.set(addImportedEntries);
+ }
+
+ public String getAddImportedEntriesGroupName() {
+ return addImportedEntriesGroupName.get();
+ }
+
+ public StringProperty addImportedEntriesGroupNameProperty() {
+ return addImportedEntriesGroupName;
+ }
+
+ public void setAddImportedEntriesGroupName(String addImportedEntriesGroupName) {
+ this.addImportedEntriesGroupName.set(addImportedEntriesGroupName);
+ }
}
diff --git a/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java b/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java
index 7df1c943415..eeb948fe2c6 100644
--- a/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java
+++ b/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java
@@ -171,6 +171,9 @@ public class JabRefCliPreferences implements CliPreferences {
public static final String MEMORY_STICK_MODE = "memoryStickMode";
public static final String DEFAULT_ENCODING = "defaultEncoding";
+ private static final String ADD_IMPORTED_ENTRIES = "addImportedEntries";
+ private static final String ADD_IMPORTED_ENTRIES_GROUP_NAME = "addImportedEntriesGroupName";
+
public static final String BASE_DOI_URI = "baseDOIURI";
public static final String USE_CUSTOM_DOI_URI = "useCustomDOIURI";
@@ -470,6 +473,9 @@ protected JabRefCliPreferences() {
defaults.put(IMPORTERS_ENABLED, Boolean.TRUE);
defaults.put(GENERATE_KEY_ON_IMPORT, Boolean.TRUE);
+ defaults.put(ADD_IMPORTED_ENTRIES, Boolean.FALSE);
+ defaults.put(ADD_IMPORTED_ENTRIES_GROUP_NAME, Localization.lang("Imported entries"));
+
// region: Grobid
defaults.put(GROBID_ENABLED, Boolean.FALSE);
defaults.put(GROBID_PREFERENCE, Boolean.FALSE);
@@ -1175,12 +1181,17 @@ public LibraryPreferences getLibraryPreferences() {
libraryPreferences = new LibraryPreferences(
getBoolean(BIBLATEX_DEFAULT_MODE) ? BibDatabaseMode.BIBLATEX : BibDatabaseMode.BIBTEX,
getBoolean(REFORMAT_FILE_ON_SAVE_AND_EXPORT),
- getBoolean(LOCAL_AUTO_SAVE));
+ getBoolean(LOCAL_AUTO_SAVE),
+ getBoolean(ADD_IMPORTED_ENTRIES),
+ get(ADD_IMPORTED_ENTRIES_GROUP_NAME));
EasyBind.listen(libraryPreferences.defaultBibDatabaseModeProperty(), (obs, oldValue, newValue) -> putBoolean(BIBLATEX_DEFAULT_MODE, (newValue == BibDatabaseMode.BIBLATEX)));
EasyBind.listen(libraryPreferences.alwaysReformatOnSaveProperty(), (obs, oldValue, newValue) -> putBoolean(REFORMAT_FILE_ON_SAVE_AND_EXPORT, newValue));
EasyBind.listen(libraryPreferences.autoSaveProperty(), (obs, oldValue, newValue) -> putBoolean(LOCAL_AUTO_SAVE, newValue));
+ EasyBind.listen(libraryPreferences.addImportedEntriesProperty(), (obs, oldValue, newValue) -> putBoolean(ADD_IMPORTED_ENTRIES, newValue));
+ EasyBind.listen(libraryPreferences.addImportedEntriesGroupNameProperty(), (obs, oldValue, newValue) -> put(ADD_IMPORTED_ENTRIES_GROUP_NAME, newValue));
+
return libraryPreferences;
}
diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties
index 0b4b2bc6b97..030d3af2e00 100644
--- a/src/main/resources/l10n/JabRef_en.properties
+++ b/src/main/resources/l10n/JabRef_en.properties
@@ -2459,6 +2459,8 @@ Unprotect\ terms=Unprotect terms
Generate\ a\ new\ key\ for\ imported\ entries\ (overwriting\ their\ default)=Generate a new key for imported entries (overwriting their default)
Warn\ about\ duplicates\ on\ import=Warn about duplicates on import
+Add\ imported\ entries\ to\ group=Add imported entries to group
+
Custom\ DOI\ URI=Custom DOI URI
Use\ custom\ DOI\ base\ URI\ for\ article\ access=Use custom DOI base URI for article access