Browse Source

Added them analytics

v1.2.4
Abhishek Banthia 8 years ago
parent
commit
09b609bb97
  1. 6
      Clocker/AboutUsWindow/CLAboutUsViewController.m
  2. 20
      Clocker/Appearance Tab/CLAppearanceViewController.m
  3. 2
      Clocker/Appearance Tab/en.lproj/CLAppearanceView.xib
  4. 4
      Clocker/ApplicationDelegate.m
  5. 7
      Clocker/CLParentPanelController.m

6
Clocker/AboutUsWindow/CLAboutUsViewController.m

@ -10,6 +10,7 @@
#import "CommonStrings.h" #import "CommonStrings.h"
#import "CLAppFeedbackWindowController.h" #import "CLAppFeedbackWindowController.h"
#import "CLUnderlinedButton.h" #import "CLUnderlinedButton.h"
#import <Crashlytics/Crashlytics.h>
@interface CLAboutUsViewController () @interface CLAboutUsViewController ()
@ -80,11 +81,13 @@ NSString *const CLPersonalWebsite = @"http://abhishekbanthia.com";
- (IBAction)openMyTwitter:(id)sender - (IBAction)openMyTwitter:(id)sender
{ {
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:CLTwitterLink]]; [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:CLTwitterLink]];
[Answers logCustomEventWithName:@"openedTwitterProfile" customAttributes:@{}];
} }
- (IBAction)viewSource:(id)sender - (IBAction)viewSource:(id)sender
{ {
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:CLGitHubURL]]; [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:CLGitHubURL]];
[Answers logCustomEventWithName:@"openedGitHub" customAttributes:@{}];
} }
- (IBAction)reportIssue:(id)sender - (IBAction)reportIssue:(id)sender
{ {
@ -92,15 +95,18 @@ NSString *const CLPersonalWebsite = @"http://abhishekbanthia.com";
[self.feedbackWindow showWindow:nil]; [self.feedbackWindow showWindow:nil];
[NSApp activateIgnoringOtherApps:YES]; [NSApp activateIgnoringOtherApps:YES];
[self.view.window orderOut:self]; [self.view.window orderOut:self];
[Answers logCustomEventWithName:@"reportIssueOpened" customAttributes:@{}];
} }
- (IBAction)openFacebookPage:(id)sender - (IBAction)openFacebookPage:(id)sender
{ {
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:CLFacebookPageURL]]; [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:CLFacebookPageURL]];
[Answers logCustomEventWithName:@"openedFacebookPage" customAttributes:@{}];
} }
- (IBAction)openWebsite:(id)sender { - (IBAction)openWebsite:(id)sender {
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:CLPersonalWebsite]]; [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:CLPersonalWebsite]];
[Answers logCustomEventWithName:@"openedPersonalWebsite" customAttributes:@{}];
} }
@end @end

20
Clocker/Appearance Tab/CLAppearanceViewController.m

