mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
Merge branch 'master' of https://github.com/exelban/stats
This commit is contained in:
@@ -115,7 +115,11 @@ class MainViewController: NSViewController {
|
||||
}
|
||||
|
||||
menu.addItem(NSMenuItem.separator())
|
||||
|
||||
|
||||
let openActivityMonitorMenu = NSMenuItem(title: "Open Activity Monitor", action: #selector(openActivityMonitor), keyEquivalent: "")
|
||||
openActivityMonitorMenu.target = self
|
||||
menu.addItem(openActivityMonitorMenu)
|
||||
|
||||
let checkForUpdates = NSMenuItem(title: "Check for updates on start", action: #selector(toggleMenu), keyEquivalent: "")
|
||||
checkForUpdates.state = defaults.bool(forKey: "checkUpdatesOnLogin") || defaults.object(forKey: "checkUpdatesOnLogin") == nil ? NSControl.StateValue.on : NSControl.StateValue.off
|
||||
checkForUpdates.target = self
|
||||
@@ -146,6 +150,14 @@ class MainViewController: NSViewController {
|
||||
|
||||
return menu
|
||||
}
|
||||
|
||||
@objc func openActivityMonitor(_ sender: NSMenuItem) {
|
||||
NSWorkspace.shared.launchApplication(
|
||||
withBundleIdentifier: "com.apple.ActivityMonitor",
|
||||
options: [.default],
|
||||
additionalEventParamDescriptor: nil,
|
||||
launchIdentifier: nil)
|
||||
}
|
||||
|
||||
@objc func checkUpdate(_ sender : NSMenuItem) {
|
||||
let updatesVC: NSWindowController? = NSStoryboard(name: "Updates", bundle: nil).instantiateController(withIdentifier: "UpdatesVC") as? NSWindowController
|
||||
|
||||
Reference in New Issue
Block a user