misc cleanup

This commit is contained in:
Grant Limberg 2016-06-21 20:02:18 -07:00
parent b5a90a437b
commit b256111a17
2 changed files with 11 additions and 5 deletions

View File

@ -109,7 +109,13 @@ class AppDelegate: NSObject, NSApplicationDelegate {
if networks.count > 0 {
for net in networks {
let id = String(net.nwid, radix: 16)
let networkName = "\(id) (\(net.name))"
var networkName = ""
if net.name.isEmpty {
networkName = "\(id)"
}
else {
networkName = "\(id) (\(net.name))"
}
let item = NSMenuItem(title: networkName, action: #selector(AppDelegate.toggleNetwork(_:)), keyEquivalent: "")

View File

@ -133,10 +133,10 @@ class ServiceCom: NSObject {
let status = httpResponse.statusCode
if status == 200 {
print("join ok")
NSLog("join ok")
}
else {
print("join error: \(status)")
NSLog("join error: \(status)")
}
}
@ -158,10 +158,10 @@ class ServiceCom: NSObject {
let status = httpResponse.statusCode
if status == 200 {
print("leave ok")
NSLog("leave ok")
}
else {
print("leave error: \(status)")
NSLog("leave error: \(status)")
}
}