Browse Source

Final changes.

v1.2.2
Abhishek Banthia 9 years ago
parent
commit
7d20758ca7
  1. 33
      Clocker-Helper/Clocker-Helper/AppDelegate.m
  2. BIN
      Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate
  3. 4
      Clocker.xcodeproj/xcuserdata/abhishekbanthia.xcuserdatad/xcschemes/Clocker.xcscheme
  4. 16
      Clocker/App Feedback/CLAppFeedbackWindow.xib
  5. 9
      Clocker/Appearance Tab/CLAppearanceView.xib
  6. 34
      Clocker/ApplicationDelegate.m
  7. 2
      Clocker/Custom Table Cell Views/CLTimezoneCellView.m
  8. 1
      Clocker/Model/CLTimezoneData.h
  9. 39
      Clocker/Preferences/CLPreferencesView.xib
  10. 30
      Clocker/Preferences/CLPreferencesViewController.m

33
Clocker-Helper/Clocker-Helper/AppDelegate.m

@ -7,6 +7,8 @@
//
#import "AppDelegate.h"
#define terminateNotification @"TerminateHelper"
#define mainAppBundleIdentifier @"com.abhishek.Clocker"
@interface AppDelegate ()
@ -17,11 +19,31 @@
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
NSString *path = [[[[[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent] stringByDeletingLastPathComponent] stringByDeletingLastPathComponent] stringByDeletingLastPathComponent];
[[NSDistributedNotificationCenter defaultCenter] addObserver:self
selector:@selector(killApp)
name:terminateNotification
object:mainAppBundleIdentifier];
[[NSWorkspace sharedWorkspace] launchApplication:path];
BOOL alreadyRunning = NO;
BOOL isActive = NO;
/*The Helper App's job is done!*/
NSArray *running = [[NSWorkspace sharedWorkspace] runningApplications];
for (NSRunningApplication *app in running) {
if ([[app bundleIdentifier] isEqualToString:@"com.abhishek.Clocker"]) {
alreadyRunning = YES;
isActive = [app isActive];
break;
}
}
if (!alreadyRunning || !isActive) {
NSString *path = [[[[[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent] stringByDeletingLastPathComponent] stringByDeletingLastPathComponent] stringByDeletingLastPathComponent];
NSLog(@"Path:%@", path);
[[NSWorkspace sharedWorkspace] launchApplication:path];
}
[NSApp terminate:nil];
}
@ -29,4 +51,9 @@
// Insert code here to tear down your application
}
-(void)killApp
{
[NSApp terminate:nil];
}
@end

BIN
Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate generated

Binary file not shown.

4
Clocker.xcodeproj/xcuserdata/abhishekbanthia.xcuserdatad/xcschemes/Clocker.xcscheme

@ -51,7 +51,9 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
showNonLocalizedStrings = "YES">
showNonLocalizedStrings = "YES"
language = "en"
region = "JP">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference

