From d292e75f5828b110ce7fde71ea941e9575326b1e Mon Sep 17 00:00:00 2001 From: FivePixels Date: Mon, 7 Jan 2019 18:34:24 -0600 Subject: LaunchAtLogin support is here :) --- DWA140Menu/ViewController.swift | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'DWA140Menu/ViewController.swift') diff --git a/DWA140Menu/ViewController.swift b/DWA140Menu/ViewController.swift index ea3fe55..16968a0 100644 --- a/DWA140Menu/ViewController.swift +++ b/DWA140Menu/ViewController.swift @@ -6,6 +6,7 @@ // import Cocoa +import LaunchAtLogin class ViewController: NSViewController { @@ -30,6 +31,11 @@ class ViewController: NSViewController { loginButton.state = !loginLaunch ? .on : .off defaults.set(!loginLaunch, forKey: "loginLaunch") loginLaunch = !loginLaunch + if loginLaunch { + LaunchAtLogin.isEnabled = true + } else { + LaunchAtLogin.isEnabled = false + } } @IBAction func loginButtonPressed(_ sender: NSButton) { -- cgit v1.2.3