Add new menu item: "Apply User Rules For PAC"

This commit is contained in:
Charlie Qiu
2016-06-12 08:03:27 +08:00
parent e67f7d27cb
commit 4991c2cdc4
2 changed files with 21 additions and 0 deletions

View File

@ -173,6 +173,21 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
NSWorkspace.sharedWorkspace().openURL(url)
}
@IBAction func applyUserRulesForPAC(sender: NSMenuItem) {
if GeneratePACFile() {
// Popup a user notification
let notification = NSUserNotification()
notification.title = "PAC has been updated by User Rules.".localized
NSUserNotificationCenter.defaultUserNotificationCenter()
.deliverNotification(notification)
} else {
let notification = NSUserNotification()
notification.title = "It's failed to update PAC by User Rules.".localized
NSUserNotificationCenter.defaultUserNotificationCenter()
.deliverNotification(notification)
}
}
@IBAction func showQRCodeForCurrentServer(sender: NSMenuItem) {
var errMsg: String?
let mgr = ServerProfileManager()