16
Clocker/App Feedback/CLAppFeedbackWindow.xib

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9531"/>
<capability name="box content view" minToolsVersion="7.0"/>
</dependencies>
@ -44,6 +43,9 @@
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</clipView>
<constraints>
<constraint firstAttribute="height" constant="135" id="5Sp-su-m1e"/>
</constraints>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="9Ed-AQ-o4N">
<rect key="frame" x="-100" y="-100" width="87" height="18"/>
<autoresizingMask key="autoresizingMask"/>
@ -82,7 +84,7 @@
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" preferredMaxLayoutWidth="269" translatesAutoresizingMaskIntoConstraints="NO" id="LVY-Qw-MYC">
<rect key="frame" x="6" y="8" width="283" height="30"/>
<rect key="frame" x="6" y="8" width="277" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="dRi-pM-pWX"/>
</constraints>
@ -94,12 +96,13 @@
</textField>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="Qzm-kE-Igl" secondAttribute="trailing" constant="10" id="1d6-68-dye"/>
<constraint firstItem="zlM-Cf-OxV" firstAttribute="top" secondItem="Qzm-kE-Igl" secondAttribute="bottom" constant="10" id="9Gc-9K-fJF"/>
<constraint firstItem="Qzm-kE-Igl" firstAttribute="top" secondItem="moX-Vc-vMc" secondAttribute="top" constant="11" id="Dpz-4F-hN7"/>
<constraint firstItem="Qzm-kE-Igl" firstAttribute="leading" secondItem="moX-Vc-vMc" secondAttribute="leading" constant="10" id="GKZ-24-t7t"/>
<constraint firstItem="LVY-Qw-MYC" firstAttribute="top" secondItem="zlM-Cf-OxV" secondAttribute="bottom" constant="7" id="Xck-iy-cZk"/>
<constraint firstItem="LVY-Qw-MYC" firstAttribute="leading" secondItem="moX-Vc-vMc" secondAttribute="leading" constant="8" id="iLs-Ob-MZC"/>
<constraint firstItem="LVY-Qw-MYC" firstAttribute="centerX" secondItem="moX-Vc-vMc" secondAttribute="centerX" constant="2.5" id="k3n-00-eiV"/>
<constraint firstItem="LVY-Qw-MYC" firstAttribute="centerX" secondItem="moX-Vc-vMc" secondAttribute="centerX" id="k3n-00-eiV"/>
<constraint firstItem="zlM-Cf-OxV" firstAttribute="leading" secondItem="moX-Vc-vMc" secondAttribute="leading" constant="10" id="u3y-gI-YeL"/>
</constraints>
</view>
@ -179,10 +182,8 @@ DQ
</progressIndicator>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="Qzm-kE-Igl" secondAttribute="trailing" constant="30" id="5UG-sC-szG"/>
<constraint firstItem="W3a-Hi-ryk" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="12" id="8UN-bn-s8Y"/>
<constraint firstAttribute="trailing" secondItem="zlM-Cf-OxV" secondAttribute="trailing" constant="30" id="Arj-b2-oje"/>
<constraint firstAttribute="trailing" secondItem="LVY-Qw-MYC" secondAttribute="trailing" constant="22" id="I39-jS-bL7"/>
<constraint firstAttribute="trailing" secondItem="oNX-kV-RGt" secondAttribute="trailing" constant="12" id="IqR-EG-ga3"/>
<constraint firstItem="sJq-1o-Bft" firstAttribute="leading" secondItem="szs-8j-SMN" secondAttribute="trailing" constant="8" id="JSB-K6-cbX"/>
<constraint firstAttribute="trailing" secondItem="sJq-1o-Bft" secondAttribute="trailing" constant="20" id="KuW-ez-Od9"/>
@ -190,16 +191,15 @@ DQ
<constraint firstAttribute="bottom" secondItem="h17-og-9PU" secondAttribute="bottom" constant="20" id="OLS-kL-muQ"/>
<constraint firstItem="oNX-kV-RGt" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="12" id="P0X-Hb-ZtS"/>
<constraint firstItem="szs-8j-SMN" firstAttribute="leading" secondItem="h17-og-9PU" secondAttribute="trailing" constant="8" id="S7a-To-K83"/>
<constraint firstItem="W3a-Hi-ryk" firstAttribute="top" secondItem="moX-Vc-vMc" secondAttribute="bottom" constant="3" id="U6n-Ij-4TB"/>
<constraint firstAttribute="bottom" secondItem="sJq-1o-Bft" secondAttribute="bottom" constant="20" id="cft-qs-VMz"/>
<constraint firstItem="szs-8j-SMN" firstAttribute="top" secondItem="JzF-Oq-qhW" secondAttribute="bottom" constant="29" id="hxq-hm-F4K"/>
<constraint firstItem="h17-og-9PU" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="12" id="iIH-oN-lBO"/>
<constraint firstAttribute="trailing" secondItem="W3a-Hi-ryk" secondAttribute="trailing" constant="22" id="j6H-0M-Cux"/>
<constraint firstAttribute="trailing" secondItem="JzF-Oq-qhW" secondAttribute="trailing" constant="22" id="leu-ZX-18k"/>
<constraint firstAttribute="trailing" secondItem="gej-YH-9dt" secondAttribute="trailing" constant="12" id="qjH-ND-NKx"/>
<constraint firstItem="gej-YH-9dt" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="12" id="tlA-wq-Gts"/>
<constraint firstItem="JzF-Oq-qhW" firstAttribute="top" secondItem="oNX-kV-RGt" secondAttribute="bottom" constant="13" id="w7P-k5-O59"/>
<constraint firstItem="szs-8j-SMN" firstAttribute="top" secondItem="W3a-Hi-ryk" secondAttribute="bottom" constant="6" id="vlm-Yj-d84"/>
<constraint firstAttribute="bottom" secondItem="szs-8j-SMN" secondAttribute="bottom" constant="20" id="xos-N8-d1k"/>
<constraint firstItem="JzF-Oq-qhW" firstAttribute="top" secondItem="sCg-gV-TTr" secondAttribute="bottom" constant="14" id="yKx-Wi-JS1"/>
<constraint firstItem="gej-YH-9dt" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" constant="14" id="yZE-PY-8EZ"/>
<constraint firstItem="oNX-kV-RGt" firstAttribute="top" secondItem="gej-YH-9dt" secondAttribute="bottom" constant="8" id="yec-Eo-Jb9"/>
</constraints>

