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()

View File

@ -90,6 +90,12 @@
<action selector="editUserRulesForPAC:" target="Voe-Tx-rLC" id="ZtK-2d-Pcl"/>
</connections>
</menuItem>
<menuItem title="Apply User Rules For PAC" id="6qf-cg-HXc">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="applyUserRulesForPAC:" target="Voe-Tx-rLC" id="iAp-Ae-0zV"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="6sL-A4-S7N"/>
<menuItem title="Show QR Code For Current Server..." id="R6A-96-Zcb">
<modifierMask key="keyEquivalentModifierMask"/>