* avoid potential sandbox permission issues
This commit is contained in:
parent
3ea880be66
commit
e1379dabb3
|
@ -301,6 +301,8 @@
|
||||||
|
|
||||||
<argument value="--log-file" />
|
<argument value="--log-file" />
|
||||||
<argument value="filebot.log" />
|
<argument value="filebot.log" />
|
||||||
|
<argument value="--log-lock" />
|
||||||
|
<argument value="no" />
|
||||||
</bundleapp>
|
</bundleapp>
|
||||||
|
|
||||||
<!-- uses depricated Quicktime API -->
|
<!-- uses depricated Quicktime API -->
|
||||||
|
|
|
@ -106,7 +106,7 @@ public class DropToUnlock extends JList<File> {
|
||||||
}).filter(f -> f != null && isLockedFolder(f)).sorted().distinct().collect(Collectors.toList());
|
}).filter(f -> f != null && isLockedFolder(f)).sorted().distinct().collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean showUnlockDialog(Window owner, Collection<File> files) {
|
public static boolean showUnlockFoldersDialog(Window owner, Collection<File> files) {
|
||||||
final List<File> model = getParentFolders(files);
|
final List<File> model = getParentFolders(files);
|
||||||
|
|
||||||
// immediately return if there is nothing that needs to be unlocked
|
// immediately return if there is nothing that needs to be unlocked
|
||||||
|
|
|
@ -208,7 +208,7 @@ public class FormatDialog extends JDialog {
|
||||||
public void propertyChange(PropertyChangeEvent evt) {
|
public void propertyChange(PropertyChangeEvent evt) {
|
||||||
if (isMacSandbox()) {
|
if (isMacSandbox()) {
|
||||||
if (sample != null && sample.getMediaFile() != null && sample.getMediaFile().exists()) {
|
if (sample != null && sample.getMediaFile() != null && sample.getMediaFile().exists()) {
|
||||||
DropToUnlock.showUnlockDialog(getWindow(evt.getSource()), singleton(sample.getMediaFile()));
|
DropToUnlock.showUnlockFoldersDialog(getWindow(evt.getSource()), singleton(sample.getMediaFile()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
checkFormatInBackground();
|
checkFormatInBackground();
|
||||||
|
|
|
@ -533,7 +533,7 @@ class HistoryDialog extends JDialog {
|
||||||
private void rename(File directory, List<Element> elements) {
|
private void rename(File directory, List<Element> elements) {
|
||||||
Map<File, File> renamePlan = getRenameMap(directory);
|
Map<File, File> renamePlan = getRenameMap(directory);
|
||||||
if (isMacSandbox()) {
|
if (isMacSandbox()) {
|
||||||
if (!DropToUnlock.showUnlockDialog(parent(), Stream.of(renamePlan.keySet(), renamePlan.values()).flatMap(c -> c.stream()).collect(Collectors.toList()))) {
|
if (!DropToUnlock.showUnlockFoldersDialog(parent(), Stream.of(renamePlan.keySet(), renamePlan.values()).flatMap(c -> c.stream()).collect(Collectors.toList()))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ class RenameAction extends AbstractAction {
|
||||||
private Map<File, File> checkRenamePlan(List<Entry<File, File>> renamePlan, Window parent) throws IOException {
|
private Map<File, File> checkRenamePlan(List<Entry<File, File>> renamePlan, Window parent) throws IOException {
|
||||||
// ask for user permissions to output paths
|
// ask for user permissions to output paths
|
||||||
if (isMacSandbox()) {
|
if (isMacSandbox()) {
|
||||||
if (!DropToUnlock.showUnlockDialog(parent, renamePlan.stream().flatMap(e -> Stream.of(e.getValue(), e.getKey())).map(f -> new File(f.getAbsolutePath())).collect(Collectors.toList()))) {
|
if (!DropToUnlock.showUnlockFoldersDialog(parent, renamePlan.stream().flatMap(e -> Stream.of(e.getValue(), e.getKey())).map(f -> new File(f.getAbsolutePath())).collect(Collectors.toList()))) {
|
||||||
return emptyMap();
|
return emptyMap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import static java.awt.event.KeyEvent.*;
|
||||||
import static javax.swing.JOptionPane.*;
|
import static javax.swing.JOptionPane.*;
|
||||||
import static javax.swing.KeyStroke.*;
|
import static javax.swing.KeyStroke.*;
|
||||||
import static javax.swing.SwingUtilities.*;
|
import static javax.swing.SwingUtilities.*;
|
||||||
|
import static net.filebot.Settings.*;
|
||||||
import static net.filebot.ui.NotificationLogging.*;
|
import static net.filebot.ui.NotificationLogging.*;
|
||||||
import static net.filebot.util.ExceptionUtilities.*;
|
import static net.filebot.util.ExceptionUtilities.*;
|
||||||
import static net.filebot.util.ui.LoadingOverlayPane.*;
|
import static net.filebot.util.ui.LoadingOverlayPane.*;
|
||||||
|
@ -54,6 +55,7 @@ import net.filebot.StandardRenameAction;
|
||||||
import net.filebot.UserFiles;
|
import net.filebot.UserFiles;
|
||||||
import net.filebot.WebServices;
|
import net.filebot.WebServices;
|
||||||
import net.filebot.format.MediaBindingBean;
|
import net.filebot.format.MediaBindingBean;
|
||||||
|
import net.filebot.mac.DropToUnlock;
|
||||||
import net.filebot.media.MediaDetection;
|
import net.filebot.media.MediaDetection;
|
||||||
import net.filebot.similarity.Match;
|
import net.filebot.similarity.Match;
|
||||||
import net.filebot.ui.rename.FormatDialog.Mode;
|
import net.filebot.ui.rename.FormatDialog.Mode;
|
||||||
|
@ -628,12 +630,18 @@ public class RenamePanel extends JComponent {
|
||||||
// clear names list
|
// clear names list
|
||||||
renameModel.values().clear();
|
renameModel.values().clear();
|
||||||
|
|
||||||
SwingWorker<List<Match<File, ?>>, Void> worker = new SwingWorker<List<Match<File, ?>>, Void>() {
|
final List<File> remainingFiles = new LinkedList<File>(renameModel.files());
|
||||||
|
final SortOrder order = SortOrder.forName(persistentPreferredEpisodeOrder.getValue());
|
||||||
|
final Locale locale = new Locale(persistentPreferredLanguage.getValue());
|
||||||
|
final boolean autodetection = !isShiftOrAltDown(evt); // skip name auto-detection if SHIFT is pressed
|
||||||
|
|
||||||
private final List<File> remainingFiles = new LinkedList<File>(renameModel.files());
|
if (isMacSandbox()) {
|
||||||
private final SortOrder order = SortOrder.forName(persistentPreferredEpisodeOrder.getValue());
|
if (!DropToUnlock.showUnlockFoldersDialog(getWindow(RenamePanel.this), remainingFiles)) {
|
||||||
private final Locale locale = new Locale(persistentPreferredLanguage.getValue());
|
return;
|
||||||
private final boolean autodetection = !isShiftOrAltDown(evt); // skip name auto-detection if SHIFT is pressed
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SwingWorker<List<Match<File, ?>>, Void> worker = new SwingWorker<List<Match<File, ?>>, Void>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<Match<File, ?>> doInBackground() throws Exception {
|
protected List<Match<File, ?>> doInBackground() throws Exception {
|
||||||
|
|
Loading…
Reference in New Issue