mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-24 08:48:51 -05:00
* fix subtitle drop target on Mac (didn't accept drops before)
This commit is contained in:
parent
051c34c98d
commit
3974551821
@ -184,12 +184,14 @@ abstract class SubtitleDropTarget extends JButton {
|
||||
|
||||
@Override
|
||||
public void dragEnter(DropTargetDragEvent dtde) {
|
||||
DropAction dropAction = DropAction.Cancel;
|
||||
DropAction dropAction = DropAction.Download;
|
||||
|
||||
try {
|
||||
dropAction = getDropAction(getFilesFromTransferable(dtde.getTransferable()));
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
// just accept the drag if we can't access the transferable,
|
||||
// because on some implementations we can't access transferable data before we accept the drag,
|
||||
// but accepting or rejecting the drag depends on the files dragged
|
||||
}
|
||||
|
||||
// update visual representation
|
||||
@ -197,7 +199,7 @@ abstract class SubtitleDropTarget extends JButton {
|
||||
|
||||
// accept or reject
|
||||
if (dropAction != DropAction.Cancel) {
|
||||
dtde.acceptDrag(DnDConstants.ACTION_COPY);
|
||||
dtde.acceptDrag(DnDConstants.ACTION_REFERENCE);
|
||||
} else {
|
||||
dtde.rejectDrag();
|
||||
}
|
||||
|
@ -134,6 +134,6 @@ public class FileTransferable implements Transferable {
|
||||
}
|
||||
|
||||
// cannot get files from transferable
|
||||
throw new UnsupportedFlavorException(DataFlavor.javaFileListFlavor);
|
||||
throw new UnsupportedFlavorException(null);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user