Skip to content

Commit

Permalink
Moving event to AppDelegate.
Browse files Browse the repository at this point in the history
  • Loading branch information
n0shake committed May 12, 2017
1 parent 85d5b24 commit 092faa3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 15 additions & 0 deletions Clocker/ApplicationDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,21 @@ - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sende

- (IBAction)togglePanel:(id)sender
{
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
[dictionary setObject:[[[NSUserDefaults standardUserDefaults] objectForKey:CLThemeKey] isEqual: @(0)] ? @"Default" : @"Black" forKey:@"Theme"];
[dictionary setObject:[[[NSUserDefaults standardUserDefaults] objectForKey:CLDisplayFutureSliderKey] isEqual: @(0)] ? @"Yes" : @"No" forKey:@"Display Future Slider"];
[dictionary setObject:[[[NSUserDefaults standardUserDefaults] objectForKey:CLShowAppInForeground] isEqual: @(0)] ? @"Menubar" : @"Floating" forKey:@"Clocker Mode"];
[dictionary setObject:[[[NSUserDefaults standardUserDefaults] objectForKey:CLRelativeDateKey] isEqual: @(0)] ? @"Relative" : @"Actual" forKey:@"Relative Date"];
[dictionary setObject:[[[NSUserDefaults standardUserDefaults] objectForKey:CLShowSecondsInMenubar] isEqual: @(0)] ? @"Yes" : @"No" forKey:@"Show Seconds in Menubar"];
[dictionary setObject:[[NSUserDefaults standardUserDefaults] objectForKey:CLUserFontSizePreference] forKey:@"Font Size"];
[dictionary setObject:[[[NSUserDefaults standardUserDefaults] objectForKey:CLSunriseSunsetTime] isEqual:@(0)] ? @"Yes" : @"No" forKey:@"Sunrise Sunset"];
[dictionary setObject:[[[NSUserDefaults standardUserDefaults] objectForKey:CLShowDayInMenu] isEqual:@(0)] ? @"Yes" : @"No" forKey:@"Show Day in Menu"];
[dictionary setObject:[[[NSUserDefaults standardUserDefaults] objectForKey:CLShowDateInMenu] isEqual:@(0)] ? @"Yes" : @"No" forKey:@"Show Date in Menu"];
[dictionary setObject:[[[NSUserDefaults standardUserDefaults] objectForKey:CLShowPlaceInMenu] isEqual:@(0)] ? @"Yes" : @"No" forKey:@"Show Place in Menu"];

[Answers logCustomEventWithName:@"openedPanel" customAttributes:dictionary];


NSNumber *displayMode = [[NSUserDefaults standardUserDefaults] objectForKey:CLShowAppInForeground];

if (displayMode.integerValue == 1)
Expand Down
2 changes: 0 additions & 2 deletions Clocker/PanelController.m
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,6 @@ - (NSRect)statusRectForWindow:(NSWindow *)window

- (void)openPanel
{
[Answers logCustomEventWithName:@"openedPanel" customAttributes:@{}];

NSPoint mouseLoc = [NSEvent mouseLocation];
NSEnumerator *screenEnum = [[NSScreen screens] objectEnumerator];
NSScreen *screen;
Expand Down

0 comments on commit 092faa3

Please sign in to comment.