From cbd26f11f54f4a46c2597b6ba564b76aa9d68c88 Mon Sep 17 00:00:00 2001 From: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com> Date: Mon, 16 Mar 2020 09:36:07 +0100 Subject: [PATCH] Small improvements in preferences dialog (#6130) * Changed special buttons to icon buttons * Changed ComboBox lists to use proper display name and added spinner to font size * Fixed KeyPress event * Reworded biblatex to BibLaTeX * l10n * Removed obsolete special pdf treatment in preferences * CHANGELOG.md and removed forgotten bindings * Fixed wrong biblatex fix * checkstyle --- CHANGELOG.md | 5 ++- .../jabref/gui/desktop/os/DefaultDesktop.java | 6 ---- .../java/org/jabref/gui/desktop/os/Linux.java | 23 ------------- .../jabref/gui/desktop/os/NativeDesktop.java | 9 ----- .../java/org/jabref/gui/desktop/os/OSX.java | 6 ---- .../org/jabref/gui/desktop/os/Windows.java | 22 ------------ .../org/jabref/gui/exporter/SaveAction.java | 2 +- .../java/org/jabref/gui/icon/IconTheme.java | 1 + .../jabref/gui/preferences/AppearanceTab.fxml | 8 ++--- .../gui/preferences/AppearanceTabView.java | 14 +++++--- .../preferences/AppearanceTabViewModel.java | 4 +++ .../jabref/gui/preferences/ExternalTab.fxml | 21 ------------ .../gui/preferences/ExternalTabView.java | 17 ---------- .../gui/preferences/ExternalTabViewModel.java | 22 ------------ .../jabref/gui/preferences/FileTabView.java | 4 +++ .../jabref/gui/preferences/GeneralTab.fxml | 2 +- .../gui/preferences/GeneralTabView.java | 10 ++++++ .../gui/preferences/NameFormatterTab.fxml | 4 +-- .../gui/preferences/NameFormatterTabView.java | 24 ++++++++++--- .../NameFormatterTabViewModel.java | 5 ++- .../gui/preferences/PreferencesDialog.fxml | 34 +++++++++++++++---- .../gui/preferences/TableColumnsTabView.java | 6 ++-- .../gui/preferences/XmpPrivacyTabView.java | 10 +++++- .../jabref/preferences/JabRefPreferences.java | 13 ++----- .../jabref/preferences/NewLineSeparator.java | 13 ++++--- src/main/resources/l10n/JabRef_en.properties | 9 ++--- 26 files changed, 114 insertions(+), 180 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06ccea5405f..89470a03de6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,15 +15,18 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We improved the arXiv fetcher. Now it should find entries even more reliably and does no longer include the version (e.g `v1`) in the `eprint` field. [forum#1941](https://discourse.jabref.org/t/remove-version-in-arxiv-import/1941) - We moved the group search bar and the button "New group" from bottom to top position to make it more prominent. [#6112](https://github.com/JabRef/jabref/pull/6112) - +- We changed the buttons for import/export/show all/reset of preferences to smaller icon buttons in the preferences dialog. [#6130](https://github.com/JabRef/jabref/pull/6130) ### Fixed - We fixed an issue where opening a library from the recent libraries menu was not possible. [#5939](https://github.com/JabRef/jabref/issues/5939) - We fixed an issue with inconsistent capitalization of file extensions when downloading files [#6115](https://github.com/JabRef/jabref/issues/6115) +- We fixed the display of language and encoding in the preferences dialog. [#6130](https://github.com/JabRef/jabref/pull/6130) ### Removed +- We removed the obsolete `External programs / Open PDF` section in the preferences, as the default application to open PDFs is now set in the `Manage external file types` dialog. [#6130](https://github.com/JabRef/jabref/pull/6130) + ## [5.0] – 2020-03-06 ### Changed diff --git a/src/main/java/org/jabref/gui/desktop/os/DefaultDesktop.java b/src/main/java/org/jabref/gui/desktop/os/DefaultDesktop.java index 4b7d1f66fda..457503ae272 100644 --- a/src/main/java/org/jabref/gui/desktop/os/DefaultDesktop.java +++ b/src/main/java/org/jabref/gui/desktop/os/DefaultDesktop.java @@ -4,7 +4,6 @@ import java.io.File; import java.io.IOException; import java.nio.file.Path; -import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -33,11 +32,6 @@ public void openConsole(String absolutePath) throws IOException { LOGGER.error("This feature is not supported by your Operating System."); } - @Override - public void openPdfWithParameters(String filePath, List parameters) throws IOException { - //TODO imlement default - } - @Override public String detectProgramPath(String programName, String directoryName) { return programName; diff --git a/src/main/java/org/jabref/gui/desktop/os/Linux.java b/src/main/java/org/jabref/gui/desktop/os/Linux.java index 579b4986774..ff48658a5ff 100644 --- a/src/main/java/org/jabref/gui/desktop/os/Linux.java +++ b/src/main/java/org/jabref/gui/desktop/os/Linux.java @@ -6,23 +6,17 @@ import java.io.InputStreamReader; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.List; import java.util.Locale; import java.util.Optional; -import java.util.StringJoiner; import org.jabref.JabRefExecutorService; import org.jabref.gui.externalfiletype.ExternalFileType; import org.jabref.gui.externalfiletype.ExternalFileTypes; import org.jabref.gui.util.StreamGobbler; -import org.jabref.preferences.JabRefPreferences; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static org.jabref.preferences.JabRefPreferences.ADOBE_ACROBAT_COMMAND; -import static org.jabref.preferences.JabRefPreferences.USE_PDF_READER; - public class Linux implements NativeDesktop { private static final Logger LOGGER = LoggerFactory.getLogger(Linux.class); @@ -108,23 +102,6 @@ public void openConsole(String absolutePath) throws IOException { } } - @Override - public void openPdfWithParameters(String filePath, List parameters) throws IOException { - - String application; - if (JabRefPreferences.getInstance().get(USE_PDF_READER).equals(JabRefPreferences.getInstance().get(ADOBE_ACROBAT_COMMAND))) { - application = "acroread"; - - StringJoiner sj = new StringJoiner(" "); - sj.add(application); - parameters.forEach((param) -> sj.add(param)); - - openFileWithApplication(filePath, sj.toString()); - } else { - openFile(filePath, "PDF"); - } - } - @Override public String detectProgramPath(String programName, String directoryName) { return programName; diff --git a/src/main/java/org/jabref/gui/desktop/os/NativeDesktop.java b/src/main/java/org/jabref/gui/desktop/os/NativeDesktop.java index ed54cf78e0e..f4c2014384b 100644 --- a/src/main/java/org/jabref/gui/desktop/os/NativeDesktop.java +++ b/src/main/java/org/jabref/gui/desktop/os/NativeDesktop.java @@ -3,7 +3,6 @@ import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.List; public interface NativeDesktop { void openFile(String filePath, String fileType) throws IOException; @@ -21,14 +20,6 @@ public interface NativeDesktop { void openConsole(String absolutePath) throws IOException; - /** - * This method opens a pdf using the giving the parameters to the executing pdf reader - * @param filePath absolute path to the pdf file to be opened - * @param parameters console parameters depending on the pdf reader - * @throws IOException - */ - void openPdfWithParameters(String filePath, List parameters) throws IOException; - String detectProgramPath(String programName, String directoryName); /** diff --git a/src/main/java/org/jabref/gui/desktop/os/OSX.java b/src/main/java/org/jabref/gui/desktop/os/OSX.java index c4a6c495431..9abd006cdce 100644 --- a/src/main/java/org/jabref/gui/desktop/os/OSX.java +++ b/src/main/java/org/jabref/gui/desktop/os/OSX.java @@ -5,7 +5,6 @@ import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.List; import java.util.Optional; import org.jabref.gui.externalfiletype.ExternalFileType; @@ -42,11 +41,6 @@ public void openConsole(String absolutePath) throws IOException { Runtime.getRuntime().exec("open -a Terminal " + absolutePath, null, new File(absolutePath)); } - @Override - public void openPdfWithParameters(String filePath, List parameters) throws IOException { - //TODO implement - } - @Override public String detectProgramPath(String programName, String directoryName) { return programName; diff --git a/src/main/java/org/jabref/gui/desktop/os/Windows.java b/src/main/java/org/jabref/gui/desktop/os/Windows.java index 5de0f056f65..00367d1b2c9 100644 --- a/src/main/java/org/jabref/gui/desktop/os/Windows.java +++ b/src/main/java/org/jabref/gui/desktop/os/Windows.java @@ -4,16 +4,10 @@ import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.List; import java.util.Optional; import org.jabref.gui.externalfiletype.ExternalFileType; import org.jabref.gui.externalfiletype.ExternalFileTypes; -import org.jabref.preferences.JabRefPreferences; - -import static org.jabref.preferences.JabRefPreferences.ADOBE_ACROBAT_COMMAND; -import static org.jabref.preferences.JabRefPreferences.SUMATRA_PDF_COMMAND; -import static org.jabref.preferences.JabRefPreferences.USE_PDF_READER; public class Windows implements NativeDesktop { private static String DEFAULT_EXECUTABLE_EXTENSION = ".exe"; @@ -69,20 +63,4 @@ public void openConsole(String absolutePath) throws IOException { process.directory(new File(absolutePath)); process.start(); } - - @Override - public void openPdfWithParameters(String filePath, List parameters) throws IOException { - String pdfReaderPath = JabRefPreferences.getInstance().get(USE_PDF_READER); - if (pdfReaderPath.equals(SUMATRA_PDF_COMMAND) || pdfReaderPath.equals(ADOBE_ACROBAT_COMMAND)) { - String[] command = new String[parameters.size() + 2]; - command[0] = "\"" + Paths.get(pdfReaderPath).toString() + "\""; - for (int i = 1; i < command.length - 1; i++) { - command[i] = "\"" + parameters.get(i - 1) + "\""; - } - command[command.length - 1] = "\"" + filePath + "\""; - new ProcessBuilder(command).start(); - } else { - openFile(filePath, "PDF"); - } - } } diff --git a/src/main/java/org/jabref/gui/exporter/SaveAction.java b/src/main/java/org/jabref/gui/exporter/SaveAction.java index 3c2a4f4b824..eadd350770a 100644 --- a/src/main/java/org/jabref/gui/exporter/SaveAction.java +++ b/src/main/java/org/jabref/gui/exporter/SaveAction.java @@ -11,7 +11,7 @@ */ public class SaveAction extends SimpleCommand { - public enum SaveMethod {SAVE, SAVE_AS, SAVE_SELECTED} + public enum SaveMethod { SAVE, SAVE_AS, SAVE_SELECTED } private final SaveMethod saveMethod; private final JabRefFrame frame; diff --git a/src/main/java/org/jabref/gui/icon/IconTheme.java b/src/main/java/org/jabref/gui/icon/IconTheme.java index 76d9684c13f..3e7efb6cd8a 100644 --- a/src/main/java/org/jabref/gui/icon/IconTheme.java +++ b/src/main/java/org/jabref/gui/icon/IconTheme.java @@ -228,6 +228,7 @@ public enum JabRefIcons implements JabRefIcon { GITHUB(MaterialDesignIcon.GITHUB_CIRCLE), /*css: github-circle*/ TOGGLE_ENTRY_PREVIEW(MaterialDesignIcon.LIBRARY_BOOKS), /*css: library-books */ TOGGLE_GROUPS(MaterialDesignIcon.VIEW_LIST), /*css: view-list */ + SHOW_PREFERENCES_LIST(MaterialDesignIcon.VIEW_LIST), /*css: view-list */ WRITE_XMP(MaterialDesignIcon.IMPORT), /* css: import */ FILE_WORD(MaterialDesignIcon.FILE_WORD), /*css: file-word */ FILE_EXCEL(MaterialDesignIcon.FILE_EXCEL), /*css: file-excel */ diff --git a/src/main/java/org/jabref/gui/preferences/AppearanceTab.fxml b/src/main/java/org/jabref/gui/preferences/AppearanceTab.fxml index ed2f9605c5e..e7e95fc0e5a 100644 --- a/src/main/java/org/jabref/gui/preferences/AppearanceTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/AppearanceTab.fxml @@ -7,8 +7,8 @@ - + @@ -18,9 +18,9 @@