Add a "Send to iTunes" queue action, rewrite queue preferences in Swift.

This commit is contained in:
Damiano Galassi committed 2018-03-29 11:46:44 +02:00
1 parent ad1539b764
commit 420701d2a1
10 files changed
+360 -342

No files matched your search

+22
View File
@@ -533,3 +533,25 @@ extension Array where Element == Artwork {
required init?(coder aDecoder: NSCoder) {}
static var supportsSecureCoding: Bool { return true }
}
@objc(SBQueueSendToiTunesAction) class QueueSendToiTunesAction: NSObject, SBQueueActionProtocol {
var type: SBQueueActionType { return .post }
var localizedDescription: String { return NSLocalizedString("Sending to iTunes", comment: "Action localized description.") }
override var description: String { return NSLocalizedString("Send to iTunes", comment: "Action description.") }
@objc override init() {}
func runAction(_ item: SBQueueItem) -> Bool {
let workspace = NSWorkspace.shared
if let appPath = workspace.fullPath(forApplication: "iTunes") {
return workspace.openFile(item.destURL.path, withApplication: appPath)
}
return false
}
func encode(with aCoder: NSCoder) {}
required init?(coder aDecoder: NSCoder) {}
static var supportsSecureCoding: Bool { return true }
}