Fix build on Xcode 10 b6.
This commit is contained in:
10 files changed
+16
-16
No files matched your search
@@ -226,7 +226,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|||||||
|
|
||||||
extension AppDelegate {
|
extension AppDelegate {
|
||||||
|
|
||||||
override func application(_ sender: NSApplication, delegateHandlesKey key: String) -> Bool {
|
func application(_ sender: NSApplication, delegateHandlesKey key: String) -> Bool {
|
||||||
if key == "items" {
|
if key == "items" {
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ class ChapterSearchController: NSWindowController, NSTableViewDataSource, NSTabl
|
|||||||
searchButton.isEnabled = searchTitle.stringValue.isEmpty ? false : true
|
searchButton.isEnabled = searchTitle.stringValue.isEmpty ? false : true
|
||||||
}
|
}
|
||||||
|
|
||||||
override func controlTextDidChange(_ obj: Notification) {
|
func controlTextDidChange(_ obj: Notification) {
|
||||||
updateSearchButtonVisibility()
|
updateSearchButtonVisibility()
|
||||||
searchButton.keyEquivalent = "\r"
|
searchButton.keyEquivalent = "\r"
|
||||||
addButton.keyEquivalent = ""
|
addButton.keyEquivalent = ""
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ private extension NSPasteboard.PasteboardType {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class DocumentWindowController: NSWindowController, TracksViewControllerDelegate, ChapterSearchControllerDelegate, MetadataSearchControllerDelegate, FileImportControllerDelegate, ProgressViewControllerDelegate, NSDraggingDestination {
|
class DocumentWindowController: NSWindowController, TracksViewControllerDelegate, ChapterSearchControllerDelegate, MetadataSearchControllerDelegate, FileImportControllerDelegate, ProgressViewControllerDelegate, NSDraggingDestination, NSMenuItemValidation, NSToolbarItemValidation {
|
||||||
|
|
||||||
private var doc: Document {
|
private var doc: Document {
|
||||||
return document as! Document
|
return document as! Document
|
||||||
@@ -191,7 +191,7 @@ class DocumentWindowController: NSWindowController, TracksViewControllerDelegate
|
|||||||
@IBOutlet var searchChapters: NSToolbarItem!
|
@IBOutlet var searchChapters: NSToolbarItem!
|
||||||
@IBOutlet var sendToQueue: NSToolbarItem!
|
@IBOutlet var sendToQueue: NSToolbarItem!
|
||||||
|
|
||||||
override func validateToolbarItem(_ item: NSToolbarItem) -> Bool {
|
func validateToolbarItem(_ item: NSToolbarItem) -> Bool {
|
||||||
if item == addTracks ||
|
if item == addTracks ||
|
||||||
item == searchMetadata ||
|
item == searchMetadata ||
|
||||||
item == searchChapters ||
|
item == searchChapters ||
|
||||||
@@ -206,7 +206,7 @@ class DocumentWindowController: NSWindowController, TracksViewControllerDelegate
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
override func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
|
func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
|
||||||
switch menuItem.action {
|
switch menuItem.action {
|
||||||
case #selector(selectFile(_:)),
|
case #selector(selectFile(_:)),
|
||||||
#selector(selectMetadataFile(_:)),
|
#selector(selectMetadataFile(_:)),
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import Cocoa
|
|||||||
@objc optional func paste(to tableview: NSTableView)
|
@objc optional func paste(to tableview: NSTableView)
|
||||||
}
|
}
|
||||||
|
|
||||||
class ExpandedTableView: NSTableView {
|
class ExpandedTableView: NSTableView, NSMenuItemValidation {
|
||||||
|
|
||||||
@objc var pasteboardTypes: [NSPasteboard.PasteboardType]
|
@objc var pasteboardTypes: [NSPasteboard.PasteboardType]
|
||||||
var pasteboardHasSupportedType: Bool {
|
var pasteboardHasSupportedType: Bool {
|
||||||
@@ -114,7 +114,7 @@ class ExpandedTableView: NSTableView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
|
func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
|
||||||
if let action = menuItem.action {
|
if let action = menuItem.action {
|
||||||
switch action {
|
switch action {
|
||||||
case #selector(delete(_:)):
|
case #selector(delete(_:)):
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ protocol FileImportControllerDelegate : AnyObject {
|
|||||||
func didSelect(tracks: [MP42Track], metadata: MP42Metadata?)
|
func didSelect(tracks: [MP42Track], metadata: MP42Metadata?)
|
||||||
}
|
}
|
||||||
|
|
||||||
class FileImportController: NSWindowController, NSTableViewDataSource, NSTableViewDelegate {
|
class FileImportController: NSWindowController, NSTableViewDataSource, NSTableViewDelegate, NSMenuItemValidation {
|
||||||
|
|
||||||
private enum ItemType {
|
private enum ItemType {
|
||||||
case file(MP42FileImporter)
|
case file(MP42FileImporter)
|
||||||
@@ -247,7 +247,7 @@ class FileImportController: NSWindowController, NSTableViewDataSource, NSTableVi
|
|||||||
reloadCheckColumn(forRowIndexes: indexes)
|
reloadCheckColumn(forRowIndexes: indexes)
|
||||||
}
|
}
|
||||||
|
|
||||||
override func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
|
func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
|
||||||
if let action = menuItem.action,
|
if let action = menuItem.action,
|
||||||
action == #selector(self.checkSelected(_:)) ||
|
action == #selector(self.checkSelected(_:)) ||
|
||||||
action == #selector(self.uncheckSelected(_:)) ||
|
action == #selector(self.uncheckSelected(_:)) ||
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import Quartz
|
|||||||
@objc(pasteToImageBrowserView:) optional func paste(to imagebrowserview: ImageBrowserView)
|
@objc(pasteToImageBrowserView:) optional func paste(to imagebrowserview: ImageBrowserView)
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc(SBImageBrowserView) class ImageBrowserView : IKImageBrowserView {
|
@objc(SBImageBrowserView) class ImageBrowserView : IKImageBrowserView, NSMenuItemValidation {
|
||||||
|
|
||||||
@objc var pasteboardTypes: [NSPasteboard.PasteboardType]
|
@objc var pasteboardTypes: [NSPasteboard.PasteboardType]
|
||||||
var pasteboardHasSupportedType: Bool {
|
var pasteboardHasSupportedType: Bool {
|
||||||
@@ -48,7 +48,7 @@ import Quartz
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
override func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
|
func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
|
||||||
if let action = menuItem.action {
|
if let action = menuItem.action {
|
||||||
switch action {
|
switch action {
|
||||||
case #selector(paste(_:)):
|
case #selector(paste(_:)):
|
||||||
|
|||||||
@@ -475,7 +475,7 @@ class MetadataSearchController: NSWindowController, NSTableViewDataSource, NSTab
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override func controlTextDidChange(_ obj: Notification) {
|
func controlTextDidChange(_ obj: Notification) {
|
||||||
updateSearchButtonVisibility()
|
updateSearchButtonVisibility()
|
||||||
searchMovieButton.keyEquivalent = "\r"
|
searchMovieButton.keyEquivalent = "\r"
|
||||||
searchTvButton.keyEquivalent = "\r"
|
searchTvButton.keyEquivalent = "\r"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
import Cocoa
|
import Cocoa
|
||||||
import MP42Foundation
|
import MP42Foundation
|
||||||
|
|
||||||
@objc(SBOptionsViewController) class OptionsViewController: NSViewController {
|
@objc(SBOptionsViewController) class OptionsViewController: NSViewController, NSMenuItemValidation {
|
||||||
|
|
||||||
@IBOutlet var destButton: NSPopUpButton!
|
@IBOutlet var destButton: NSPopUpButton!
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ import MP42Foundation
|
|||||||
preparePresetsPopUp()
|
preparePresetsPopUp()
|
||||||
}
|
}
|
||||||
|
|
||||||
override func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
|
func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
|
||||||
switch menuItem.action {
|
switch menuItem.action {
|
||||||
case #selector(chooseDestination(_:)),
|
case #selector(chooseDestination(_:)),
|
||||||
#selector(destination(_:)):
|
#selector(destination(_:)):
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ class PresetPrefsViewController: NSViewController, SectionsTableViewDataSource,
|
|||||||
tableView.reloadData()
|
tableView.reloadData()
|
||||||
}
|
}
|
||||||
|
|
||||||
override func controlTextDidEndEditing(_ obj: Notification) {
|
func controlTextDidEndEditing(_ obj: Notification) {
|
||||||
if let view = obj.object as? NSTextField {
|
if let view = obj.object as? NSTextField {
|
||||||
let row = tableView.row(for: view)
|
let row = tableView.row(for: view)
|
||||||
let sectionRow = tableView.section(for: row)
|
let sectionRow = tableView.section(for: row)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class TokenDelegate: NSObject, NSTokenFieldDelegate {
|
|||||||
|
|
||||||
// MARK: NSTextField
|
// MARK: NSTextField
|
||||||
|
|
||||||
override func controlTextDidEndEditing(_ obj: Notification) {
|
func controlTextDidEndEditing(_ obj: Notification) {
|
||||||
delegate?.tokenDidChange(obj)
|
delegate?.tokenDidChange(obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user