Fix @objc

This commit is contained in:
Qiu Yuzhou
2017-10-20 19:58:14 +08:00
parent d56b108eb8
commit 6dbf10b7f3
4 changed files with 21 additions and 22 deletions

View File

@ -323,12 +323,11 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
if preferencesWinCtrl != nil {
preferencesWinCtrl.close()
}
let ctrl = PreferencesWindowController(windowNibName: NSNib.Name(rawValue: "PreferencesWindowController"))
preferencesWinCtrl = ctrl
preferencesWinCtrl = PreferencesWindowController(windowNibName: NSNib.Name(rawValue: "PreferencesWindowController"))
ctrl.showWindow(self)
preferencesWinCtrl.showWindow(self)
NSApp.activate(ignoringOtherApps: true)
ctrl.window?.makeKeyAndOrderFront(self)
preferencesWinCtrl.window?.makeKeyAndOrderFront(self)
}
@IBAction func showAllInOnePreferences(_ sender: NSMenuItem) {

View File

@ -11,15 +11,15 @@ import Foundation
class KcptunProfile: NSObject, NSCopying {
var mode: String = "fast"
@objc var mode: String = "fast"
var key: String = "it's a secrect"
var crypt: String = "aes"
var nocomp: Bool = false
var datashard: uint = 10
var parityshard: uint = 3
var mtu: uint = 1350
var arguments: String = ""
@objc var key: String = "it's a secrect"
@objc var crypt: String = "aes"
@objc var nocomp: Bool = false
@objc var datashard: uint = 10
@objc var parityshard: uint = 3
@objc var mtu: uint = 1350
@objc var arguments: String = ""
public func copy(with zone: NSZone? = nil) -> Any {

View File

@ -22,7 +22,7 @@ class PreferencesWinController: NSWindowController {
toolbar.selectedItemIdentifier = NSToolbarItem.Identifier(rawValue: "general")
}
func windowWillClose(_ notification: Notification) {
@objc func windowWillClose(_ notification: Notification) {
NotificationCenter.default
.post(name: NOTIFY_CONF_CHANGED, object: nil)
}

View File

@ -11,17 +11,17 @@ import Cocoa
class ServerProfile: NSObject, NSCopying {
var uuid: String
@objc var uuid: String
var serverHost: String = ""
var serverPort: uint16 = 8379
var method:String = "aes-128-gcm"
var password:String = ""
var remark:String = ""
var ota: Bool = false // onetime authentication
@objc var serverHost: String = ""
@objc var serverPort: uint16 = 8379
@objc var method:String = "aes-128-gcm"
@objc var password:String = ""
@objc var remark:String = ""
@objc var ota: Bool = false // onetime authentication
var enabledKcptun: Bool = false
var kcptunProfile = KcptunProfile()
@objc var enabledKcptun: Bool = false
@objc var kcptunProfile = KcptunProfile()
override init() {
uuid = UUID().uuidString