aboutsummaryrefslogtreecommitdiffstats
path: root/Low Battery Yup
AgeCommit message (Collapse)Author
2016-12-03Remove Credits.rtfTeddy Wing
Remove this file as it isn't relevant at this point. We'll go with the simplified About panel instead.
2016-12-03Low Battery Yup-Info.plist: Update NSHumanReadableCopyrightTeddy Wing
Don't use my initials.
2016-12-03MainMenu.xib: Remove unnecessary menu itemsTeddy Wing
Remove: File, Edit, View, Format These don't apply to this app and their functions aren't relevant here.
2016-12-03Set MASShortcut build architecture to 64-bitTeddy Wing
My release build was failing because of this error: error: -fobjc-arc is not supported with fragile abi Set MASShortcut to force 64-bit architectures because it uses ARC and from what I understand ARC can only be used on 64-bit.
2016-12-03Add copyright and license text to all source filesTeddy Wing
2016-12-02Populate launchd plistTeddy Wing
Add the necessary keys to the launchd plist to start the daemon application with the right properties on login. Used the Tunnelblick launchd plist as a reference.
2016-12-02Add a button to launch & quit the daemonTeddy Wing
Add a new button to the UI that either launches or quits the daemon depending on whether it's currently running. The button is set as a "Toggle" type that will cycle between "Launch Application" and "Quit Application" labels when clicked. Depending on the button's state (0 or 1), it will either launch or quit the daemon. The button's initial state is set on the UI application's launch to determine how it should read & what it should do.
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-02MainMenu.xib: Bind "Start at login" checkbox to NSUserDefaultsControllerTeddy Wing
Add a Key-Value Binding in Interface Builder to `NSUserDefaultsController` so that the checkbox value gets persisted between launches of the app. This fixes the bug mentioned in a77a053f90a7b2588dbaabedbf25f908680f2f30 such that now unchecking the box and closing the app will result in the checkbox being unchecked on the next launch. Wow, that was super easy!
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.
2016-12-02AppDelegate.h: Add `initializeShortcutView`Teddy Wing
Add the method to the header file from the original commit in 319dd672e1c75f39bcb9239117e520513da6609a.
2016-12-01AppDelegate.m: Move ShortcutView initialization into its own methodTeddy Wing
Keep the code more organised by defining a name for this functionality since we want to add some additional code here to handle the "Start at login" checkbox.
2016-12-01Add a checkbox to the UI for whether to start at loginTeddy Wing
This will enable and disable the daemon and set whether or not it starts at login.
2016-12-01Merge branch 'shortcut-config-UI'Teddy Wing
Conflicts: Low Battery Yup/en.lproj/MainMenu.xib
2016-12-01Add Constants.h for `kPreferenceGlobalShortcut`Teddy Wing
Since `kPreferenceGlobalShortcut` was defined in two different files, extract it to a single file that gets imported where it's needed so we're not doubly defining the same string.
2016-12-01Show saved keyboard shortcut in the MASShortcutViewTeddy Wing
If a global keyboard shortcut has been stored in the `NSUserDefaults`, display that in the shortcut selection widget.
2016-12-01ShortcutView.h: Add reference to `(void)setShortcutValue:(MASShortcut*)`Teddy Wing
Because it's more explicit about the methods in our .m file and that makes it clearer.
2016-12-01MainMenu.xib: Fix reference to `_shortcut_view` ivarTeddy Wing
Broke the reference to `_shortcut_view` in a984e2dd951bcbfe5e3e6374213eb9a5fd5423cf so when we called methods on it, they didn't work. This fixes it. Oh man that gave me a hard time. Glad I took a break and had an idea to call methods on the superclass and see if they worked. They did, but not methods on `ShorcutView`. So from that I figured out that I needed to update this reference.
2016-12-01ShortcutView: Store updated shortcut in NSUserDefaultsTeddy Wing
This will enable us to access it later in the daemon.
2016-12-01Clean up after a984e2dd951bcbfe5e3e6374213eb9a5fd5423cfTeddy Wing
Clean up the code after that commit. A whole bunch of stuff is no longer necessary so get rid of it all.
2016-12-01Able to get a shortcut from the MASShortcutViewTeddy Wing
Fuck damn it finally freaking works! Damn, just had to take a 1.5 hour nap after that. We're finally able to extract a shortcut out of the MASShortcutView. After trying a whole bunch of different things, I ultimately tried opening the debugger and figured out that for whatever reason the bindings weren't getting created and because of that my shortcut wasn't getting saved in the user defaults. Couldn't figure out how to get the binding to work even after includes and whatnot. Finally decided screw it I'm going to subclass the view and get the shortcut and store it in `NSUserDefaults` myself. So that's what we're going to do and this is the first step to getting that working. Hoo boy. Definitely need to vaccum the code after this.
2016-11-19Low Battery Yup: Close the application when window is closedTeddy Wing
This app has only one window and one function. Since it's so simple, it only needs to be open for a short time. It should close when its window is closed.
2016-11-19Use DDHotKeyTextField in "Low Battery Yup"Teddy Wing
Add a text field to the MainMenu.xib primary window and use it to allow users to type hotkeys. I'm thinking we might use this instead of MASShortcut since I've been having trouble getting that to work (couldn't figure out how to get a registered hotkey out of NSUserDefaults). This tool seems simpler, and could be just the ticket.
2016-11-17Add MASShortcut widget to main windowTeddy Wing
Also remove the `@property` for the window because we're old school.
2016-11-17Configure MASShortcutTeddy Wing
Make some changes to the project to get MASShortcut working. Can't remember what they were, it was yesterday. Change the MASShortcut submodule URL to my fork of the project, which includes changes to the Xcode project file and codebase that allow it to compile in this project and on my development machine.
2016-11-16Add 'MASShortcut'Teddy Wing
Add this library as a Git submodule. We'll be using it to set a configurable shortcut and pull that when needed from `NSUserDefaults`.
2016-11-16MainMenu.xib: Remove `IBDocument.UseAutolayout` keyTeddy Wing
Xcode (4.5.2) was crashing whenever I tried to open the MainMenu.xib file. A Stack Overflow post turned up that recommended removing this key in order to get it working again: http://stackoverflow.com/questions/27167679/xcode-6-1-crashes-whenever-i-use-interface-builder/27932154#27932154 Sure, works for me.
2016-11-16Add new target "Low Battery Yup"Teddy Wing
This new target will be used as our non-background user-facing configuration application. It's purpose will be to define a custom shortcut to trigger the mouse move & click action.