Fix build on Xcode 10 b6.

This commit is contained in:
Damiano Galassi committed 2018-08-14 07:49:15 +02:00
1 parent 1d2a2884f0
commit 10bef07af1
10 files changed
+16 -16

No files matched your search

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