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

20
Clocker/Appearance Tab/CLAppearanceViewController.m

@ -12,6 +12,7 @@
#import "CommonStrings.h"
#import "CLTimezoneData.h"
#import "CLFloatingWindowController.h"
#import <Crashlytics/Crashlytics.h>
typedef NS_ENUM(NSUInteger, CLClockerMode) {
CLMenubarMode = 0,
@ -44,6 +45,8 @@ typedef NS_ENUM(NSUInteger, CLClockerMode) {
[[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];
}
@ -75,6 +78,8 @@ typedef NS_ENUM(NSUInteger, CLClockerMode) {
[panelController updateTableContent];
[Answers logCustomEventWithName:@"Theme" customAttributes:@{@"themeSelected" : themeSegment.selectedSegment == CLBlackTheme ? @"Black" : @"White"}];
}
- (IBAction)displayModeChanged:(NSSegmentedControl *)modeSegment
@ -95,13 +100,18 @@ typedef NS_ENUM(NSUInteger, CLClockerMode) {
[sharedDelegate.floatingWindow.window close];
[sharedDelegate.panelController updateDefaultPreferences];
}
[Answers logCustomEventWithName:@"RelativeDate" customAttributes:@{@"displayMode" : modeSegment.selectedSegment == CLFloatingMode ? @"Floating Mode" : @"Menubar Mode"}];
}
- (IBAction)changeRelativeDayDisplay:(NSSegmentedControl *)relativeDayControl
{
NSNumber *selectedIndex = @(relativeDayControl.selectedSegment);
[Answers logCustomEventWithName:@"RelativeDate" customAttributes:@{@"dayPreference" : selectedIndex.integerValue == 0 ? @"Relative Day" : @"Actual Day"}];
[[NSUserDefaults standardUserDefaults] setObject:selectedIndex forKey:CLRelativeDateKey];
[self refreshMainTableview:YES andUpdateFloatingWindow:YES];
@ -157,4 +167,14 @@ typedef NS_ENUM(NSUInteger, CLClockerMode) {
[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

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

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

4
Clocker/ApplicationDelegate.m

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

7
Clocker/CLParentPanelController.m

@ -13,6 +13,7 @@
#import <pop/POP.h>
#import "iRate.h"
#import "CLTableViewDataSource.h"
#import <Crashlytics/Crashlytics.h>
NSString *const CLNotReallyButtonTitle = @"Not Really";
NSString *const CLFeedbackString = @"Mind giving feedback?";
@ -66,10 +67,12 @@ NSString *const CLYesWithExclamation = @"Yes!";
{
if ([keyPath isEqualToString:CLDisplayFutureSliderKey]) {
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])
{
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.mainTableview reloadData];
@ -112,10 +115,12 @@ NSString *const CLYesWithExclamation = @"Yes!";
if (!self.timezoneDataSource) {
self.timezoneDataSource = [[CLTableViewDataSource alloc] initWithItems:self.defaultPreferences];
self.timezoneDataSource.futureSliderValue = self.futureSliderValue;
self.mainTableview.dataSource = self.timezoneDataSource;
self.mainTableview.delegate = self.timezoneDataSource;
}
self.timezoneDataSource.timezoneObjects = self.defaultPreferences;
self.timezoneDataSource.futureSliderValue = self.futureSliderValue;
}
- (void)dealloc

Loading…
Cancel
Save