@ -12,6 +12,7 @@
#import "CommonStrings.h" #import "CommonStrings.h"
#import "CLTimezoneData.h" #import "CLTimezoneData.h"
#import "CLFloatingWindowController.h" #import "CLFloatingWindowController.h"
#import <Crashlytics/Crashlytics.h>
typedef NS_ENUM(NSUInteger, CLClockerMode) { typedef NS_ENUM(NSUInteger, CLClockerMode) {
CLMenubarMode = 0, CLMenubarMode = 0,
@ -44,6 +45,8 @@ typedef NS_ENUM(NSUInteger, CLClockerMode) {
[[NSUserDefaults standardUserDefaults] setObject:@(timeFormat.selectedSegment) forKey:CL24hourFormatSelectedKey]; [[NSUserDefaults standardUserDefaults] setObject:@(timeFormat.selectedSegment) forKey:CL24hourFormatSelectedKey];
[Answers logCustomEventWithName:@"Time Format Selected" customAttributes:@{@"Time Format" : timeFormat.selectedSegment == 0 ? @"12 Hour Format" : @"24 Hour Format"}];
[self refreshMainTableview:YES andUpdateFloatingWindow:YES]; [self refreshMainTableview:YES andUpdateFloatingWindow:YES];
} }
@ -74,6 +77,8 @@ typedef NS_ENUM(NSUInteger, CLClockerMode) {
} }
[panelController updateTableContent]; [panelController updateTableContent];
[Answers logCustomEventWithName:@"Theme" customAttributes:@{@"themeSelected" : themeSegment.selectedSegment == CLBlackTheme ? @"Black" : @"White"}];
} }
@ -95,13 +100,18 @@ typedef NS_ENUM(NSUInteger, CLClockerMode) {
[sharedDelegate.floatingWindow.window close]; [sharedDelegate.floatingWindow.window close];
[sharedDelegate.panelController updateDefaultPreferences]; [sharedDelegate.panelController updateDefaultPreferences];
} }
[Answers logCustomEventWithName:@"RelativeDate" customAttributes:@{@"displayMode" : modeSegment.selectedSegment == CLFloatingMode ? @"Floating Mode" : @"Menubar Mode"}];
} }
- (IBAction)changeRelativeDayDisplay:(NSSegmentedControl *)relativeDayControl - (IBAction)changeRelativeDayDisplay:(NSSegmentedControl *)relativeDayControl
{ {
NSNumber *selectedIndex = @(relativeDayControl.selectedSegment); NSNumber *selectedIndex = @(relativeDayControl.selectedSegment);
[Answers logCustomEventWithName:@"RelativeDate" customAttributes:@{@"dayPreference" : selectedIndex.integerValue == 0 ? @"Relative Day" : @"Actual Day"}];
[[NSUserDefaults standardUserDefaults] setObject:selectedIndex forKey:CLRelativeDateKey]; [[NSUserDefaults standardUserDefaults] setObject:selectedIndex forKey:CLRelativeDateKey];
[self refreshMainTableview:YES andUpdateFloatingWindow:YES]; [self refreshMainTableview:YES andUpdateFloatingWindow:YES];
@ -157,4 +167,14 @@ typedef NS_ENUM(NSUInteger, CLClockerMode) {
[self refreshMainTableview:NO andUpdateFloatingWindow:YES]; [self refreshMainTableview:NO andUpdateFloatingWindow:YES];
} }
- (IBAction)showSunriseSunset:(NSSegmentedControl *)sender {
[Answers logCustomEventWithName:@"Sunrise Sunset" customAttributes:@{@"Is It Displayed" : sender.selectedSegment == 0 ? @"YES" : @"NO"}];
}
- (IBAction)displayTimeWithSeconds:(NSSegmentedControl *)sender {
[Answers logCustomEventWithName:@"Display Time With Seconds" customAttributes:@{@"Displayed" : sender.selectedSegment == 0 ? @"YES" : @"NO"}];
}
@end @end

2
Clocker/Appearance Tab/en.lproj/CLAppearanceView.xib

@ -168,6 +168,7 @@
</segments> </segments>
</segmentedCell> </segmentedCell>
<connections> <connections>
<action selector="showSunriseSunset:" target="-2" id="ckh-bB-nda"/>
<binding destination="WGI-5h-l6M" name="selectedIndex" keyPath="values.showSunriseSetTime" id="ISl-9Q-Snd"/> <binding destination="WGI-5h-l6M" name="selectedIndex" keyPath="values.showSunriseSetTime" id="ISl-9Q-Snd"/>
</connections> </connections>
</segmentedControl> </segmentedControl>
@ -281,6 +282,7 @@
</segments> </segments>
</segmentedCell> </segmentedCell>
<connections> <connections>
<action selector="displayTimeWithSeconds:" target="-2" id="WSc-qj-YR7"/>
<binding destination="WGI-5h-l6M" name="selectedIndex" keyPath="values.showSeconds" id="Zjy-8n-mQV"/> <binding destination="WGI-5h-l6M" name="selectedIndex" keyPath="values.showSeconds" id="Zjy-8n-mQV"/>
</connections> </connections>
</segmentedControl> </segmentedControl>

4
Clocker/ApplicationDelegate.m

@ -103,8 +103,8 @@ void *kContextActivePanel = &kContextActivePanel;
[[NSUserDefaults standardUserDefaults] registerDefaults:@{ @"NSApplicationCrashOnExceptions": @YES }]; [[NSUserDefaults standardUserDefaults] registerDefaults:@{ @"NSApplicationCrashOnExceptions": @YES }];
// [[Crashlytics sharedInstance] setDebugMode:NO]; [[Crashlytics sharedInstance] setDebugMode:NO];
// [Fabric with:@[[Crashlytics class]]]; [Fabric with:@[[Crashlytics class]]];
} }

