diff options
Diffstat (limited to 'Low Battery Yup/AppDelegate.m')
| -rw-r--r-- | Low Battery Yup/AppDelegate.m | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Low Battery Yup/AppDelegate.m b/Low Battery Yup/AppDelegate.m index d90bc97..9f3e367 100644 --- a/Low Battery Yup/AppDelegate.m +++ b/Low Battery Yup/AppDelegate.m @@ -8,6 +8,8 @@ #import "AppDelegate.h" +static NSString *const kPreferenceGlobalShortcut = @"GlobalShortcut"; + @implementation AppDelegate - (void)dealloc @@ -17,7 +19,14 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { - + NSDictionary *saved_shortcut; + if ((saved_shortcut = [[NSUserDefaults standardUserDefaults] objectForKey:kPreferenceGlobalShortcut])) { + MASShortcut *shortcut = [MASShortcut + shortcutWithKeyCode:[[saved_shortcut objectForKey:@"keyCode"] unsignedIntegerValue] + modifierFlags:[[saved_shortcut objectForKey:@"modifierFlags"] unsignedIntegerValue]]; + + [_shortcut_view setShortcutValue:shortcut]; + } } @end |
