diff --git a/.mailmap b/.mailmap index b8698d75865..3af3033fd28 100644 --- a/.mailmap +++ b/.mailmap @@ -142,4 +142,5 @@ Johannes Manner Dominik Traczyk Cerrianne Santos Stefan Scheffel -Stefan Gerzmann \ No newline at end of file +Stefan Gerzmann +Deepak Kumar diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ec7d2b519a..651ab6ab391 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We changed the title of Group Dialog to "Add subgroup" from "Edit group" when we select Add subgroup option. - We enable import button only if entries are selected. [#4755](https://github.com/JabRef/jabref/issues/4755) - We made modifications to improve contrast of UI elements. [#4583](https://github.com/JabRef/jabref/issues/4583) +- We added an option in the settings to set the default action in JabRef when right clicking on any entry in any database and selecting "Open folder". [#4763](https://github.com/JabRef/jabref/issues/4763) - The Medline fetcher now normalizes the author names according to the BibTeX-Standard [#4345](https://github.com/JabRef/jabref/issues/4345) @@ -105,13 +106,14 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - 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 "Move to group" would always move the first entry in the library and not the selected [#4414](https://github.com/JabRef/jabref/issues/4414) - We fixed an issue where an older dialog appears when downloading full texts from the quality menu. [#4489](https://github.com/JabRef/jabref/issues/4489) +- We fixed an issue where right clicking on any entry in any database and selecting "Open folder" results in the NullPointer exception. [#4763](https://github.com/JabRef/jabref/issues/4763) +- We fixed an issue where option 'open terminal here' with custom command was passing wrong argument. [#4802](https://github.com/JabRef/jabref/issues/4802) - We fixed an issue where ranking an entry would generate an IllegalArgumentException. [#4754](https://github.com/JabRef/jabref/issues/4754) - We fixed an issue where special characters where removed from non label key generation pattern parts [#4767](https://github.com/JabRef/jabref/issues/4767) - We fixed an issue where the RIS import would overwite the article date with the value of the acessed date [#4816](https://github.com/JabRef/jabref/issues/4816) - ### Removed - The feature to "mark entries" was removed and merged with the groups functionality. For migration, a group is created for every value of the `__markedentry` field and the entry is added to this group. - The number column was removed. diff --git a/src/main/java/org/jabref/gui/desktop/JabRefDesktop.java b/src/main/java/org/jabref/gui/desktop/JabRefDesktop.java index fbd9478789b..befd35ed0af 100644 --- a/src/main/java/org/jabref/gui/desktop/JabRefDesktop.java +++ b/src/main/java/org/jabref/gui/desktop/JabRefDesktop.java @@ -166,7 +166,33 @@ private static void openExternalFilePlatformIndependent(Optional updateExecuteConsoleButtonAndFieldEnabledState()); executeConsole.setOnAction(e -> updateExecuteConsoleButtonAndFieldEnabledState()); browseButton.setOnAction(e -> showConsoleChooser()); + fileBrowserButton.disableProperty().bind(executeFileBrowser.selectedProperty().not()); + fileBrowserCommand.disableProperty().bind(executeFileBrowser.selectedProperty().not()); + fileBrowserButton.setOnAction(e -> showFileBrowserCommandChooser()); + browseAdobeAcrobatReader.setOnAction(e -> showAdobeChooser()); GridPane consoleOptionPanel = new GridPane(); @@ -83,6 +99,17 @@ public ExternalTab(JabRefFrame frame, PreferencesDialog prefsDiag, JabRefPrefere adobeAcrobatReader.setToggleGroup(pdfReaderGroup); pdfOptionPanel.add(browseAdobeAcrobatReader, 3, 1); + Label fileBrowserCommandDescription = new Label(Localization.lang("Note: Use the placeholder %0 for the location of the opened library file.", "%DIR")); + GridPane fileBrowserOptionPanel = new GridPane(); + final ToggleGroup fileBrowserGroup = new ToggleGroup(); + defaultFileBrowser.setToggleGroup(fileBrowserGroup); + executeFileBrowser.setToggleGroup(fileBrowserGroup); + fileBrowserOptionPanel.add(defaultFileBrowser, 1, 1); + fileBrowserOptionPanel.add(executeFileBrowser, 1, 2); + fileBrowserOptionPanel.add(fileBrowserCommand, 2, 2); + fileBrowserOptionPanel.add(fileBrowserButton, 3, 2); + fileBrowserOptionPanel.add(fileBrowserCommandDescription, 2, 3); + if (OS.WINDOWS) { browseSumatraReader.setOnAction(e -> showSumatraChooser()); pdfOptionPanel.add(sumatraReader, 1, 2); @@ -133,6 +160,12 @@ public ExternalTab(JabRefFrame frame, PreferencesDialog prefsDiag, JabRefPrefere builder.add(pdfOptionPanel, 1, 13); + Label openFileBrowser = new Label(Localization.lang("Open File Browser")); + openFileBrowser.getStyleClass().add("sectionHeader"); + builder.add(openFileBrowser, 1, 14); + + builder.add(fileBrowserOptionPanel, 1, 15); + } @Override @@ -165,6 +198,10 @@ public void setValues() { consoleCommand.setText(Globals.prefs.get(JabRefPreferences.CONSOLE_COMMAND)); + defaultFileBrowser.setSelected(Globals.prefs.getBoolean(JabRefPreferences.USE_DEFAULT_FILE_BROWSER_APPLICATION)); + executeFileBrowser.setSelected(!Globals.prefs.getBoolean(JabRefPreferences.USE_DEFAULT_FILE_BROWSER_APPLICATION)); + fileBrowserCommand.setText(Globals.prefs.get(JabRefPreferences.FILE_BROWSER_COMMAND)); + adobeAcrobatReaderPath.setText(Globals.prefs.get(JabRefPreferences.ADOBE_ACROBAT_COMMAND)); if (OS.WINDOWS) { sumatraReaderPath.setText(Globals.prefs.get(JabRefPreferences.SUMATRA_PDF_COMMAND)); @@ -187,6 +224,13 @@ public void storeSettings() { prefs.putBoolean(JabRefPreferences.USE_DEFAULT_CONSOLE_APPLICATION, defaultConsole.isSelected()); prefs.put(JabRefPreferences.CONSOLE_COMMAND, consoleCommand.getText()); prefs.put(JabRefPreferences.ADOBE_ACROBAT_COMMAND, adobeAcrobatReaderPath.getText()); + + prefs.putBoolean(JabRefPreferences.USE_DEFAULT_FILE_BROWSER_APPLICATION, defaultFileBrowser.isSelected()); + if (StringUtil.isNotBlank(fileBrowserCommand.getText())) { + prefs.put(JabRefPreferences.FILE_BROWSER_COMMAND, fileBrowserCommand.getText()); + } else { + prefs.putBoolean(JabRefPreferences.USE_DEFAULT_FILE_BROWSER_APPLICATION, true); //default if no command specified + } if (OS.WINDOWS) { prefs.put(JabRefPreferences.SUMATRA_PDF_COMMAND, sumatraReaderPath.getText()); } @@ -220,6 +264,10 @@ private void showSumatraChooser() { dialogService.showFileOpenDialog(fileDialogConfiguration).ifPresent(file -> sumatraReaderPath.setText(file.toAbsolutePath().toString())); } + private void showFileBrowserCommandChooser() { + dialogService.showFileOpenDialog(fileDialogConfiguration).ifPresent(file -> fileBrowserCommand.setText(file.toAbsolutePath().toString())); + } + private void readerSelected() { if (adobeAcrobatReader.isSelected()) { prefs.put(JabRefPreferences.USE_PDF_READER, adobeAcrobatReaderPath.getText()); diff --git a/src/main/java/org/jabref/preferences/JabRefPreferences.java b/src/main/java/org/jabref/preferences/JabRefPreferences.java index 88eae71f20a..92b6fa622a0 100644 --- a/src/main/java/org/jabref/preferences/JabRefPreferences.java +++ b/src/main/java/org/jabref/preferences/JabRefPreferences.java @@ -244,6 +244,9 @@ public class JabRefPreferences implements PreferencesService { public static final String ADOBE_ACROBAT_COMMAND = "adobeAcrobatCommand"; public static final String SUMATRA_PDF_COMMAND = "sumatraCommand"; public static final String USE_PDF_READER = "usePDFReader"; + public static final String USE_DEFAULT_FILE_BROWSER_APPLICATION = "userDefaultFileBrowserApplication"; + public static final String FILE_BROWSER_COMMAND = "fileBrowserCommand"; + // Currently, it is not possible to specify defaults for specific entry types // When this should be made possible, the code to inspect is org.jabref.gui.preferences.BibtexKeyPatternPrefTab.storeSettings() -> LabelPattern keypatterns = getCiteKeyPattern(); etc public static final String DEFAULT_BIBTEX_KEY_PATTERN = "defaultBibtexKeyPattern"; @@ -729,16 +732,19 @@ private JabRefPreferences() { defaults.put(USE_UNIT_FORMATTER_ON_SEARCH, Boolean.TRUE); defaults.put(USE_DEFAULT_CONSOLE_APPLICATION, Boolean.TRUE); + defaults.put(USE_DEFAULT_FILE_BROWSER_APPLICATION, Boolean.TRUE); if (OS.WINDOWS) { defaults.put(CONSOLE_COMMAND, "C:\\Program Files\\ConEmu\\ConEmu64.exe /single /dir \"%DIR\""); defaults.put(ADOBE_ACROBAT_COMMAND, "C:\\Program Files (x86)\\Adobe\\Acrobat Reader DC\\Reader"); defaults.put(SUMATRA_PDF_COMMAND, "C:\\Program Files\\SumatraPDF"); defaults.put(USE_PDF_READER, ADOBE_ACROBAT_COMMAND); + defaults.put(FILE_BROWSER_COMMAND, "explorer.exe /select, \"%DIR\""); } else { defaults.put(CONSOLE_COMMAND, ""); defaults.put(ADOBE_ACROBAT_COMMAND, ""); defaults.put(SUMATRA_PDF_COMMAND, ""); defaults.put(USE_PDF_READER, ""); + defaults.put(FILE_BROWSER_COMMAND, ""); } //versioncheck defaults diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 7398d8fc491..1d75fc2d918 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -1689,7 +1689,6 @@ Open\ console=Open console Use\ default\ terminal\ emulator=Use default terminal emulator Execute\ command=Execute command Note\:\ Use\ the\ placeholder\ %0\ for\ the\ location\ of\ the\ opened\ library\ file.=Note: Use the placeholder %0 for the location of the opened library file. -Executing\ command\ \"%0\"...=Executing command \"%0\"... Error\ occured\ while\ executing\ the\ command\ \"%0\".=Error occured while executing the command \"%0\". Reformat\ ISSN=Reformat ISSN @@ -2081,6 +2080,12 @@ Use\ selected\ document=Use selected document Accept\ changes=Accept changes Dismiss\ changes=Dismiss changes The\ library\ has\ been\ modified\ by\ another\ program.=The library has been modified by another program. + +Browser=Browser +Execute\ Command=Execute Command +Open\ File\ Browser=Open File Browser +Use\ default\ file\ browser=Use default file browser + Set\ rank\ to\ one=Set rank to one Set\ rank\ to\ two=Set rank to two Set\ rank\ to\ three=Set rank to three