aboutsummaryrefslogtreecommitdiffstats
path: root/Low Battery Yup/DaemonLauncher.m
AgeCommit message (Collapse)Author
2016-12-03Add copyright and license text to all source filesTeddy Wing
2016-12-02Revert "DaemonLauncher.m: Check if daemon is running before launch or quit"Teddy Wing
This reverts commit e5debc332f2b11f4e768e0a5b0f2b8770c25523e. Actually, I don't really like that. The methods should instead do first and error if it doesn't work. Why bother checking? We'll keep the `isRunning` method around though because we need it to know what the "Launch Application" button should read.
2016-12-02DaemonLauncher.m: Check if daemon is running before launch or quitTeddy Wing
If the daemon is already running when `launch` is called, don't bother launching. If the daemon is not running when `quit` is called, don't bother quitting.
2016-12-02DaemonLauncher: Add `isRunning` methodTeddy Wing
Says whether or not the daemon app is currently running.
2016-12-02Launch the daemon when "Start at login" is checkedTeddy Wing
Launch the daemon when checked and quit it when unchecked. Now that I'm committing this, I don't really think this is the exact right behaviour. I think running and terminating the app should be maybe a different control so that running it isn't contingent on having it start at login.
2016-12-02Add "Start at login" checkbox that [un]installs launch agentTeddy Wing
A new checkbox in the UI that asks whether the app should start at login. Checking and unchecking the box moves a LaunchAgent plist into and out of `~/Library/LaunchAgents/`. This plist file will define instructions to start the daemon on login. Also add a `DaemonLauncher` class that will launch or quit the daemon when the checkbox is clicked. Bug: Currently the app always starts with the checkbox checked. That's not what should happen. Instead, we should save the checkbox value to `NSUserDefaults` so that it has the previous value when the program is launched.