Rename is_valid to isValid
This commit is contained in:
@ -145,6 +145,14 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
||||
|
||||
}
|
||||
|
||||
@IBAction func selectPACMode(sender: NSMenuItem) {
|
||||
|
||||
}
|
||||
|
||||
@IBAction func selectGlobalMode(sender: NSMenuItem) {
|
||||
|
||||
}
|
||||
|
||||
@IBAction func editServerPreferences(sender: NSMenuItem) {
|
||||
if preferencesWinCtrl != nil {
|
||||
preferencesWinCtrl.close()
|
||||
@ -212,7 +220,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
||||
if mgr.activeProfileId == p.uuid {
|
||||
item.state = 1
|
||||
}
|
||||
if !p.is_valid() {
|
||||
if !p.isValid() {
|
||||
item.enabled = false
|
||||
}
|
||||
item.action = #selector(AppDelegate.selectServer)
|
||||
|
@ -55,7 +55,7 @@ class PreferencesWindowController: NSWindowController
|
||||
}
|
||||
|
||||
@IBAction func addProfile(sender: NSButton) {
|
||||
if editingProfile != nil && !editingProfile.is_valid(){
|
||||
if editingProfile != nil && !editingProfile.isValid(){
|
||||
return
|
||||
}
|
||||
profilesTableView.beginUpdates()
|
||||
@ -85,7 +85,7 @@ class PreferencesWindowController: NSWindowController
|
||||
|
||||
@IBAction func ok(sender: NSButton) {
|
||||
if editingProfile != nil {
|
||||
if !editingProfile.is_valid() {
|
||||
if !editingProfile.isValid() {
|
||||
// TODO Shake window?
|
||||
return
|
||||
}
|
||||
@ -190,7 +190,7 @@ class PreferencesWindowController: NSWindowController
|
||||
return true
|
||||
}
|
||||
if editingProfile != nil {
|
||||
if !editingProfile.is_valid() {
|
||||
if !editingProfile.isValid() {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ class ServerProfile: NSObject {
|
||||
return conf
|
||||
}
|
||||
|
||||
func is_valid() -> Bool {
|
||||
func isValid() -> Bool {
|
||||
func validateIpAddress(ipToValidate: String) -> Bool {
|
||||
|
||||
var sin = sockaddr_in()
|
||||
|
@ -36,7 +36,7 @@ class ServerProfileManager: NSObject {
|
||||
let defaults = NSUserDefaults.standardUserDefaults()
|
||||
var _profiles = [AnyObject]()
|
||||
for profile in profiles {
|
||||
if profile.is_valid() {
|
||||
if profile.isValid() {
|
||||
let _profile = profile.toDictionary()
|
||||
_profiles.append(_profile)
|
||||
}
|
||||
|
Reference in New Issue
Block a user