auto active service when create first server profile
This commit is contained in:
@ -78,6 +78,13 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
|||||||
notifyCenter.addObserverForName(NOTIFY_SERVER_PROFILES_CHANGED, object: nil, queue: nil
|
notifyCenter.addObserverForName(NOTIFY_SERVER_PROFILES_CHANGED, object: nil, queue: nil
|
||||||
, usingBlock: {
|
, usingBlock: {
|
||||||
(note) in
|
(note) in
|
||||||
|
let profileMgr = ServerProfileManager.instance
|
||||||
|
if profileMgr.activeProfileId == nil &&
|
||||||
|
profileMgr.profiles.count > 0{
|
||||||
|
if profileMgr.profiles[0].isValid(){
|
||||||
|
profileMgr.setActiveProfiledId(profileMgr.profiles[0].uuid)
|
||||||
|
}
|
||||||
|
}
|
||||||
self.updateServersMenu()
|
self.updateServersMenu()
|
||||||
SyncSSLocal()
|
SyncSSLocal()
|
||||||
}
|
}
|
||||||
|
@ -104,6 +104,7 @@ class PreferencesWindowController: NSWindowController
|
|||||||
}
|
}
|
||||||
profileMgr.save()
|
profileMgr.save()
|
||||||
window?.performClose(nil)
|
window?.performClose(nil)
|
||||||
|
|
||||||
|
|
||||||
NSNotificationCenter.defaultCenter()
|
NSNotificationCenter.defaultCenter()
|
||||||
.postNotificationName(NOTIFY_SERVER_PROFILES_CHANGED, object: nil)
|
.postNotificationName(NOTIFY_SERVER_PROFILES_CHANGED, object: nil)
|
||||||
@ -134,7 +135,7 @@ class PreferencesWindowController: NSWindowController
|
|||||||
}
|
}
|
||||||
|
|
||||||
func updateProfileBoxVisible() {
|
func updateProfileBoxVisible() {
|
||||||
if profileMgr.profiles.count == 1 {
|
if profileMgr.profiles.count <= 1 {
|
||||||
removeButton.enabled = false
|
removeButton.enabled = false
|
||||||
}else{
|
}else{
|
||||||
removeButton.enabled = true
|
removeButton.enabled = true
|
||||||
|
Reference in New Issue
Block a user