Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dnd option #5668

Merged
merged 2 commits into from
Nov 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.



Expand Down
32 changes: 14 additions & 18 deletions src/main/java/org/jabref/gui/entryeditor/EntryEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,25 +134,21 @@ public EntryEditor(BasePanel panel, ExternalFileTypes externalFileTypes) {

if (event.getDragboard().hasContent(DataFormat.FILES)) {
List<Path> 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);
Expand Down

This file was deleted.

6 changes: 0 additions & 6 deletions src/main/java/org/jabref/gui/preferences/EntryEditorTab.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
<?import javafx.scene.control.ToggleGroup?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>

<fx:root prefWidth="650.0" spacing="10.0" type="VBox" xmlns="https://javafx.com/javafx/11.0.1"
xmlns:fx="https://javafx.com/fxml/1" fx:controller="org.jabref.gui.preferences.EntryEditorTabView">
<Label styleClass="titleHeader" text="%Entry editor"/>
<fx:define>
<ToggleGroup fx:id="nameFormat"/>
<ToggleGroup fx:id="firstNames"/>
<ToggleGroup fx:id="dnd"/>
</fx:define>

<CheckBox fx:id="openOnNewEntry" text="%Open editor when a new entry is created"/>
Expand Down Expand Up @@ -60,8 +58,4 @@
<Insets left="20.0"/>
</padding>
</VBox>
<Label styleClass="sectionHeader" text="%Default drag &amp; drop action"/>
<RadioButton fx:id="dndCopyFile" text="%Copy file to default file folder" toggleGroup="$dnd"/>
<RadioButton fx:id="dndLinkFile" text="%Link file (without copying)" toggleGroup="$dnd"/>
<RadioButton fx:id="dndCopyRenameLinkFile" text="%Copy, rename and link file" toggleGroup="$dnd"/>
tobiasdiez marked this conversation as resolved.
Show resolved Hide resolved
</fx:root>
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ public class EntryEditorTabView extends AbstractPreferenceTabView<EntryEditorTab
@FXML private RadioButton firstNameModeAbbreviated;
@FXML private RadioButton firstNameModeFull;
@FXML private RadioButton firstNameModeBoth;
@FXML private RadioButton dndCopyFile;
@FXML private RadioButton dndLinkFile;
@FXML private RadioButton dndCopyRenameLinkFile;

public EntryEditorTabView(JabRefPreferences preferences) {
this.preferences = preferences;
Expand Down Expand Up @@ -58,8 +55,5 @@ public void initialize () {
firstNameModeAbbreviated.selectedProperty().bindBidirectional(viewModel.firstNameModeAbbreviatedProperty());
firstNameModeFull.selectedProperty().bindBidirectional(viewModel.firstNameModeFullProperty());
firstNameModeBoth.selectedProperty().bindBidirectional(viewModel.firstNameModeBothProperty());
dndCopyFile.selectedProperty().bindBidirectional(viewModel.dndCopyFileProperty());
dndLinkFile.selectedProperty().bindBidirectional(viewModel.dndLinkFileProperty());
dndCopyRenameLinkFile.selectedProperty().bindBidirectional(viewModel.dndCopyRenameLinkFileProperty());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import org.jabref.gui.DialogService;
import org.jabref.gui.autocompleter.AutoCompleteFirstNameMode;
import org.jabref.gui.autocompleter.AutoCompletePreferences;
import org.jabref.gui.entryeditor.FileDragDropPreferenceType;
import org.jabref.preferences.JabRefPreferences;

import static org.jabref.gui.autocompleter.AutoCompleteFirstNameMode.ONLY_ABBREVIATED;
Expand All @@ -33,9 +32,6 @@ public class EntryEditorTabViewModel implements PreferenceTabViewModel {
private final BooleanProperty firstNameModeAbbreviatedProperty = new SimpleBooleanProperty();
private final BooleanProperty firstNameModeFullProperty = new SimpleBooleanProperty();
private final BooleanProperty firstNameModeBothProperty = new SimpleBooleanProperty();
private final BooleanProperty dndCopyFileProperty = new SimpleBooleanProperty();
private final BooleanProperty dndLinkFileProperty = new SimpleBooleanProperty();
private final BooleanProperty dndCopyRenameLinkFileProperty = new SimpleBooleanProperty();

private AutoCompletePreferences autoCompletePreferences;

Expand Down Expand Up @@ -78,15 +74,6 @@ public void setValues() {
firstNameModeBothProperty.setValue(true);
break;
}

FileDragDropPreferenceType dragDropPreferenceType = preferences.getEntryEditorFileLinkPreference();
if (dragDropPreferenceType == FileDragDropPreferenceType.COPY) {
dndCopyFileProperty.setValue(true);
} else if (dragDropPreferenceType == FileDragDropPreferenceType.LINK) {
dndLinkFileProperty.setValue(true);
} else {
dndCopyRenameLinkFileProperty.setValue(true);
}
}

@Override
Expand Down Expand Up @@ -121,14 +108,6 @@ else if (autoCompleteFirstLastProperty.getValue()) {
autoCompletePreferences.setFirstNameMode(AutoCompleteFirstNameMode.BOTH);
}

if (dndCopyFileProperty.getValue()) {
preferences.storeEntryEditorFileLinkPreference(FileDragDropPreferenceType.COPY);
} else if (dndLinkFileProperty.getValue()) {
preferences.storeEntryEditorFileLinkPreference(FileDragDropPreferenceType.LINK);
} else {
preferences.storeEntryEditorFileLinkPreference(FileDragDropPreferenceType.MOVE);
}

preferences.storeAutoCompletePreferences(autoCompletePreferences);
}

Expand Down Expand Up @@ -169,10 +148,4 @@ public List<String> 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; }
}
14 changes: 0 additions & 14 deletions src/main/java/org/jabref/preferences/JabRefPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 = ';';

Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -2004,15 +1999,6 @@ public Map<String, SortType> 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<TemplateExporter> getCustomExportFormats(JournalAbbreviationLoader loader) {
int i = 0;
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/org/jabref/preferences/PreferencesService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -102,7 +101,5 @@ public interface PreferencesService {

boolean getAllowIntegerEdition();

FileDragDropPreferenceType getEntryEditorFileLinkPreference();

EntryEditorPreferences getEntryEditorPreferences();
}
4 changes: 0 additions & 4 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down