9
Clocker/Appearance Tab/CLAppearanceView.xib

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9531"/>
</dependencies>
<objects>
@ -96,7 +95,7 @@
<constraint firstAttribute="width" constant="175" id="hHO-Wa-gmc"/>
</constraints>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Menubar Display Options" id="ZP5-1i-Bm8">
<font key="font" size="12" name="SFUIDisplay-Regular"/>
<font key="font" size="12" name="SFUIDisplay-Bold"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
@ -239,7 +238,7 @@
<constraint firstAttribute="height" constant="18" id="bTT-ve-oW9"/>
</constraints>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Main Panel Options" id="skQ-rM-X70">
<font key="font" size="12" name="SFUIDisplay-Regular"/>
<font key="font" size="12" name="SFUIDisplay-Bold"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
@ -265,7 +264,7 @@
<rect key="frame" x="0.0" y="0.0" width="439" height="195"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="WDP-d4-eNj">
<rect key="frame" x="58" y="67" width="324" height="39"/>
<rect key="frame" x="57" y="85" width="324" height="39"/>
<constraints>
<constraint firstAttribute="width" constant="320" id="3wp-Z6-TrB"/>
<constraint firstAttribute="height" constant="39" id="IyN-y5-6JP"/>
@ -282,7 +281,7 @@
</subviews>
<constraints>
<constraint firstAttribute="height" constant="195" id="JD3-oH-lbP"/>
<constraint firstItem="WDP-d4-eNj" firstAttribute="centerY" secondItem="kHi-mx-HdE" secondAttribute="centerY" constant="11" id="YZN-MB-zQ8"/>
<constraint firstItem="WDP-d4-eNj" firstAttribute="centerY" secondItem="kHi-mx-HdE" secondAttribute="centerY" constant="-7" id="YZN-MB-zQ8"/>
<constraint firstItem="WDP-d4-eNj" firstAttribute="centerX" secondItem="kHi-mx-HdE" secondAttribute="centerX" id="xlO-Y9-7Dn"/>
</constraints>
<shadow key="shadow" blurRadius="10">

34
Clocker/ApplicationDelegate.m

