Use some modern APIs and fix warnings on the latest macOS SDK

This commit is contained in:
Damiano Galassi committed 2026-09-22 16:10:37 +02:00
1 parent beb7774761
commit 17c7d67b96
14 files changed
+254 -156

No files matched your search

+8 -1
View File
@@ -7,6 +7,7 @@
import Cocoa
import MP42Foundation
import UniformTypeIdentifiers
final class DocumentWindowController: NSWindowController, TracksViewControllerDelegate, MetadataSearchViewControllerDelegate, FileImportControllerDelegate, ProgressViewControllerDelegate, NSDraggingDestination, NSUserInterfaceValidations {
@@ -464,7 +465,13 @@ final class DocumentWindowController: NSWindowController, TracksViewControllerDe
panel.allowsMultipleSelection = false
panel.canChooseFiles = true
panel.canChooseDirectories = false
panel.allowedFileTypes = ["mp4", "m4v", "m4a", "xml", "nfo"]
if #available(macOS 12, *) {
panel.allowedContentTypes = [.mpeg4Movie, .mpeg4Audio,
.appleProtectedMPEG4Video,
.xml, UTType(filenameExtension: "nfo")!]
} else {
panel.allowedFileTypes = ["mp4", "m4v", "m4a", "xml", "nfo"]
}
panel.beginSheetModal(for: windowForSheet) { (response) in
if response == NSApplication.ModalResponse.OK, let url = panel.url {