mirror of
https://github.com/qinyuhang/ShadowsocksX-NG-R.git
synced 2026-10-23 08:23:43 +00:00
Delete profiles to 0 stop the app, and Not auto connect if no activeProfile
This commit is contained in:
@@ -201,7 +201,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
||||
applyConfig()
|
||||
SyncSSLocal()
|
||||
|
||||
if defaults.bool(forKey: "ConnectAtLaunch") {
|
||||
if defaults.bool(forKey: "ConnectAtLaunch") && ServerProfileManager.instance.getActiveProfileId() != "" {
|
||||
toggleRunning(toggleRunningMenuItem)
|
||||
}
|
||||
|
||||
|
||||
@@ -133,6 +133,9 @@ class PreferencesWindowController: NSWindowController
|
||||
self.profilesTableView.scrollRowToVisible(index-1)
|
||||
self.profilesTableView.selectRowIndexes(IndexSet(integer: index-1), byExtendingSelection: false)
|
||||
updateProfileBoxVisible()
|
||||
if profileMgr.profiles.count == 0 {
|
||||
(NSApplication.shared().delegate as! AppDelegate).toggleRunning((NSApplication.shared().delegate as! AppDelegate).toggleRunningMenuItem)
|
||||
}
|
||||
}
|
||||
|
||||
@IBAction func ok(_ sender: NSButton) {
|
||||
|
||||
Reference in New Issue
Block a user