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