diff --git a/CHANGELOG.md b/CHANGELOG.md index 26bbe0bd10a..b021da6d6f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,7 +44,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We moved the preferences menu command from the options menu to the file menu. [#9768](https://github.com/JabRef/jabref/pull/9768) - We changed the handling of an "overflow" of authors at `[authIniN]`: JabRef uses `+` to indicate an overflow. Example: `[authIni2]` produces `A+` (instead of `AB`) for `Aachen and Berlin and Chemnitz`. [#9703](https://github.com/JabRef/jabref/pull/9703) - We moved the preferences option to open the last edited files on startup to the 'General' tab. [#9808](https://github.com/JabRef/jabref/pull/9808) - +- We split the 'Import and Export' tab into 'Web Search' and 'Export'. [#9839](https://github.com/JabRef/jabref/pull/9839) ### Fixed @@ -75,7 +75,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We removed the support of BibTeXML. [#9540](https://github.com/JabRef/jabref/issues/9540) - We removed support for Markdown syntax for strikethrough and task lists in comment fields. [#9726](https://github.com/JabRef/jabref/pull/9726) - We removed the options menu, because the two contents were moved to the File menu or the properties of the library. [#9768](https://github.com/JabRef/jabref/pull/9768) - +- We removed the 'File' tab in the preferences and moved its contents to the 'Export' tab. [#9839](https://github.com/JabRef/jabref/pull/9839) diff --git a/src/main/java/org/jabref/cli/ArgumentProcessor.java b/src/main/java/org/jabref/cli/ArgumentProcessor.java index b478c4a9a57..45ce8ba77d0 100644 --- a/src/main/java/org/jabref/cli/ArgumentProcessor.java +++ b/src/main/java/org/jabref/cli/ArgumentProcessor.java @@ -533,7 +533,7 @@ private void saveDatabase(BibDatabase newBase, String subName) { try (AtomicFileWriter fileWriter = new AtomicFileWriter(Path.of(subName), StandardCharsets.UTF_8)) { BibWriter bibWriter = new BibWriter(fileWriter, OS.NEWLINE); SaveConfiguration saveConfiguration = new SaveConfiguration() - .withReformatOnSave(preferencesService.getImportExportPreferences().shouldAlwaysReformatOnSave()); + .withReformatOnSave(preferencesService.getExportPreferences().shouldAlwaysReformatOnSave()); BibDatabaseWriter databaseWriter = new BibtexDatabaseWriter( bibWriter, diff --git a/src/main/java/org/jabref/gui/LibraryTab.java b/src/main/java/org/jabref/gui/LibraryTab.java index 1ba41fce4d3..bc0ac7fb296 100644 --- a/src/main/java/org/jabref/gui/LibraryTab.java +++ b/src/main/java/org/jabref/gui/LibraryTab.java @@ -297,7 +297,7 @@ public void installAutosaveManagerAndBackupManager() { private boolean isDatabaseReadyForAutoSave(BibDatabaseContext context) { return ((context.getLocation() == DatabaseLocation.SHARED) || ((context.getLocation() == DatabaseLocation.LOCAL) - && preferencesService.getImportExportPreferences().shouldAutoSave())) + && preferencesService.getExportPreferences().shouldAutoSave())) && context.getDatabasePath().isPresent(); } @@ -313,7 +313,7 @@ private boolean isDatabaseReadyForBackup(BibDatabaseContext context) { * Example: *jabref-authors.bib – testbib */ public void updateTabTitle(boolean isChanged) { - boolean isAutosaveEnabled = preferencesService.getImportExportPreferences().shouldAutoSave(); + boolean isAutosaveEnabled = preferencesService.getExportPreferences().shouldAutoSave(); DatabaseLocation databaseLocation = bibDatabaseContext.getLocation(); Optional file = bibDatabaseContext.getDatabasePath(); diff --git a/src/main/java/org/jabref/gui/copyfiles/CopyFilesAction.java b/src/main/java/org/jabref/gui/copyfiles/CopyFilesAction.java index 4317dbeef8e..77d38da37a9 100644 --- a/src/main/java/org/jabref/gui/copyfiles/CopyFilesAction.java +++ b/src/main/java/org/jabref/gui/copyfiles/CopyFilesAction.java @@ -47,7 +47,7 @@ public void execute() { List entries = stateManager.getSelectedEntries(); DirectoryDialogConfiguration dirDialogConfiguration = new DirectoryDialogConfiguration.Builder() - .withInitialDirectory(preferencesService.getImportExportPreferences().getExportWorkingDirectory()) + .withInitialDirectory(preferencesService.getExportPreferences().getExportWorkingDirectory()) .build(); Optional exportPath = dialogService.showDirectorySelectionDialog(dirDialogConfiguration); exportPath.ifPresent(path -> { diff --git a/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialogViewModel.java b/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialogViewModel.java index cd08d6a56e8..2fae491983f 100644 --- a/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialogViewModel.java +++ b/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialogViewModel.java @@ -58,7 +58,7 @@ public CreateModifyExporterDialogViewModel(ExporterViewModel exporter, public ExporterViewModel saveExporter() { Path layoutFileDir = Path.of(layoutFile.get()).getParent(); if (layoutFileDir != null) { - preferences.getImportExportPreferences().setExportWorkingDirectory(layoutFileDir); + preferences.getExportPreferences().setExportWorkingDirectory(layoutFileDir); } // Check that there are no empty strings. @@ -85,7 +85,7 @@ public void browse() { FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() .addExtensionFilter(Localization.lang("Custom layout file"), StandardFileType.LAYOUT) .withDefaultExtension(Localization.lang("Custom layout file"), StandardFileType.LAYOUT) - .withInitialDirectory(preferences.getImportExportPreferences().getExportWorkingDirectory()).build(); + .withInitialDirectory(preferences.getExportPreferences().getExportWorkingDirectory()).build(); dialogService.showFileOpenDialog(fileDialogConfiguration).ifPresent(f -> layoutFile.set(f.toAbsolutePath().toString())); } diff --git a/src/main/java/org/jabref/gui/exporter/ExportCommand.java b/src/main/java/org/jabref/gui/exporter/ExportCommand.java index c5479d8c2cd..672615b6c2a 100644 --- a/src/main/java/org/jabref/gui/exporter/ExportCommand.java +++ b/src/main/java/org/jabref/gui/exporter/ExportCommand.java @@ -78,8 +78,8 @@ public void execute() { FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() .addExtensionFilter(FileFilterConverter.exporterToExtensionFilter(exporters)) - .withDefaultExtension(preferences.getImportExportPreferences().getLastExportExtension()) - .withInitialDirectory(preferences.getImportExportPreferences().getExportWorkingDirectory()) + .withDefaultExtension(preferences.getExportPreferences().getLastExportExtension()) + .withInitialDirectory(preferences.getExportPreferences().getExportWorkingDirectory()) .build(); dialogService.showFileSaveDialog(fileDialogConfiguration) .ifPresent(path -> export(path, fileDialogConfiguration.getSelectedExtensionFilter(), exporters)); @@ -110,8 +110,8 @@ private void export(Path file, FileChooser.ExtensionFilter selectedExtensionFilt // Make sure we remember which filter was used, to set // the default for next time: - preferences.getImportExportPreferences().setLastExportExtension(format.getName()); - preferences.getImportExportPreferences().setExportWorkingDirectory(file.getParent()); + preferences.getExportPreferences().setLastExportExtension(format.getName()); + preferences.getExportPreferences().setExportWorkingDirectory(file.getParent()); final List finEntries = entries; diff --git a/src/main/java/org/jabref/gui/exporter/ExportToClipboardAction.java b/src/main/java/org/jabref/gui/exporter/ExportToClipboardAction.java index 79a044aef28..9ef046d4207 100644 --- a/src/main/java/org/jabref/gui/exporter/ExportToClipboardAction.java +++ b/src/main/java/org/jabref/gui/exporter/ExportToClipboardAction.java @@ -84,7 +84,7 @@ public void execute() { // Find default choice, if any Exporter defaultChoice = exporters.stream() - .filter(exporter -> exporter.getName().equals(preferences.getImportExportPreferences().getLastExportExtension())) + .filter(exporter -> exporter.getName().equals(preferences.getExportPreferences().getLastExportExtension())) .findAny() .orElse(null); @@ -107,7 +107,7 @@ private ExportResult exportToClipboard(Exporter exporter) throws Exception { .orElse(List.of(preferences.getFilePreferences().getWorkingDirectory())); // Add chosen export type to last used preference, to become default - preferences.getImportExportPreferences().setLastExportExtension(exporter.getName()); + preferences.getExportPreferences().setLastExportExtension(exporter.getName()); Path tmp = null; try { diff --git a/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java b/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java index 78d79b3ff3e..95fa69f1777 100644 --- a/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java +++ b/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java @@ -233,7 +233,7 @@ private boolean saveDatabase(Path file, boolean selectedOnly, Charset encoding, SaveConfiguration saveConfiguration = new SaveConfiguration() .withSaveType(saveType) - .withReformatOnSave(preferences.getImportExportPreferences().shouldAlwaysReformatOnSave()); + .withReformatOnSave(preferences.getExportPreferences().shouldAlwaysReformatOnSave()); BibDatabaseContext bibDatabaseContext = libraryTab.getBibDatabaseContext(); synchronized (bibDatabaseContext) { try (AtomicFileWriter fileWriter = new AtomicFileWriter(file, encoding, saveConfiguration.shouldMakeBackup())) { diff --git a/src/main/java/org/jabref/gui/importer/ImportCommand.java b/src/main/java/org/jabref/gui/importer/ImportCommand.java index 8e40e6c0c49..ab0188c6f00 100644 --- a/src/main/java/org/jabref/gui/importer/ImportCommand.java +++ b/src/main/java/org/jabref/gui/importer/ImportCommand.java @@ -54,7 +54,7 @@ public void execute() { .addExtensionFilter(FileFilterConverter.ANY_FILE) .addExtensionFilter(FileFilterConverter.forAllImporters(importers)) .addExtensionFilter(FileFilterConverter.importerToExtensionFilter(importers)) - .withInitialDirectory(preferences.getImportExportPreferences().getImportWorkingDirectory()) + .withInitialDirectory(preferences.getImporterPreferences().getImportWorkingDirectory()) .build(); dialogService.showFileOpenDialog(fileDialogConfiguration) .ifPresent(path -> doImport(path, importers, fileDialogConfiguration.getSelectedExtensionFilter())); @@ -71,6 +71,6 @@ private void doImport(Path file, SortedSet importers, FileChooser.Exte ImportAction importMenu = new ImportAction(frame, openInNew, format.orElse(null), preferences); importMenu.automatedImport(Collections.singletonList(file.toString())); // Set last working dir for import - preferences.getImportExportPreferences().setImportWorkingDirectory(file.getParent()); + preferences.getImporterPreferences().setImportWorkingDirectory(file.getParent()); } } diff --git a/src/main/java/org/jabref/gui/importer/ImportEntriesViewModel.java b/src/main/java/org/jabref/gui/importer/ImportEntriesViewModel.java index dfd27079cff..dd2277b4e98 100644 --- a/src/main/java/org/jabref/gui/importer/ImportEntriesViewModel.java +++ b/src/main/java/org/jabref/gui/importer/ImportEntriesViewModel.java @@ -126,7 +126,7 @@ public boolean hasDuplicate(BibEntry entry) { public void importEntries(List entriesToImport, boolean shouldDownloadFiles) { // Check if we are supposed to warn about duplicates. // If so, then see if there are duplicates, and warn if yes. - if (preferences.getImportExportPreferences().shouldWarnAboutDuplicatesOnImport()) { + if (preferences.getImporterPreferences().shouldWarnAboutDuplicatesOnImport()) { BackgroundTask.wrap(() -> entriesToImport.stream() .anyMatch(this::hasDuplicate)).onSuccess(duplicateFound -> { if (duplicateFound) { @@ -135,7 +135,7 @@ public void importEntries(List entriesToImport, boolean shouldDownload Localization.lang("Continue with import"), Localization.lang("Cancel import"), Localization.lang("Do not ask again"), - optOut -> preferences.getImportExportPreferences().setWarnAboutDuplicatesOnImport(!optOut)); + optOut -> preferences.getImporterPreferences().setWarnAboutDuplicatesOnImport(!optOut)); if (!continueImport) { dialogService.notify(Localization.lang("Import canceled")); diff --git a/src/main/java/org/jabref/gui/libraryproperties/saving/SavingPropertiesViewModel.java b/src/main/java/org/jabref/gui/libraryproperties/saving/SavingPropertiesViewModel.java index 848645ae318..3216e60e2ed 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/saving/SavingPropertiesViewModel.java +++ b/src/main/java/org/jabref/gui/libraryproperties/saving/SavingPropertiesViewModel.java @@ -50,7 +50,7 @@ public SavingPropertiesViewModel(BibDatabaseContext databaseContext, Preferences this.preferencesService = preferencesService; this.initialMetaData = databaseContext.getMetaData(); this.exportSaveOrder = initialMetaData.getSaveOrderConfig() - .orElseGet(() -> preferencesService.getImportExportPreferences().getExportSaveOrder()); + .orElseGet(() -> preferencesService.getExportPreferences().getExportSaveOrder()); } @Override diff --git a/src/main/java/org/jabref/gui/preferences/PreferencesDialogViewModel.java b/src/main/java/org/jabref/gui/preferences/PreferencesDialogViewModel.java index 5b713d53172..0515e37561e 100644 --- a/src/main/java/org/jabref/gui/preferences/PreferencesDialogViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/PreferencesDialogViewModel.java @@ -19,13 +19,12 @@ import org.jabref.gui.preferences.customimporter.CustomImporterTab; import org.jabref.gui.preferences.entry.EntryTab; import org.jabref.gui.preferences.entryeditor.EntryEditorTab; -import org.jabref.gui.preferences.entryeditortabs.CustomEditorFieldsTab; +import org.jabref.gui.preferences.entryeditortabs.EntryEditorTabsTab; +import org.jabref.gui.preferences.export.ExportTab; import org.jabref.gui.preferences.external.ExternalTab; import org.jabref.gui.preferences.externalfiletypes.ExternalFileTypesTab; -import org.jabref.gui.preferences.file.FileTab; import org.jabref.gui.preferences.general.GeneralTab; import org.jabref.gui.preferences.groups.GroupsTab; -import org.jabref.gui.preferences.importexport.ImportExportTab; import org.jabref.gui.preferences.journals.JournalAbbreviationsTab; import org.jabref.gui.preferences.keybindings.KeyBindingsTab; import org.jabref.gui.preferences.linkedfiles.LinkedFilesTab; @@ -34,6 +33,7 @@ import org.jabref.gui.preferences.preview.PreviewTab; import org.jabref.gui.preferences.protectedterms.ProtectedTermsTab; import org.jabref.gui.preferences.table.TableTab; +import org.jabref.gui.preferences.websearch.WebSearchTab; import org.jabref.gui.preferences.xmp.XmpPrivacyTab; import org.jabref.gui.util.FileDialogConfiguration; import org.jabref.logic.JabRefException; @@ -62,7 +62,6 @@ public PreferencesDialogViewModel(DialogService dialogService, PreferencesServic preferenceTabs = FXCollections.observableArrayList( new GeneralTab(), new KeyBindingsTab(), - new FileTab(), new EntryTab(), new TableTab(), new PreviewTab(), @@ -72,8 +71,9 @@ public PreferencesDialogViewModel(DialogService dialogService, PreferencesServic new JournalAbbreviationsTab(), new GroupsTab(), new EntryEditorTab(), - new ImportExportTab(), - new CustomEditorFieldsTab(), + new WebSearchTab(), + new ExportTab(), + new EntryEditorTabsTab(), new CitationKeyPatternTab(), new LinkedFilesTab(), new NameFormatterTab(), diff --git a/src/main/java/org/jabref/gui/preferences/entry/EntryTab.fxml b/src/main/java/org/jabref/gui/preferences/entry/EntryTab.fxml index 81028a987d1..2bece2af293 100644 --- a/src/main/java/org/jabref/gui/preferences/entry/EntryTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/entry/EntryTab.fxml @@ -1,5 +1,6 @@ + @@ -12,9 +13,29 @@ fx:controller="org.jabref.gui.preferences.entry.EntryTab">