@ -34,8 +34,10 @@
#import <Parse/Parse.h>
#import "CLOnboardingWindowController.h"
#define helperAppBundleIdentifier @"com.abhishek.Clocker-Helper" // change as appropriate to help app bundle identifier
NSString *const CLParseApplicationID = @"F2ahd8J6sfjQMCc5z3xSy9kVK94PmKmH6hV2UsUK";
NSString *const CLParseClientID = @"vfnqDtinvmwUBkcifznYHzYTetxN5iMvt8Ey8StD";
#define terminateNotification @"TerminateHelper"
@implementation ApplicationDelegate
@ -66,8 +68,8 @@ void *kContextActivePanel = &kContextActivePanel;
+ (void)initialize
{
//Configure iRate
[iRate sharedInstance].appStoreID = (NSInteger)nil;
[iVersion sharedInstance].appStoreID = (NSInteger)nil;
[iRate sharedInstance].appStoreID = 1056643111;
[iVersion sharedInstance].appStoreID = 1056643111;
[iRate sharedInstance].useAllAvailableLanguages = NO;
[iVersion sharedInstance].useAllAvailableLanguages = NO;
[[iRate sharedInstance] setVerboseLogging:YES];
@ -79,6 +81,20 @@ void *kContextActivePanel = &kContextActivePanel;
- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
BOOL startedAtLogin = NO;
NSArray *apps = [[NSWorkspace sharedWorkspace] runningApplications];
for (NSRunningApplication *app in apps) {
if ([app.bundleIdentifier isEqualToString:helperAppBundleIdentifier]) startedAtLogin = YES;
}
if (startedAtLogin) {
[[NSDistributedNotificationCenter defaultCenter]
postNotificationName:terminateNotification
object:[[NSBundle mainBundle] bundleIdentifier]];
}
NSString *defaultTheme = [[NSUserDefaults standardUserDefaults] objectForKey:CLThemeKey];
if (defaultTheme == nil) {
[[NSUserDefaults standardUserDefaults] setObject:@"Default" forKey:CLThemeKey];
@ -126,21 +142,17 @@ void *kContextActivePanel = &kContextActivePanel;
if (onboarding == nil)
{
[[NSUserDefaults standardUserDefaults] setObject:@"OnboardingDone" forKey:@"initalLaunch"];
[self.menubarController setInitialTimezoneData];
CLOnboardingWindowController *windowController = [CLOnboardingWindowController sharedWindow];
[windowController showWindow:nil];
[NSApp activateIgnoringOtherApps:YES];
[[NSUserDefaults standardUserDefaults] setObject:@"OnboardingDone" forKey:@"initalLaunch"];
[self.menubarController setInitialTimezoneData];
}
CLOnboardingWindowController *windowController = [CLOnboardingWindowController sharedWindow];
[windowController showWindow:nil];
[NSApp activateIgnoringOtherApps:YES];
[[NSUserDefaults standardUserDefaults] registerDefaults:@{ @"NSApplicationCrashOnExceptions": @YES }];
[[Crashlytics sharedInstance] setDebugMode:NO];
[Fabric with:@[[Crashlytics class]]];
//Setting up Parse
[Parse setApplicationId:CLParseApplicationID

2
Clocker/Custom Table Cell Views/CLTimezoneCellView.m

@ -46,7 +46,7 @@
{
CLTimezoneData *timeObject = [CLTimezoneData getCustomObject:object];
if ([timeObject.formattedAddress isEqualToString:customLabelValue]) {
return;
timeObject.customLabel = CLEmptyString;
}
}

1
Clocker/Model/CLTimezoneData.h

@ -36,7 +36,6 @@ typedef enum : NSUInteger {
- (NSString *)getLocalCurrentDate;
- (NSString *)compareSystemDate:(NSString *)systemDate toTimezoneDate:(NSString *)date;
- (NSString *)getDateForTimeZoneWithFutureSliderValue:(NSInteger)futureSliderValue andDisplayType:(CLDateDisplayType)type;
- (void)getTimeZoneForLatitude:(NSString *)latitude andLongitude:(NSString *)longitude andDataObject:(CLTimezoneData *)dataObject;
- (NSString *)formatStringShouldContainCity:(BOOL)value;
- (NSString *)getMenuTitle;

39
Clocker/Preferences/CLPreferencesView.xib

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9531"/>
</dependencies>
<objects>
@ -10,7 +9,7 @@
<outlet property="abbreviation" destination="V1c-xe-G2h" id="KPR-LT-bK2"/>
<outlet property="availableTimezoneTableView" destination="Q0t-hQ-orw" id="vQv-rd-Wkv"/>
<outlet property="messageLabel" destination="KFC-NV-5A3" id="NKB-JY-Udb"/>
<outlet property="placeholderLabel" destination="Wb6-yr-Pw4" id="ilx-y4-XEw"/>
<outlet property="placeholderLabel" destination="L5U-OI-Tkv" id="NhA-YA-x7S"/>
<outlet property="searchCriteria" destination="MiN-SF-nnU" id="Osf-q8-wwG"/>
<outlet property="searchField" destination="biT-6m-ElR" id="Di3-QU-LGY"/>
<outlet property="timezonePanel" destination="6FL-fp-Ke1" id="SDq-Q4-hMb"/>
@ -172,7 +171,7 @@ CA
<subviews>
<searchField toolTip="Search a timezone" wantsLayer="YES" focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="biT-6m-ElR">
<rect key="frame" x="8" y="288" width="329" height="24"/>
<searchFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" borderStyle="bezel" focusRingType="none" placeholderString="Enter a city, state, country name" drawsBackground="YES" usesSingleLineMode="YES" id="ijc-z6-99E">
<searchFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" borderStyle="bezel" focusRingType="none" placeholderString="Enter a city, state, country name" usesSingleLineMode="YES" maximumRecents="5" id="ijc-z6-99E">
<font key="font" size="13" name="SFUIDisplay-Light"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -192,19 +191,12 @@ CA
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Wb6-yr-Pw4">
<rect key="frame" x="11" y="118" width="321" height="20"/>
<progressIndicator wantsLayer="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="ifx-PO-gfq">
<rect key="frame" x="164" y="147" width="16" height="16"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="QQQ-at-c1H"/>
<constraint firstAttribute="width" constant="16" id="dUF-zC-zcm"/>
<constraint firstAttribute="height" constant="16" id="igc-Hk-413"/>
</constraints>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="center" title="Please enter a timezone name" placeholderString="Please enter a timezone name" id="l4k-Vi-z4I">
<font key="font" size="13" name="SFUIDisplay-Light"/>
<color key="textColor" red="0.0" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</textFieldCell>
</textField>
<progressIndicator wantsLayer="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="ifx-PO-gfq">
<rect key="frame" x="164" y="143" width="16" height="16"/>
<connections>
<binding destination="-2" name="hidden" keyPath="self.activityInProgress" id="9pA-XX-dhd">
<dictionary key="options">
@ -339,29 +331,40 @@ CA
<autoresizingMask key="autoresizingMask"/>
</tableHeaderView>
</scrollView>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="L5U-OI-Tkv">
<rect key="frame" x="20" y="117" width="305" height="22"/>
<constraints>
<constraint firstAttribute="height" constant="22" id="vJh-uH-1OY"/>
</constraints>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" state="on" alignment="center" placeholderString="" drawsBackground="YES" id="iFR-Vo-eLR">
<font key="font" size="13" name="SFUIDisplay-Light"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<constraints>
<constraint firstItem="KFC-NV-5A3" firstAttribute="leading" secondItem="cyZ-cL-S7a" secondAttribute="trailing" constant="4" id="1i8-FW-qYz"/>
<constraint firstItem="MiN-SF-nnU" firstAttribute="leading" secondItem="kXo-nl-oxR" secondAttribute="leading" constant="8" id="9Ha-gC-PU5"/>
<constraint firstAttribute="trailing" secondItem="KFC-NV-5A3" secondAttribute="trailing" constant="15" id="B6V-vn-THO"/>
<constraint firstItem="MiN-SF-nnU" firstAttribute="top" secondItem="biT-6m-ElR" secondAttribute="bottom" constant="8" id="Cjb-kq-geP"/>
<constraint firstItem="Wb6-yr-Pw4" firstAttribute="leading" secondItem="kXo-nl-oxR" secondAttribute="leading" constant="13" id="Ezn-kD-zu1"/>
<constraint firstAttribute="bottom" secondItem="KFC-NV-5A3" secondAttribute="bottom" constant="4" id="FWx-F1-VK8"/>
<constraint firstItem="hp6-CH-WJs" firstAttribute="top" secondItem="LM9-75-vkc" secondAttribute="bottom" constant="5" id="Kpp-JH-4vn"/>
<constraint firstItem="hp6-CH-WJs" firstAttribute="leading" secondItem="kXo-nl-oxR" secondAttribute="leading" constant="8" id="Oir-hL-Og8"/>
<constraint firstItem="Wb6-yr-Pw4" firstAttribute="top" secondItem="ifx-PO-gfq" secondAttribute="bottom" constant="5" id="Pha-iy-RTE"/>
<constraint firstItem="ifx-PO-gfq" firstAttribute="centerX" secondItem="Q0t-hQ-orw" secondAttribute="centerX" id="QOS-0E-N10"/>
<constraint firstAttribute="bottom" secondItem="cyZ-cL-S7a" secondAttribute="bottom" constant="5" id="QQ1-JS-knf"/>
<constraint firstAttribute="trailing" secondItem="Wb6-yr-Pw4" secondAttribute="trailing" constant="15" id="RgE-qx-qrq"/>
<constraint firstItem="biT-6m-ElR" firstAttribute="top" secondItem="kXo-nl-oxR" secondAttribute="top" constant="8" id="Y7N-oR-3KY"/>
<constraint firstItem="LM9-75-vkc" firstAttribute="leading" secondItem="kXo-nl-oxR" secondAttribute="leading" constant="8" id="ZJc-ws-AZR"/>
<constraint firstItem="L5U-OI-Tkv" firstAttribute="top" secondItem="ifx-PO-gfq" secondAttribute="bottom" constant="8" id="aVq-XP-Q1H"/>
<constraint firstAttribute="trailing" secondItem="biT-6m-ElR" secondAttribute="trailing" constant="8" id="bKu-IQ-cX1"/>
<constraint firstItem="L5U-OI-Tkv" firstAttribute="leading" secondItem="kXo-nl-oxR" secondAttribute="leading" constant="20" id="bcJ-73-Ybb"/>
<constraint firstItem="cyZ-cL-S7a" firstAttribute="leading" secondItem="hp6-CH-WJs" secondAttribute="trailing" constant="2" id="g8m-TW-fLo"/>
<constraint firstAttribute="bottom" secondItem="hp6-CH-WJs" secondAttribute="bottom" constant="5" id="hEn-h1-my5"/>
<constraint firstItem="biT-6m-ElR" firstAttribute="leading" secondItem="kXo-nl-oxR" secondAttribute="leading" constant="8" id="nhU-xR-AW2"/>
<constraint firstAttribute="trailing" secondItem="LM9-75-vkc" secondAttribute="trailing" constant="8" id="pMs-Ol-hsh"/>
<constraint firstAttribute="trailing" secondItem="L5U-OI-Tkv" secondAttribute="trailing" constant="20" id="pOb-1B-4Xh"/>
<constraint firstItem="LM9-75-vkc" firstAttribute="top" secondItem="MiN-SF-nnU" secondAttribute="bottom" constant="8" id="q84-IW-wwg"/>
<constraint firstItem="Wb6-yr-Pw4" firstAttribute="centerY" secondItem="Q0t-hQ-orw" secondAttribute="centerY" id="uio-eQ-cpc"/>
<constraint firstItem="L5U-OI-Tkv" firstAttribute="centerY" secondItem="Q0t-hQ-orw" secondAttribute="centerY" id="yiE-aC-oq3"/>
</constraints>
</view>
<point key="canvasLocation" x="582.5" y="681"/>

30
Clocker/Preferences/CLPreferencesViewController.m

@ -15,6 +15,7 @@
#import "CLTimezoneData.h"
#import <Parse/Parse.h>
#import "CLAPI.h"
//#import <Answers/Answers.h>
#import <ServiceManagement/ServiceManagement.h>
NSString *const CLSearchPredicateKey = @"SELF CONTAINS[cd]%@";
@ -186,7 +187,11 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
}
return [NSTimeZone timeZoneWithName:self.timeZoneArray[row]].abbreviation;
if (self.timeZoneArray.count > row)
{
return [NSTimeZone timeZoneWithName:self.timeZoneArray[row]].abbreviation;
}
}
@ -250,8 +255,6 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
self.searchCriteria.selectedSegment = 0;
self.timeZoneArray = [NSMutableArray new];
[self.view.window beginSheet:self.timezonePanel
completionHandler:nil];
}
@ -344,10 +347,10 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
[[NSUserDefaults standardUserDefaults] setObject:newArray forKey:CLDefaultPreferenceKey];
self.timeZoneArray = [NSMutableArray array];
self.timeZoneFilteredArray = [NSMutableArray array];
self.timeZoneArray = [NSMutableArray new];
[self.availableTimezoneTableView reloadData];
[self refereshTimezoneTableView];
@ -537,6 +540,8 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
[self refreshMainTableview];
[self.timezoneTableView deselectRow:self.timezoneTableView.selectedRow];
return YES;
}
@ -633,7 +638,12 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
}
- (void)getTimeZoneForLatitude:(NSString *)latitude andLongitude:(NSString *)longitude
{
{
if (self.placeholderLabel.isHidden)
{
self.placeholderLabel.hidden = NO;
}
if (![CLAPI isUserConnectedToInternet]) {
dispatch_async(dispatch_get_main_queue(), ^{
self.placeholderLabel.placeholderString = CLNoInternetConnectivityError;
@ -777,6 +787,9 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
- (IBAction)searchOptions:(id)sender
{
self.placeholderLabel.placeholderString = CLEmptyString;
self.placeholderLabel.hidden = YES;
if (self.searchCriteria.selectedSegment == 0)
{
self.searchField.placeholderString = @"Enter a city, state or country name";
@ -785,10 +798,10 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
}
else
{
self.timeZoneArray = [NSMutableArray arrayWithArray:[NSTimeZone knownTimeZoneNames]];
self.searchField.placeholderString = @"Enter a timezone name";
self.columnName = @"Timezone(s)";
self.abbreviation.hidden = NO;
self.timeZoneArray = [NSMutableArray arrayWithArray:[NSTimeZone knownTimeZoneNames]];
}
self.searchField.stringValue = CLEmptyString;
@ -800,8 +813,11 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
if(!(SMLoginItemSetEnabled((__bridge CFStringRef)@"com.abhishek.Clocker-Helper", (BOOL)[sender state])))
{
NSLog(@"Login item was not successful.");
}
}
@end

Loading…
Cancel
Save