diff --git a/CHANGELOG.md b/CHANGELOG.md index 762f841e60d5..5253e87bd2c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,10 +51,12 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed the display of icon both in the main table and linked file editor. [#6169](https://github.com/JabRef/jabref/issues/6169) - We fixed the paste entry command in the menu and toolbar, that did not do anything. [#6293](https://github.com/JabRef/jabref/issues/6293) - We fixed an issue where the windows installer did not create an entry in the start menu [bug report in the forum](https://discourse.jabref.org/t/error-while-fetching-from-doi/2018/3) +- We fixed an issue where only the field `abstract` and `comment` were declared as multiline fields. Other fields can now be configured in the preferences using "Do not wrap the following fields when saving" [4373](https://github.com/JabRef/jabref/issues/4373) - We fixed an issue where JabRef switched to discrete graphics under macOS [#5935](https://github.com/JabRef/jabref/issues/5935) - We fixed an issue where the Preferences entry preview will be unexpected modified leads to Value too long exception [#6198](https://github.com/JabRef/jabref/issues/6198) - We fixed an issue where custom jstyles for Open/LibreOffice would only be valid if a layout line for the entry type `default` was at the end of the layout section [#6303](https://github.com/JabRef/jabref/issues/6303) + ### Removed - We removed the option of the "enforce legal key". [#6295](https://github.com/JabRef/jabref/issues/6295) diff --git a/snap/local/JabRef-launcher b/snap/local/JabRef-launcher new file mode 100755 index 000000000000..c65a6120820c --- /dev/null +++ b/snap/local/JabRef-launcher @@ -0,0 +1,3 @@ +#! /bin/sh +DIR="$SNAP/lib/runtime/bin" +"$DIR/java" -p "$DIR/../app" -m org.jabref/org.jabref.JabRefLauncher "$@" \ No newline at end of file diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 928fd3ca9be0..60ac1a3d4456 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -57,3 +57,12 @@ parts: snapcraftctl build snapcraftctl set-version "$(cat $SNAPCRAFT_PART_INSTALL/lib/app/JabRef.cfg | grep "app.version=" | cut -d'=' -f2)" sed -i 's|/opt/jabref/lib/jabrefHost.py|/snap/bin/jabref.browser-proxy|g' $SNAPCRAFT_PART_INSTALL/lib/native-messaging-host/*/org.jabref.jabref.json + rm $SNAPCRAFT_PART_INSTALL/bin/JabRef + jabref-launcher: + after: + - jabref + source: snap/local + source-type: local + plugin: dump + organize: + JabRef-launcher: bin/JabRef diff --git a/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java b/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java index aedef2b25342..8abfc0dfc186 100644 --- a/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java +++ b/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java @@ -236,7 +236,7 @@ private boolean saveDatabase(Path file, boolean selectedOnly, Charset encoding, } catch (UnsupportedCharsetException ex) { throw new SaveException(Localization.lang("Character encoding '%0' is not supported.", encoding.displayName()), ex); } catch (IOException ex) { - throw new SaveException("Problems saving:", ex); + throw new SaveException("Problems saving: " + ex, ex); } return true; diff --git a/src/main/java/org/jabref/gui/fieldeditors/FieldEditors.java b/src/main/java/org/jabref/gui/fieldeditors/FieldEditors.java index f72c747d9ca9..88359abcd280 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/FieldEditors.java +++ b/src/main/java/org/jabref/gui/fieldeditors/FieldEditors.java @@ -6,7 +6,6 @@ import javax.swing.undo.UndoManager; -import org.jabref.Globals; import org.jabref.gui.DialogService; import org.jabref.gui.autocompleter.ContentSelectorSuggestionProvider; import org.jabref.gui.autocompleter.SuggestionProvider; @@ -51,10 +50,10 @@ public static FieldEditorFX getForField(final Field field, journalAbbreviationRepository, preferences.getBoolean(JabRefPreferences.ALLOW_INTEGER_EDITION_BIBTEX)); - final boolean isSingleLine = FieldFactory.isSingleLineField(field); + boolean isMultiLine = FieldFactory.isMultiLineField(field, preferences.getFieldContentParserPreferences().getNonWrappableFields()); if (preferences.getTimestampPreferences().getTimestampField().equals(field)) { - return new DateEditor(field, DateTimeFormatter.ofPattern(Globals.prefs.getTimestampPreferences().getTimestampFormat()), suggestionProvider, fieldCheckers); + return new DateEditor(field, DateTimeFormatter.ofPattern(preferences.getTimestampPreferences().getTimestampFormat()), suggestionProvider, fieldCheckers); } else if (fieldProperties.contains(FieldProperty.DATE)) { return new DateEditor(field, DateTimeFormatter.ofPattern("[uuuu][-MM][-dd]"), suggestionProvider, fieldCheckers); } else if (fieldProperties.contains(FieldProperty.EXTERNAL)) { @@ -88,14 +87,14 @@ public static FieldEditorFX getForField(final Field field, } else if (fieldProperties.contains(FieldProperty.MULTIPLE_ENTRY_LINK)) { return new LinkedEntriesEditor(field, databaseContext, suggestionProvider, fieldCheckers); } else if (fieldProperties.contains(FieldProperty.PERSON_NAMES)) { - return new PersonsEditor(field, suggestionProvider, preferences, fieldCheckers, isSingleLine); + return new PersonsEditor(field, suggestionProvider, preferences, fieldCheckers, isMultiLine); } else if (StandardField.KEYWORDS.equals(field)) { return new KeywordsEditor(field, suggestionProvider, fieldCheckers, preferences); } else if (field == InternalField.KEY_FIELD) { return new BibtexKeyEditor(field, preferences, suggestionProvider, fieldCheckers, databaseContext, undoManager, dialogService); } else { // default - return new SimpleEditor(field, suggestionProvider, fieldCheckers, preferences, isSingleLine); + return new SimpleEditor(field, suggestionProvider, fieldCheckers, preferences, isMultiLine); } } diff --git a/src/main/java/org/jabref/gui/fieldeditors/PersonsEditor.java b/src/main/java/org/jabref/gui/fieldeditors/PersonsEditor.java index 6b3b9dc16801..893ca161493b 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/PersonsEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/PersonsEditor.java @@ -23,12 +23,10 @@ public PersonsEditor(final Field field, final SuggestionProvider suggestionProvider, final JabRefPreferences preferences, final FieldCheckers fieldCheckers, - final boolean isSingleLine) { + final boolean isMultiLine) { this.viewModel = new PersonsEditorViewModel(field, suggestionProvider, preferences.getAutoCompletePreferences(), fieldCheckers); - textInput = isSingleLine - ? new EditorTextField() - : new EditorTextArea(); + textInput = isMultiLine ? new EditorTextArea() : new EditorTextField(); decoratedStringProperty = new UiThreadStringProperty(viewModel.textProperty()); textInput.textProperty().bindBidirectional(decoratedStringProperty); diff --git a/src/main/java/org/jabref/gui/fieldeditors/SimpleEditor.java b/src/main/java/org/jabref/gui/fieldeditors/SimpleEditor.java index 10a0882a91e6..f27fd7690210 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/SimpleEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/SimpleEditor.java @@ -23,12 +23,10 @@ public SimpleEditor(final Field field, final SuggestionProvider suggestionProvider, final FieldCheckers fieldCheckers, final JabRefPreferences preferences, - final boolean isSingleLine) { + final boolean isMultiLine) { this.viewModel = new SimpleEditorViewModel(field, suggestionProvider, fieldCheckers); - textInput = isSingleLine - ? new EditorTextField() - : new EditorTextArea(); + textInput = isMultiLine ? new EditorTextArea() : new EditorTextField(); HBox.setHgrow(textInput, Priority.ALWAYS); textInput.textProperty().bindBidirectional(viewModel.textProperty()); diff --git a/src/main/java/org/jabref/model/entry/field/FieldFactory.java b/src/main/java/org/jabref/model/entry/field/FieldFactory.java index 8c99795ed37c..98f7603a9ac7 100644 --- a/src/main/java/org/jabref/model/entry/field/FieldFactory.java +++ b/src/main/java/org/jabref/model/entry/field/FieldFactory.java @@ -139,13 +139,9 @@ public static List getDefaultGeneralFields() { return defaultGeneralFields; } - // TODO: Move somewhere more appropriate and make user-configurable - public static boolean isSingleLineField(final Field field) { - if (field.equals(StandardField.ABSTRACT) || field.equals(StandardField.COMMENT)) { - return false; - } - + // TODO: This should ideally be user configurable! Move somewhere more appropriate in the future + public static boolean isMultiLineField(final Field field, List nonWrappableFields) { // Treat unknown fields as multi-line fields - return !(field instanceof UnknownField); + return (field instanceof UnknownField) || nonWrappableFields.contains(field) || field.equals(StandardField.ABSTRACT) || field.equals(StandardField.COMMENT) || field.equals(StandardField.REVIEW); } } diff --git a/src/main/java/org/jabref/preferences/JabRefPreferences.java b/src/main/java/org/jabref/preferences/JabRefPreferences.java index ce34d9090047..1167cd503b85 100644 --- a/src/main/java/org/jabref/preferences/JabRefPreferences.java +++ b/src/main/java/org/jabref/preferences/JabRefPreferences.java @@ -1469,12 +1469,14 @@ public JournalAbbreviationPreferences getJournalAbbreviationPreferences() { return new JournalAbbreviationPreferences(getStringList(EXTERNAL_JOURNAL_LISTS), getDefaultEncoding()); } + @Override public CleanupPreferences getCleanupPreferences(JournalAbbreviationRepository abbreviationRepository) { return new CleanupPreferences( getLayoutFormatterPreferences(abbreviationRepository), getFilePreferences()); } + @Override public CleanupPreset getCleanupPreset() { Set activeJobs = EnumSet.noneOf(CleanupPreset.CleanupStep.class); @@ -1489,6 +1491,7 @@ public CleanupPreset getCleanupPreset() { return new CleanupPreset(activeJobs, formatterCleanups); } + @Override public void setCleanupPreset(CleanupPreset cleanupPreset) { for (CleanupPreset.CleanupStep action : EnumSet.allOf(CleanupPreset.CleanupStep.class)) { putBoolean(JabRefPreferences.CLEANUP + action.name(), cleanupPreset.isActive(action));