diff options
-rw-r--r-- | Low Battery Yup.d.xcodeproj/project.pbxproj | 31 | ||||
-rw-r--r-- | Low Battery Yup/AppDelegate.h | 11 | ||||
-rw-r--r-- | Low Battery Yup/AppDelegate.m | 39 | ||||
-rw-r--r-- | Low Battery Yup/DaemonLauncher.h | 17 | ||||
-rw-r--r-- | Low Battery Yup/DaemonLauncher.m | 59 | ||||
-rw-r--r-- | Low Battery Yup/LaunchAgentManager.h | 20 | ||||
-rw-r--r-- | Low Battery Yup/LaunchAgentManager.m | 52 | ||||
-rw-r--r-- | Low Battery Yup/com.teddywing.Low-Battery-Yup.StartAtLogin.plist | 17 | ||||
-rw-r--r-- | Low Battery Yup/en.lproj/MainMenu.xib | 185 |
9 files changed, 428 insertions, 3 deletions
diff --git a/Low Battery Yup.d.xcodeproj/project.pbxproj b/Low Battery Yup.d.xcodeproj/project.pbxproj index f1c9910..da19448 100644 --- a/Low Battery Yup.d.xcodeproj/project.pbxproj +++ b/Low Battery Yup.d.xcodeproj/project.pbxproj @@ -8,6 +8,8 @@ /* Begin PBXBuildFile section */ D123F5A81DDF9D2400A27B7A /* DDHotKeyCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D123F5A71DDF9D2400A27B7A /* DDHotKeyCenter.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; + D131EB381DF1E8AB00504A74 /* com.teddywing.Low-Battery-Yup.StartAtLogin.plist in Resources */ = {isa = PBXBuildFile; fileRef = D131EB371DF1E8AB00504A74 /* com.teddywing.Low-Battery-Yup.StartAtLogin.plist */; }; + D131EB4B1DF203CD00504A74 /* Low Battery Yup.d.app in Resources */ = {isa = PBXBuildFile; fileRef = D18C949E1DDC33CF00E03F87 /* Low Battery Yup.d.app */; }; D15D90B71DF0465E001700CD /* ShortcutView.m in Sources */ = {isa = PBXBuildFile; fileRef = D15D90B61DF0465E001700CD /* ShortcutView.m */; }; D1871D071DE094AB00B8030D /* DDHotKeyTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = D1871D061DE094AB00B8030D /* DDHotKeyTextField.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; D1871D081DE094C200B8030D /* DDHotKeyUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = D1A37AF01DE001770022434D /* DDHotKeyUtilities.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; @@ -21,6 +23,8 @@ D18C94C51DDC355400E03F87 /* Mouse.m in Sources */ = {isa = PBXBuildFile; fileRef = D18C94C41DDC355400E03F87 /* Mouse.m */; }; D195AE5F1DDC776000A53A18 /* MASShortcut.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D195AE5A1DDC774300A53A18 /* MASShortcut.framework */; }; D195AE601DDC776F00A53A18 /* MASShortcut.framework in Resources */ = {isa = PBXBuildFile; fileRef = D195AE5A1DDC774300A53A18 /* MASShortcut.framework */; }; + D19DF20F1DF1AD3D0094C50F /* LaunchAgentManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D19DF20E1DF1AD3D0094C50F /* LaunchAgentManager.m */; }; + D19DF2121DF1AD480094C50F /* DaemonLauncher.m in Sources */ = {isa = PBXBuildFile; fileRef = D19DF2111DF1AD480094C50F /* DaemonLauncher.m */; }; D1A37AEE1DE0012C0022434D /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D1A37AED1DE0012C0022434D /* Carbon.framework */; }; D1A37AF11DE001770022434D /* DDHotKeyUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = D1A37AF01DE001770022434D /* DDHotKeyUtilities.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; D1F809E11DDC6AA0001671E9 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D18C94A21DDC33CF00E03F87 /* Cocoa.framework */; }; @@ -32,6 +36,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + D131EB451DF2034E00504A74 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D18C94951DDC33CF00E03F87 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D18C949D1DDC33CF00E03F87; + remoteInfo = "Low Battery Yup.d"; + }; D195AE591DDC774300A53A18 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D195AE4F1DDC774200A53A18 /* MASShortcut.xcodeproj */; @@ -58,6 +69,7 @@ /* Begin PBXFileReference section */ D123F5A61DDF9D2400A27B7A /* DDHotKeyCenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DDHotKeyCenter.h; path = DDHotKey/DDHotKeyCenter.h; sourceTree = "<group>"; }; D123F5A71DDF9D2400A27B7A /* DDHotKeyCenter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DDHotKeyCenter.m; path = DDHotKey/DDHotKeyCenter.m; sourceTree = "<group>"; }; + D131EB371DF1E8AB00504A74 /* com.teddywing.Low-Battery-Yup.StartAtLogin.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "com.teddywing.Low-Battery-Yup.StartAtLogin.plist"; sourceTree = "<group>"; }; D15D90B51DF0465E001700CD /* ShortcutView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShortcutView.h; sourceTree = "<group>"; }; D15D90B61DF0465E001700CD /* ShortcutView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShortcutView.m; sourceTree = "<group>"; }; D1871D051DE094AB00B8030D /* DDHotKeyTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DDHotKeyTextField.h; path = DDHotKey/DDHotKeyTextField.h; sourceTree = "<group>"; }; @@ -78,6 +90,10 @@ D18C94C41DDC355400E03F87 /* Mouse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Mouse.m; sourceTree = "<group>"; }; D195AE4F1DDC774200A53A18 /* MASShortcut.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = MASShortcut.xcodeproj; path = MASShortcut/MASShortcut.xcodeproj; sourceTree = "<group>"; }; D19DF1F41DF09CF30094C50F /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = "<group>"; }; + D19DF20D1DF1AD3D0094C50F /* LaunchAgentManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LaunchAgentManager.h; sourceTree = "<group>"; }; + D19DF20E1DF1AD3D0094C50F /* LaunchAgentManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LaunchAgentManager.m; sourceTree = "<group>"; }; + D19DF2101DF1AD480094C50F /* DaemonLauncher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DaemonLauncher.h; sourceTree = "<group>"; }; + D19DF2111DF1AD480094C50F /* DaemonLauncher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DaemonLauncher.m; sourceTree = "<group>"; }; D1A37AED1DE0012C0022434D /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; }; D1A37AEF1DE001770022434D /* DDHotKeyUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DDHotKeyUtilities.h; path = DDHotKey/DDHotKeyUtilities.h; sourceTree = "<group>"; }; D1A37AF01DE001770022434D /* DDHotKeyUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DDHotKeyUtilities.m; path = DDHotKey/DDHotKeyUtilities.m; sourceTree = "<group>"; }; @@ -207,6 +223,10 @@ D195AE4F1DDC774200A53A18 /* MASShortcut.xcodeproj */, D1F809EE1DDC6AA0001671E9 /* AppDelegate.h */, D1F809EF1DDC6AA0001671E9 /* AppDelegate.m */, + D19DF20D1DF1AD3D0094C50F /* LaunchAgentManager.h */, + D19DF20E1DF1AD3D0094C50F /* LaunchAgentManager.m */, + D19DF2101DF1AD480094C50F /* DaemonLauncher.h */, + D19DF2111DF1AD480094C50F /* DaemonLauncher.m */, D19DF1F41DF09CF30094C50F /* Constants.h */, D15D90B51DF0465E001700CD /* ShortcutView.h */, D15D90B61DF0465E001700CD /* ShortcutView.m */, @@ -224,6 +244,7 @@ D1F809E81DDC6AA0001671E9 /* main.m */, D1F809EA1DDC6AA0001671E9 /* Low Battery Yup-Prefix.pch */, D1F809EB1DDC6AA0001671E9 /* Credits.rtf */, + D131EB371DF1E8AB00504A74 /* com.teddywing.Low-Battery-Yup.StartAtLogin.plist */, ); name = "Supporting Files"; sourceTree = "<group>"; @@ -259,6 +280,7 @@ buildRules = ( ); dependencies = ( + D131EB461DF2034E00504A74 /* PBXTargetDependency */, D1D440591DDD9B50003721DE /* PBXTargetDependency */, ); name = "Low Battery Yup"; @@ -342,10 +364,12 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + D131EB4B1DF203CD00504A74 /* Low Battery Yup.d.app in Resources */, D1F809E71DDC6AA0001671E9 /* InfoPlist.strings in Resources */, D1F809ED1DDC6AA0001671E9 /* Credits.rtf in Resources */, D1F809F31DDC6AA0001671E9 /* MainMenu.xib in Resources */, D195AE601DDC776F00A53A18 /* MASShortcut.framework in Resources */, + D131EB381DF1E8AB00504A74 /* com.teddywing.Low-Battery-Yup.StartAtLogin.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -374,12 +398,19 @@ D1871D081DE094C200B8030D /* DDHotKeyUtilities.m in Sources */, D1871D091DE0955E00B8030D /* DDHotKeyCenter.m in Sources */, D15D90B71DF0465E001700CD /* ShortcutView.m in Sources */, + D19DF20F1DF1AD3D0094C50F /* LaunchAgentManager.m in Sources */, + D19DF2121DF1AD480094C50F /* DaemonLauncher.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + D131EB461DF2034E00504A74 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D18C949D1DDC33CF00E03F87 /* Low Battery Yup.d */; + targetProxy = D131EB451DF2034E00504A74 /* PBXContainerItemProxy */; + }; D1D440591DDD9B50003721DE /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = MASShortcut; diff --git a/Low Battery Yup/AppDelegate.h b/Low Battery Yup/AppDelegate.h index 3998e46..0504102 100644 --- a/Low Battery Yup/AppDelegate.h +++ b/Low Battery Yup/AppDelegate.h @@ -9,10 +9,21 @@ #import <Cocoa/Cocoa.h> #import <MASShortcut/MASShortcut.h> #import "ShortcutView.h" +#import "LaunchAgentManager.h" +#import "DaemonLauncher.h" @interface AppDelegate : NSObject <NSApplicationDelegate> { IBOutlet NSWindow *window; IBOutlet ShortcutView *_shortcut_view; + IBOutlet NSButton *_start_at_login; + IBOutlet NSButton *_launch_app; + + LaunchAgentManager *_launchagent; + DaemonLauncher *_daemon_launcher; } +- (void)initializeShortcutView; +- (IBAction)performStartAtLogin:(id)sender; +- (IBAction)launchOrQuitDaemon:(id)sender; + @end diff --git a/Low Battery Yup/AppDelegate.m b/Low Battery Yup/AppDelegate.m index 83d03ae..69081ca 100644 --- a/Low Battery Yup/AppDelegate.m +++ b/Low Battery Yup/AppDelegate.m @@ -11,13 +11,32 @@ @implementation AppDelegate +- (id)init +{ + self = [super init]; + if (self) { + _launchagent = [[LaunchAgentManager alloc] init]; + _daemon_launcher = [[DaemonLauncher alloc] init]; + } + return self; +} + - (void)dealloc { + [_launchagent release]; + [_daemon_launcher release]; [super dealloc]; } - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + [self initializeShortcutView]; + [self performStartAtLogin:self]; + [_launch_app setState:[_daemon_launcher isRunning]]; +} + +- (void)initializeShortcutView +{ NSDictionary *saved_shortcut; if ((saved_shortcut = [[NSUserDefaults standardUserDefaults] objectForKey:kPreferenceGlobalShortcut])) { MASShortcut *shortcut = [MASShortcut @@ -28,6 +47,26 @@ } } +- (IBAction)performStartAtLogin:(id)sender +{ + if ([_start_at_login state] == NSOnState) { + [_launchagent install]; + } + else { + [_launchagent uninstall]; + } +} + +- (IBAction)launchOrQuitDaemon:(id)sender +{ + if ([_launch_app state]) { + [_daemon_launcher launch]; + } + else { + [_daemon_launcher quit]; + } +} + - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication { return YES; diff --git a/Low Battery Yup/DaemonLauncher.h b/Low Battery Yup/DaemonLauncher.h new file mode 100644 index 0000000..586dbda --- /dev/null +++ b/Low Battery Yup/DaemonLauncher.h @@ -0,0 +1,17 @@ +// +// DaemonLauncher.h +// Low Battery Yup.d +// +// Created by TW on 12/2/16. +// Copyright (c) 2016 TW. All rights reserved. +// + +#import <Foundation/Foundation.h> + +@interface DaemonLauncher : NSObject + +- (BOOL)launch; +- (BOOL)quit; +- (BOOL)isRunning; + +@end diff --git a/Low Battery Yup/DaemonLauncher.m b/Low Battery Yup/DaemonLauncher.m new file mode 100644 index 0000000..355e9fd --- /dev/null +++ b/Low Battery Yup/DaemonLauncher.m @@ -0,0 +1,59 @@ +// +// DaemonLauncher.m +// Low Battery Yup.d +// +// Created by TW on 12/2/16. +// Copyright (c) 2016 TW. All rights reserved. +// + +#import "DaemonLauncher.h" + +@implementation DaemonLauncher + +- (BOOL)launch +{ + NSURL *daemon_url = [[NSBundle mainBundle] URLForResource:@"Low Battery Yup.d" withExtension:@"app"]; + + NSError *error = nil; + [[NSWorkspace sharedWorkspace] + launchApplicationAtURL:daemon_url + options:NSWorkspaceLaunchWithoutAddingToRecents | NSWorkspaceLaunchWithoutActivation + configuration:nil + error:&error]; + + if (error != nil) { + NSLog(@"%@", error); + return NO; + } + + return YES; +} + +- (BOOL)quit +{ + NSArray *applications = [NSRunningApplication + runningApplicationsWithBundleIdentifier:@"com.teddywing.Low-Battery-Yup-d"]; + + if ([applications count] > 0) { + NSRunningApplication *daemon = [applications objectAtIndex:0]; + return [daemon terminate]; + } + + return NO; +} + +- (BOOL)isRunning +{ + NSArray *runningApplications = [[NSWorkspace sharedWorkspace] runningApplications]; + + for (int i = 0; i < [runningApplications count]; i++) { + if ([[[runningApplications objectAtIndex:i] bundleIdentifier] + isEqualToString:@"com.teddywing.Low-Battery-Yup-d"]) { + return YES; + } + } + + return NO; +} + +@end diff --git a/Low Battery Yup/LaunchAgentManager.h b/Low Battery Yup/LaunchAgentManager.h new file mode 100644 index 0000000..5a9fa44 --- /dev/null +++ b/Low Battery Yup/LaunchAgentManager.h @@ -0,0 +1,20 @@ +// +// LaunchAgentManager.h +// Low Battery Yup.d +// +// Created by TW on 12/2/16. +// Copyright (c) 2016 TW. All rights reserved. +// + +#import <Foundation/Foundation.h> + +#define LAUNCH_AGENTS_PATH @"~/Library/LaunchAgents" + +@interface LaunchAgentManager : NSObject { + NSFileManager *_file_manager; +} + +- (BOOL)install; +- (BOOL)uninstall; + +@end diff --git a/Low Battery Yup/LaunchAgentManager.m b/Low Battery Yup/LaunchAgentManager.m new file mode 100644 index 0000000..fd75795 --- /dev/null +++ b/Low Battery Yup/LaunchAgentManager.m @@ -0,0 +1,52 @@ +// +// LaunchAgentManager.m +// Low Battery Yup.d +// +// Created by TW on 12/2/16. +// Copyright (c) 2016 TW. All rights reserved. +// + +#import "LaunchAgentManager.h" + +@implementation LaunchAgentManager + +- (id)init +{ + self = [super init]; + if (self) { + _file_manager = [NSFileManager defaultManager]; + } + return self; +} + +- (BOOL)install +{ + NSBundle *main_bundle = [NSBundle mainBundle]; + NSURL *launchagents_url = [NSURL fileURLWithPath: + [[LAUNCH_AGENTS_PATH stringByAppendingString:@"/com.teddywing.Low-Battery-Yup.StartAtLogin.plist"] stringByExpandingTildeInPath] + isDirectory:YES]; + + NSError *error; + BOOL success = [_file_manager copyItemAtURL: + [main_bundle URLForResource:@"com.teddywing.Low-Battery-Yup.StartAtLogin" withExtension:@"plist"] + toURL:launchagents_url + error:&error]; + + if (!success) { + NSLog(@"%@", error); + } + + return success; +} + +- (BOOL)uninstall +{ + return [[NSWorkspace sharedWorkspace] + performFileOperation:NSWorkspaceRecycleOperation + source:[LAUNCH_AGENTS_PATH stringByExpandingTildeInPath] + destination:@"" + files:[NSArray arrayWithObject:@"com.teddywing.Low-Battery-Yup.StartAtLogin.plist"] + tag:nil]; +} + +@end diff --git a/Low Battery Yup/com.teddywing.Low-Battery-Yup.StartAtLogin.plist b/Low Battery Yup/com.teddywing.Low-Battery-Yup.StartAtLogin.plist new file mode 100644 index 0000000..37ece9c --- /dev/null +++ b/Low Battery Yup/com.teddywing.Low-Battery-Yup.StartAtLogin.plist @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>Label</key> + <string>com.teddywing.Low-Battery-Yup.StartAtLogin</string> + <key>ProgramArguments</key> + <array> + <string>/usr/bin/open</string> + <string>/Applications/Low Battery Yup.app/Contents/Resources/Low Battery Yup.d.app</string> + </array> + <key>LimitLoadToSessionType</key> + <string>Aqua</string> + <key>RunAtLoad</key> + <true/> +</dict> +</plist> diff --git a/Low Battery Yup/en.lproj/MainMenu.xib b/Low Battery Yup/en.lproj/MainMenu.xib index 4b01316..f8f0d64 100644 --- a/Low Battery Yup/en.lproj/MainMenu.xib +++ b/Low Battery Yup/en.lproj/MainMenu.xib @@ -11,10 +11,13 @@ <string key="NS.object.0">2844</string> </object> <array key="IBDocument.IntegratedClassDependencies"> + <string>NSButton</string> + <string>NSButtonCell</string> <string>NSCustomObject</string> <string>NSCustomView</string> <string>NSMenu</string> <string>NSMenuItem</string> + <string>NSUserDefaultsController</string> <string>NSView</string> <string>NSWindowTemplate</string> </array> @@ -1308,19 +1311,81 @@ <object class="NSCustomView" id="489226571"> <reference key="NSNextResponder" ref="439893737"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{84, 83}, {313, 19}}</string> + <string key="NSFrame">{{84, 100}, {313, 19}}</string> <reference key="NSSuperview" ref="439893737"/> <reference key="NSWindow"/> + <reference key="NSNextKeyView" ref="1065652370"/> <string key="NSReuseIdentifierKey">_NS:9</string> <string key="NSClassName">ShortcutView</string> </object> + <object class="NSButton" id="1065652370"> + <reference key="NSNextResponder" ref="439893737"/> + <int key="NSvFlags">268</int> + <string key="NSFrame">{{82, 32}, {104, 18}}</string> + <reference key="NSSuperview" ref="439893737"/> + <reference key="NSWindow"/> + <reference key="NSNextKeyView" ref="452223334"/> + <string key="NSReuseIdentifierKey">_NS:9</string> + <bool key="NSEnabled">YES</bool> + <object class="NSButtonCell" key="NSCell" id="508243847"> + <int key="NSCellFlags">-2080374784</int> + <int key="NSCellFlags2">268435456</int> + <string key="NSContents">Start at login</string> + <object class="NSFont" key="NSSupport" id="380350173"> + <string key="NSName">LucidaGrande</string> + <double key="NSSize">13</double> + <int key="NSfFlags">1044</int> + </object> + <string key="NSCellIdentifier">_NS:9</string> + <reference key="NSControlView" ref="1065652370"/> + <int key="NSButtonFlags">1211912448</int> + <int key="NSButtonFlags2">2</int> + <object class="NSCustomResource" key="NSNormalImage"> + <string key="NSClassName">NSImage</string> + <string key="NSResourceName">NSSwitch</string> + </object> + <object class="NSButtonImageSource" key="NSAlternateImage"> + <string key="NSImageName">NSSwitch</string> + </object> + <string key="NSAlternateContents"/> + <string key="NSKeyEquivalent"/> + <int key="NSPeriodicDelay">200</int> + <int key="NSPeriodicInterval">25</int> + </object> + <bool key="NSAllowsLogicalLayoutDirection">NO</bool> + </object> + <object class="NSButton" id="452223334"> + <reference key="NSNextResponder" ref="439893737"/> + <int key="NSvFlags">268</int> + <string key="NSFrame">{{242, 24}, {161, 32}}</string> + <reference key="NSSuperview" ref="439893737"/> + <reference key="NSWindow"/> + <reference key="NSNextKeyView"/> + <string key="NSReuseIdentifierKey">_NS:9</string> + <bool key="NSEnabled">YES</bool> + <object class="NSButtonCell" key="NSCell" id="622792239"> + <int key="NSCellFlags">67108864</int> + <int key="NSCellFlags2">134217728</int> + <string key="NSContents">Launch Application</string> + <reference key="NSSupport" ref="380350173"/> + <string key="NSCellIdentifier">_NS:9</string> + <reference key="NSControlView" ref="452223334"/> + <int key="NSButtonFlags">-930988032</int> + <int key="NSButtonFlags2">129</int> + <string key="NSAlternateContents">Quit Application</string> + <string key="NSKeyEquivalent"/> + <int key="NSPeriodicDelay">200</int> + <int key="NSPeriodicInterval">25</int> + </object> + <bool key="NSAllowsLogicalLayoutDirection">NO</bool> + </object> </array> <string key="NSFrameSize">{480, 185}</string> <reference key="NSSuperview"/> <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="489226571"/> </object> - <string key="NSScreenRect">{{0, 0}, {2560, 1578}}</string> + <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string> <string key="NSMinSize">{480, 207}</string> <string key="NSMaxSize">{480, 207}</string> <bool key="NSWindowIsRestorable">YES</bool> @@ -1331,6 +1396,9 @@ <object class="NSCustomObject" id="755631768"> <string key="NSClassName">NSFontManager</string> </object> + <object class="NSUserDefaultsController" id="453441597"> + <bool key="NSSharedInstance">YES</bool> + </object> </array> <object class="IBObjectContainer" key="IBDocument.Objects"> <array class="NSMutableArray" key="connectionRecords"> @@ -2022,6 +2090,54 @@ </object> <int key="connectionID">541</int> </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">_start_at_login</string> + <reference key="source" ref="976324537"/> + <reference key="destination" ref="1065652370"/> + </object> + <int key="connectionID">544</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">performStartAtLogin:</string> + <reference key="source" ref="976324537"/> + <reference key="destination" ref="1065652370"/> + </object> + <int key="connectionID">545</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">launchOrQuitDaemon:</string> + <reference key="source" ref="976324537"/> + <reference key="destination" ref="452223334"/> + </object> + <int key="connectionID">555</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">_launch_app</string> + <reference key="source" ref="976324537"/> + <reference key="destination" ref="452223334"/> + </object> + <int key="connectionID">556</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBBindingConnection" key="connection"> + <string key="label">value: values.StartAtLogin</string> + <reference key="source" ref="1065652370"/> + <reference key="destination" ref="453441597"/> + <object class="NSNibBindingConnector" key="connector"> + <reference key="NSSource" ref="1065652370"/> + <reference key="NSDestination" ref="453441597"/> + <string key="NSLabel">value: values.StartAtLogin</string> + <string key="NSBinding">value</string> + <string key="NSKeyPath">values.StartAtLogin</string> + <int key="NSNibBindingConnectorVersion">2</int> + </object> + </object> + <int key="connectionID">552</int> + </object> </array> <object class="IBMutableOrderedSet" key="objectRecords"> <array key="orderedObjects"> @@ -2547,7 +2663,9 @@ <int key="objectID">372</int> <reference key="object" ref="439893737"/> <array class="NSMutableArray" key="children"> + <reference ref="1065652370"/> <reference ref="489226571"/> + <reference ref="452223334"/> </array> <reference key="parent" ref="972006081"/> </object> @@ -3029,6 +3147,37 @@ <reference key="object" ref="489226571"/> <reference key="parent" ref="439893737"/> </object> + <object class="IBObjectRecord"> + <int key="objectID">542</int> + <reference key="object" ref="1065652370"/> + <array class="NSMutableArray" key="children"> + <reference ref="508243847"/> + </array> + <reference key="parent" ref="439893737"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">543</int> + <reference key="object" ref="508243847"/> + <reference key="parent" ref="1065652370"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">546</int> + <reference key="object" ref="453441597"/> + <reference key="parent" ref="0"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">553</int> + <reference key="object" ref="452223334"/> + <array class="NSMutableArray" key="children"> + <reference ref="622792239"/> + </array> + <reference key="parent" ref="439893737"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">554</int> + <reference key="object" ref="622792239"/> + <reference key="parent" ref="452223334"/> + </object> </array> </object> <dictionary class="NSMutableDictionary" key="flattenedProperties"> @@ -3175,6 +3324,11 @@ <string key="517.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> <string key="534.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> <string key="536.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="542.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="543.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="546.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="553.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="554.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> <string key="56.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> <string key="57.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> <string key="58.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> @@ -3194,24 +3348,48 @@ <nil key="activeLocalization"/> <dictionary class="NSMutableDictionary" key="localizations"/> <nil key="sourceID"/> - <int key="maxID">541</int> + <int key="maxID">559</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <array class="NSMutableArray" key="referencedPartialClassDescriptions"> <object class="IBPartialClassDescription"> <string key="className">AppDelegate</string> <string key="superclassName">NSObject</string> + <dictionary class="NSMutableDictionary" key="actions"> + <string key="launchOrQuitDaemon:">id</string> + <string key="performStartAtLogin:">id</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="actionInfosByName"> + <object class="IBActionInfo" key="launchOrQuitDaemon:"> + <string key="name">launchOrQuitDaemon:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="performStartAtLogin:"> + <string key="name">performStartAtLogin:</string> + <string key="candidateClassName">id</string> + </object> + </dictionary> <dictionary class="NSMutableDictionary" key="outlets"> + <string key="_launch_app">NSButton</string> <string key="_shortcut_view">ShortcutView</string> + <string key="_start_at_login">NSButton</string> <string key="customShortcutView">MASShortcutView</string> <string key="feedbackTextField">NSTextField</string> <string key="window">NSWindow</string> </dictionary> <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName"> + <object class="IBToOneOutletInfo" key="_launch_app"> + <string key="name">_launch_app</string> + <string key="candidateClassName">NSButton</string> + </object> <object class="IBToOneOutletInfo" key="_shortcut_view"> <string key="name">_shortcut_view</string> <string key="candidateClassName">ShortcutView</string> </object> + <object class="IBToOneOutletInfo" key="_start_at_login"> + <string key="name">_start_at_login</string> + <string key="candidateClassName">NSButton</string> + </object> <object class="IBToOneOutletInfo" key="customShortcutView"> <string key="name">customShortcutView</string> <string key="candidateClassName">MASShortcutView</string> @@ -3255,6 +3433,7 @@ <dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes"> <string key="NSMenuCheckmark">{11, 11}</string> <string key="NSMenuMixedState">{10, 3}</string> + <string key="NSSwitch">{15, 15}</string> </dictionary> </data> </archive> |