7
Clocker/CLParentPanelController.m

@ -13,6 +13,7 @@
#import <pop/POP.h> #import <pop/POP.h>
#import "iRate.h" #import "iRate.h"
#import "CLTableViewDataSource.h" #import "CLTableViewDataSource.h"
#import <Crashlytics/Crashlytics.h>
NSString *const CLNotReallyButtonTitle = @"Not Really"; NSString *const CLNotReallyButtonTitle = @"Not Really";
NSString *const CLFeedbackString = @"Mind giving feedback?"; NSString *const CLFeedbackString = @"Mind giving feedback?";
@ -66,10 +67,12 @@ NSString *const CLYesWithExclamation = @"Yes!";
{ {
if ([keyPath isEqualToString:CLDisplayFutureSliderKey]) { if ([keyPath isEqualToString:CLDisplayFutureSliderKey]) {
self.futureSlider.hidden = [change[@"new"] isEqualToNumber:@(1)] ? YES : NO; self.futureSlider.hidden = [change[@"new"] isEqualToNumber:@(1)] ? YES : NO;
[Answers logCustomEventWithName:@"Is Future Slider Displayed" customAttributes:@{@"Display Value" : self.futureSlider.isHidden ? @"NO" : @"YES"}];
} }
else if([keyPath isEqualToString:CLUserFontSizePreference]) else if([keyPath isEqualToString:CLUserFontSizePreference])
{ {
NSNumber *userFontSize = [[NSUserDefaults standardUserDefaults] objectForKey:CLUserFontSizePreference]; NSNumber *userFontSize = [[NSUserDefaults standardUserDefaults] objectForKey:CLUserFontSizePreference];
[Answers logCustomEventWithName:@"User Font Size Preference" customAttributes:@{@"Font Size" : userFontSize}];
self.scrollViewHeight.constant = self.defaultPreferences.count * (self.mainTableview.rowHeight + userFontSize.integerValue*1.5); self.scrollViewHeight.constant = self.defaultPreferences.count * (self.mainTableview.rowHeight + userFontSize.integerValue*1.5);
[self.mainTableview reloadData]; [self.mainTableview reloadData];
@ -112,10 +115,12 @@ NSString *const CLYesWithExclamation = @"Yes!";
if (!self.timezoneDataSource) { if (!self.timezoneDataSource) {
self.timezoneDataSource = [[CLTableViewDataSource alloc] initWithItems:self.defaultPreferences]; self.timezoneDataSource = [[CLTableViewDataSource alloc] initWithItems:self.defaultPreferences];
self.timezoneDataSource.futureSliderValue = self.futureSliderValue;
self.mainTableview.dataSource = self.timezoneDataSource; self.mainTableview.dataSource = self.timezoneDataSource;
self.mainTableview.delegate = self.timezoneDataSource; self.mainTableview.delegate = self.timezoneDataSource;
} }
self.timezoneDataSource.timezoneObjects = self.defaultPreferences;
self.timezoneDataSource.futureSliderValue = self.futureSliderValue;
} }
- (void)dealloc - (void)dealloc

Loading…
Cancel
Save