From 91599928cb4412c85bb7f54e9146906070fd01cd Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 1 Dec 2016 09:06:03 -0500 Subject: Clean up after a984e2dd951bcbfe5e3e6374213eb9a5fd5423cf Clean up the code after that commit. A whole bunch of stuff is no longer necessary so get rid of it all. --- Low Battery Yup/AppDelegate.h | 8 +--- Low Battery Yup/AppDelegate.m | 31 --------------- Low Battery Yup/en.lproj/MainMenu.xib | 74 ++--------------------------------- 3 files changed, 6 insertions(+), 107 deletions(-) diff --git a/Low Battery Yup/AppDelegate.h b/Low Battery Yup/AppDelegate.h index 9621fd4..a2c8ba9 100644 --- a/Low Battery Yup/AppDelegate.h +++ b/Low Battery Yup/AppDelegate.h @@ -7,15 +7,11 @@ // #import -#import -#import -#import +#import "ShortcutView.h" @interface AppDelegate : NSObject { IBOutlet NSWindow *window; - IBOutlet MASShortcutView *_shortcut_view; + IBOutlet ShortcutView *_shortcut_view; } -- (IBAction)logDefaults:(id)sender; - @end diff --git a/Low Battery Yup/AppDelegate.m b/Low Battery Yup/AppDelegate.m index 8a9005f..d90bc97 100644 --- a/Low Battery Yup/AppDelegate.m +++ b/Low Battery Yup/AppDelegate.m @@ -8,9 +8,6 @@ #import "AppDelegate.h" -static NSString *const kPreferenceGlobalShortcut = @"GlobalShortcut"; -static void *AppObservingContext = &AppObservingContext; - @implementation AppDelegate - (void)dealloc @@ -20,35 +17,7 @@ static void *AppObservingContext = &AppObservingContext; - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { - [_shortcut_view setAssociatedUserDefaultsKey:kPreferenceGlobalShortcut]; - -// NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; -// [_shortcut_view bind:@"shortcutValue" toObject:defaults withKeyPath:@"thisisatest" options:nil]; - -// [defaults addObserver:self forKeyPath:@"thisisatest" options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew context:AppObservingContext]; - -// [[MASShortcutBinder sharedBinder] -// bindShortcutWithDefaultsKey:kPreferenceGlobalShortcut -// toAction:^{NSLog(@"dudebro");}]; - -} - -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context -{ - NSLog(@"OBSERVED"); - NSLog(@"%@", change); -} - -- (IBAction)logDefaults:(id)sender -{ - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - NSLog(@"%@", [defaults objectForKey:[@"values." stringByAppendingString:kPreferenceGlobalShortcut]]); -// NSLog(@"%@", [defaults objectForKey:kPreferenceGlobalShortcut]); -// NSLog(@"%@", [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]); -// NSLog(@"%@", [_shortcut_view shortcutValue]); -// NSLog(@"%@", [[NSUserDefaults standardUserDefaults] objectForKey:@"thisisatest"]); -// [[NSUserDefaults standardUserDefaults] setObject:@"dude come on" forKey:@"thisisatest"]; } @end diff --git a/Low Battery Yup/en.lproj/MainMenu.xib b/Low Battery Yup/en.lproj/MainMenu.xib index 989bd27..2961acf 100644 --- a/Low Battery Yup/en.lproj/MainMenu.xib +++ b/Low Battery Yup/en.lproj/MainMenu.xib @@ -11,8 +11,6 @@ 2844 - NSButton - NSButtonCell NSCustomObject NSCustomView NSMenu @@ -1313,38 +1311,9 @@ {{84, 83}, {313, 19}} - - _NS:9 - ShortcutView - - - - 268 - {{211, 18}, {192, 32}} - - _NS:9 - YES - - 67108864 - 134217728 - Defaults? - - LucidaGrande - 13 - 1044 - - _NS:9 - - -2038284288 - 129 - - - 200 - 25 - - NO + ShortcutView {480, 185} @@ -1352,7 +1321,7 @@ - {{0, 0}, {1440, 878}} + {{0, 0}, {2560, 1578}} {480, 207} {480, 207} YES @@ -2054,14 +2023,6 @@ 537 - - - logDefaults: - - - - 540 - @@ -2588,7 +2549,6 @@ - @@ -3070,19 +3030,6 @@ - - 538 - - - - - - - - 539 - - - @@ -3229,8 +3176,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3257,19 +3202,8 @@ AppDelegate NSObject - - logDefaults: - id - - - logDefaults: - - logDefaults: - id - - - MASShortcutView + ShortcutView MASShortcutView NSTextField NSWindow @@ -3277,7 +3211,7 @@ _shortcut_view - MASShortcutView + ShortcutView customShortcutView -- cgit v1.2.3