Add notice if agent isn't running (#47)

* Add agent checker
* Check on foreground
This commit is contained in:
Max Goedjen
2020-03-15 14:36:07 -07:00
committed by GitHub
parent bde9085d31
commit 9daae8957a
5 changed files with 87 additions and 9 deletions

View File

@@ -14,10 +14,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
return list
}()
let updater = Updater()
let agentStatusChecker = AgentStatusChecker()
func applicationDidFinishLaunching(_ aNotification: Notification) {
let contentView = ContentView(storeList: storeList, updater: updater)
let contentView = ContentView(storeList: storeList, updater: updater, agentStatusChecker: agentStatusChecker, runSetupBlock: { self.runSetup(sender: nil) })
// Create the window and set the content view.
window = NSWindow(
contentRect: NSRect(x: 0, y: 0, width: 480, height: 300),
@@ -38,6 +38,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
runSetupIfNeeded()
}
func applicationDidBecomeActive(_ notification: Notification) {
agentStatusChecker.check()
}
@IBAction func add(sender: AnyObject?) {
var addWindow: NSWindow!
let addView = CreateSecretView(store: storeList.modifiableStore!) {