diff --git a/CHANGELOG.md b/CHANGELOG.md index 51879c2a3b8..b60dc4ae172 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,7 +68,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We removed some obsolete notifications. [#5555](https://github.com/JabRef/jabref/issues/5555) - We removed an internal step in the [ISBN-to-BibTeX fetcher](https://docs.jabref.org/import-using-publication-identifiers/isbntobibtex): The [ISBN to BibTeX Converter](https://manas.tungare.name/software/isbn-to-bibtex) by [@manastungare](https://github.com/manastungare) is not used anymore, because it is offline: "people using this tool have not been generating enough sales for Amazon." - +- We removed the option to control the default drag and drop behaviour. You can use the modifier keys (like CtrL or Alt) instead. diff --git a/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java b/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java index 0016b222116..f6931e08f8d 100644 --- a/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java +++ b/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java @@ -134,25 +134,21 @@ public EntryEditor(BasePanel panel, ExternalFileTypes externalFileTypes) { if (event.getDragboard().hasContent(DataFormat.FILES)) { List files = event.getDragboard().getFiles().stream().map(File::toPath).collect(Collectors.toList()); - FileDragDropPreferenceType dragDropPreferencesType = preferencesService.getEntryEditorFileLinkPreference(); - - if (dragDropPreferencesType == FileDragDropPreferenceType.MOVE) { - LOGGER.debug("Mode MOVE"); - fileLinker.moveFilesToFileDirAndAddToEntry(entry, files); - success = true; - } - - if (dragDropPreferencesType == FileDragDropPreferenceType.COPY) { - LOGGER.debug("Mode COPY"); - fileLinker.copyFilesToFileDirAndAddToEntry(entry, files); - success = true; - } - - if (dragDropPreferencesType == FileDragDropPreferenceType.LINK) { - LOGGER.debug("Mode LINK"); - fileLinker.addFilesToEntry(entry, files); - success = true; + switch (event.getTransferMode()) { + case COPY: + LOGGER.debug("Mode COPY"); + fileLinker.copyFilesToFileDirAndAddToEntry(entry, files); + break; + case MOVE: + LOGGER.debug("Mode MOVE"); + fileLinker.moveFilesToFileDirAndAddToEntry(entry, files); + break; + case LINK: + LOGGER.debug("Mode LINK"); + fileLinker.addFilesToEntry(entry, files); + break; } + success = true; } event.setDropCompleted(success); diff --git a/src/main/java/org/jabref/gui/entryeditor/FileDragDropPreferenceType.java b/src/main/java/org/jabref/gui/entryeditor/FileDragDropPreferenceType.java deleted file mode 100644 index c4593487e39..00000000000 --- a/src/main/java/org/jabref/gui/entryeditor/FileDragDropPreferenceType.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.jabref.gui.entryeditor; - -public enum FileDragDropPreferenceType { - /** - * Copy file to default file folder - */ - COPY, - /** - * Link file (without copying) - */ - LINK, - /** - * Copy, rename and link file - */ - MOVE; -} diff --git a/src/main/java/org/jabref/gui/preferences/EntryEditorTab.fxml b/src/main/java/org/jabref/gui/preferences/EntryEditorTab.fxml index 0d62000f0d2..4458fb6ee94 100644 --- a/src/main/java/org/jabref/gui/preferences/EntryEditorTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/EntryEditorTab.fxml @@ -8,14 +8,12 @@ - diff --git a/src/main/java/org/jabref/gui/preferences/EntryEditorTabView.java b/src/main/java/org/jabref/gui/preferences/EntryEditorTabView.java index ea84c509b67..78b30681fcc 100644 --- a/src/main/java/org/jabref/gui/preferences/EntryEditorTabView.java +++ b/src/main/java/org/jabref/gui/preferences/EntryEditorTabView.java @@ -26,9 +26,6 @@ public class EntryEditorTabView extends AbstractPreferenceTabView getRestartWarnings() { public BooleanProperty firstNameModeFullProperty() { return firstNameModeFullProperty; } public BooleanProperty firstNameModeBothProperty() { return firstNameModeBothProperty; } - - public BooleanProperty dndCopyFileProperty() { return dndCopyFileProperty; } - - public BooleanProperty dndLinkFileProperty() { return dndLinkFileProperty; } - - public BooleanProperty dndCopyRenameLinkFileProperty() { return dndCopyRenameLinkFileProperty; } } diff --git a/src/main/java/org/jabref/preferences/JabRefPreferences.java b/src/main/java/org/jabref/preferences/JabRefPreferences.java index 76e0c962e8b..72f924c64c7 100644 --- a/src/main/java/org/jabref/preferences/JabRefPreferences.java +++ b/src/main/java/org/jabref/preferences/JabRefPreferences.java @@ -44,7 +44,6 @@ import org.jabref.gui.desktop.JabRefDesktop; import org.jabref.gui.entryeditor.EntryEditorPreferences; import org.jabref.gui.entryeditor.EntryEditorTabList; -import org.jabref.gui.entryeditor.FileDragDropPreferenceType; import org.jabref.gui.groups.GroupViewMode; import org.jabref.gui.keyboard.KeyBindingRepository; import org.jabref.gui.maintable.ColumnPreferences; @@ -354,9 +353,6 @@ public class JabRefPreferences implements PreferencesService { // Id Entry Generator Preferences public static final String ID_ENTRY_GENERATOR = "idEntryGenerator"; - // File linking Options for entry editor - public static final String ENTRY_EDITOR_DRAG_DROP_PREFERENCE_TYPE = "DragDropPreferenceType"; - // String delimiter public static final Character STRINGLIST_DELIMITER = ';'; @@ -765,7 +761,6 @@ private JabRefPreferences() { // set default theme defaults.put(JabRefPreferences.FX_THEME, ThemeLoader.MAIN_CSS); - defaults.put(ENTRY_EDITOR_DRAG_DROP_PREFERENCE_TYPE, FileDragDropPreferenceType.MOVE.name()); setLanguageDependentDefaultValues(); } @@ -2004,15 +1999,6 @@ public Map getMainTableColumnSortTypes() { return map; } - @Override - public FileDragDropPreferenceType getEntryEditorFileLinkPreference() { - return FileDragDropPreferenceType.valueOf(get(ENTRY_EDITOR_DRAG_DROP_PREFERENCE_TYPE)); - } - - public void storeEntryEditorFileLinkPreference(FileDragDropPreferenceType type) { - put(ENTRY_EDITOR_DRAG_DROP_PREFERENCE_TYPE, type.name()); - } - @Override public List getCustomExportFormats(JournalAbbreviationLoader loader) { int i = 0; diff --git a/src/main/java/org/jabref/preferences/PreferencesService.java b/src/main/java/org/jabref/preferences/PreferencesService.java index c9c79cd8b68..723aa1f5a19 100644 --- a/src/main/java/org/jabref/preferences/PreferencesService.java +++ b/src/main/java/org/jabref/preferences/PreferencesService.java @@ -7,7 +7,6 @@ import java.util.Set; import org.jabref.gui.entryeditor.EntryEditorPreferences; -import org.jabref.gui.entryeditor.FileDragDropPreferenceType; import org.jabref.gui.keyboard.KeyBindingRepository; import org.jabref.logic.exporter.SavePreferences; import org.jabref.logic.exporter.TemplateExporter; @@ -102,7 +101,5 @@ public interface PreferencesService { boolean getAllowIntegerEdition(); - FileDragDropPreferenceType getEntryEditorFileLinkPreference(); - EntryEditorPreferences getEntryEditorPreferences(); } diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 36a9c345cb4..c1eafb2c00d 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -1944,10 +1944,6 @@ Server\ Timezone\:=Server Timezone\: Remember\ Password=Remember Password Use\ SSL=Use SSL Move\ preprint\ information\ from\ 'URL'\ and\ 'journal'\ field\ to\ the\ 'eprint'\ field=Move preprint information from 'URL' and 'journal' field to the 'eprint' field -Default\ drag\ &\ drop\ action=Default drag & drop action -Copy\ file\ to\ default\ file\ folder=Copy file to default file folder -Link\ file\ (without\ copying)=Link file (without copying) -Copy,\ rename\ and\ link\ file=Copy, rename and link file Type=Type Customize\ Export\ Formats=Customize Export Formats Export\ name=Export name