Browse Source

New Customization Option.

v1.2.1
Abhishek Banthia 9 years ago
parent
commit
9ffd107a92
  1. BIN
      Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate
  2. 3
      Clocker/App Feedback/CLAppFeedbackWindowController.m
  3. 60
      Clocker/Appearance Tab/CLAppearanceView.xib
  4. 5
      Clocker/ApplicationDelegate.m
  5. 21
      Clocker/PanelController.m
  6. 1
      Clocker/Utilities/CommonStrings.h
  7. 1
      Clocker/Utilities/CommonStrings.m

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

Binary file not shown.

3
Clocker/App Feedback/CLAppFeedbackWindowController.m

@ -134,7 +134,8 @@ static CLAppFeedbackWindowController *sharedFeedbackWindow = nil;
self.emailField.stringValue = CLEmptyString; self.emailField.stringValue = CLEmptyString;
self.feedbackTextView.string = CLEmptyString; self.feedbackTextView.string = CLEmptyString;
self.activityInProgress = NO; self.activityInProgress = NO;
for (NSWindow *window in [NSApplication sharedApplication].windows) { for (NSWindow *window in [NSApplication sharedApplication].windows)
{
if ([window.windowController isMemberOfClass:[CLOneWindowController class]]) { if ([window.windowController isMemberOfClass:[CLOneWindowController class]]) {
[window makeKeyAndOrderFront:self]; [window makeKeyAndOrderFront:self];
[NSApp activateIgnoringOtherApps:YES]; [NSApp activateIgnoringOtherApps:YES];

60
Clocker/Appearance Tab/CLAppearanceView.xib

@ -18,7 +18,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews> <subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="iVw-cq-zLz"> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="iVw-cq-zLz">
<rect key="frame" x="200" y="246" width="40" height="18"/> <rect key="frame" x="200" y="235" width="40" height="18"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Theme" id="hCb-NM-To8"> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Theme" id="hCb-NM-To8">
<font key="font" size="12" name="SFUIDisplay-Light"/> <font key="font" size="12" name="SFUIDisplay-Light"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -34,7 +34,7 @@
</textFieldCell> </textFieldCell>
</textField> </textField>
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5tI-fU-0lZ"> <segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5tI-fU-0lZ">
<rect key="frame" x="158" y="219" width="124" height="24"/> <rect key="frame" x="158" y="204" width="124" height="24"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="120" id="dW5-vG-EwD"/> <constraint firstAttribute="width" constant="120" id="dW5-vG-EwD"/>
</constraints> </constraints>
@ -51,7 +51,7 @@
</connections> </connections>
</segmentedControl> </segmentedControl>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="YQi-x8-6f8"> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="YQi-x8-6f8">
<rect key="frame" x="178" y="195" width="84" height="18"/> <rect key="frame" x="178" y="173" width="84" height="18"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Display Options" id="KTv-74-itf"> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Display Options" id="KTv-74-itf">
<font key="font" size="12" name="SFUIDisplay-Light"/> <font key="font" size="12" name="SFUIDisplay-Light"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -59,7 +59,7 @@
</textFieldCell> </textFieldCell>
</textField> </textField>
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="1eh-BT-2fK"> <segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="1eh-BT-2fK">
<rect key="frame" x="101" y="168" width="240" height="24"/> <rect key="frame" x="101" y="142" width="240" height="24"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="236" id="uU1-9Q-cqa"/> <constraint firstAttribute="width" constant="236" id="uU1-9Q-cqa"/>
</constraints> </constraints>
@ -76,7 +76,7 @@
</connections> </connections>
</segmentedControl> </segmentedControl>
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="OrL-Ix-fmY"> <segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="OrL-Ix-fmY">
<rect key="frame" x="102" y="270" width="236" height="24"/> <rect key="frame" x="102" y="266" width="236" height="24"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="232" id="uOJ-Mi-Fin"/> <constraint firstAttribute="width" constant="232" id="uOJ-Mi-Fin"/>
</constraints> </constraints>
@ -93,7 +93,7 @@
</connections> </connections>
</segmentedControl> </segmentedControl>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="3d9-qg-dNb"> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="3d9-qg-dNb">
<rect key="frame" x="148" y="144" width="142" height="18"/> <rect key="frame" x="148" y="111" width="142" height="18"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Show Sunrise, Sunset Time" id="ZP5-1i-Bm8"> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Show Sunrise, Sunset Time" id="ZP5-1i-Bm8">
<font key="font" size="12" name="SFUIDisplay-Light"/> <font key="font" size="12" name="SFUIDisplay-Light"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -101,7 +101,7 @@
</textFieldCell> </textFieldCell>
</textField> </textField>
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="atA-2r-FXV"> <segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="atA-2r-FXV">
<rect key="frame" x="180" y="117" width="80" height="24"/> <rect key="frame" x="180" y="80" width="80" height="24"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="76" id="dEg-kt-bk1"/> <constraint firstAttribute="width" constant="76" id="dEg-kt-bk1"/>
<constraint firstAttribute="height" constant="21" id="ttW-aD-dh3"/> <constraint firstAttribute="height" constant="21" id="ttW-aD-dh3"/>
@ -117,24 +117,56 @@
<binding destination="WGI-5h-l6M" name="selectedIndex" keyPath="values.displaySuntime" id="rkd-Nx-YEh"/> <binding destination="WGI-5h-l6M" name="selectedIndex" keyPath="values.displaySuntime" id="rkd-Nx-YEh"/>
</connections> </connections>
</segmentedControl> </segmentedControl>
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="72r-oi-X0f">
<rect key="frame" x="184" y="18" width="71" height="24"/>
<constraints>
<constraint firstAttribute="width" constant="67" id="H8w-wg-vel"/>
</constraints>
<segmentedCell key="cell" borderStyle="border" alignment="left" style="rounded" trackingMode="selectOne" id="FMr-PO-czs">
<font key="font" size="12" name="SFUIDisplay-Light"/>
<segments>
<segment label="Yes" width="32"/>
<segment label="No" width="32" selected="YES" tag="1"/>
</segments>
</segmentedCell>
<connections>
<binding destination="WGI-5h-l6M" name="selectedIndex" keyPath="values.displayFutureSlider" id="zRQ-mQ-qBp"/>
</connections>
</segmentedControl>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="HTZ-1V-qZb">
<rect key="frame" x="168" y="49" width="103" height="18"/>
<constraints>
<constraint firstAttribute="width" constant="99" id="1Lv-wC-hEM"/>
<constraint firstAttribute="height" constant="18" id="tK6-lZ-2AV"/>
</constraints>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Show Future Slider" id="PE4-Ua-hkI">
<font key="font" size="12" name="SFUIDisplay-Light"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews> </subviews>
<constraints> <constraints>
<constraint firstItem="72r-oi-X0f" firstAttribute="top" secondItem="HTZ-1V-qZb" secondAttribute="bottom" constant="8" id="23z-Z7-vpe"/>
<constraint firstItem="YQi-x8-6f8" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="6LU-d8-lKX"/> <constraint firstItem="YQi-x8-6f8" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="6LU-d8-lKX"/>
<constraint firstAttribute="bottom" secondItem="72r-oi-X0f" secondAttribute="bottom" constant="20" id="9Bg-Cy-0Hw"/>
<constraint firstItem="3d9-qg-dNb" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="FBj-0N-ltc"/> <constraint firstItem="3d9-qg-dNb" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="FBj-0N-ltc"/>
<constraint firstItem="OrL-Ix-fmY" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="JtZ-ra-RaC"/> <constraint firstItem="OrL-Ix-fmY" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="JtZ-ra-RaC"/>
<constraint firstItem="1eh-BT-2fK" firstAttribute="top" secondItem="YQi-x8-6f8" secondAttribute="bottom" constant="4" id="POa-Gi-Prk"/> <constraint firstItem="1eh-BT-2fK" firstAttribute="top" secondItem="YQi-x8-6f8" secondAttribute="bottom" constant="8" id="POa-Gi-Prk"/>
<constraint firstItem="atA-2r-FXV" firstAttribute="top" secondItem="3d9-qg-dNb" secondAttribute="bottom" constant="4" id="PY9-Mh-Qsb"/> <constraint firstItem="atA-2r-FXV" firstAttribute="top" secondItem="3d9-qg-dNb" secondAttribute="bottom" constant="8" id="PY9-Mh-Qsb"/>
<constraint firstItem="atA-2r-FXV" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="Pjx-sg-kK0"/> <constraint firstItem="atA-2r-FXV" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="Pjx-sg-kK0"/>
<constraint firstItem="5tI-fU-0lZ" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="Vkb-QV-unN"/> <constraint firstItem="5tI-fU-0lZ" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="Vkb-QV-unN"/>
<constraint firstItem="YQi-x8-6f8" firstAttribute="top" secondItem="5tI-fU-0lZ" secondAttribute="bottom" constant="8" id="WoY-W4-XuS"/> <constraint firstItem="HTZ-1V-qZb" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="Wet-hO-O6U"/>
<constraint firstItem="iVw-cq-zLz" firstAttribute="top" secondItem="OrL-Ix-fmY" secondAttribute="bottom" constant="8" id="XgM-Wl-Xap"/> <constraint firstItem="YQi-x8-6f8" firstAttribute="top" secondItem="5tI-fU-0lZ" secondAttribute="bottom" constant="15" id="WoY-W4-XuS"/>
<constraint firstItem="iVw-cq-zLz" firstAttribute="top" secondItem="OrL-Ix-fmY" secondAttribute="bottom" constant="15" id="XgM-Wl-Xap"/>
<constraint firstItem="iVw-cq-zLz" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="Zh8-Vn-VxM"/> <constraint firstItem="iVw-cq-zLz" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="Zh8-Vn-VxM"/>
<constraint firstItem="5tI-fU-0lZ" firstAttribute="top" secondItem="iVw-cq-zLz" secondAttribute="bottom" constant="4" id="bo6-s2-Vfj"/> <constraint firstItem="5tI-fU-0lZ" firstAttribute="top" secondItem="iVw-cq-zLz" secondAttribute="bottom" constant="8" id="bo6-s2-Vfj"/>
<constraint firstItem="1eh-BT-2fK" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" constant="1.5" id="fvI-By-5Ef"/> <constraint firstItem="1eh-BT-2fK" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" constant="1.5" id="fvI-By-5Ef"/>
<constraint firstItem="3d9-qg-dNb" firstAttribute="top" secondItem="1eh-BT-2fK" secondAttribute="bottom" constant="8" id="iVY-Yj-mck"/> <constraint firstItem="3d9-qg-dNb" firstAttribute="top" secondItem="1eh-BT-2fK" secondAttribute="bottom" constant="15" id="iVY-Yj-mck"/>
<constraint firstItem="5TC-RQ-gzI" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="lc0-ud-Mnw"/> <constraint firstItem="5TC-RQ-gzI" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="lc0-ud-Mnw"/>
<constraint firstItem="5TC-RQ-gzI" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" id="oI8-4L-ppf"/> <constraint firstItem="5TC-RQ-gzI" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" id="oI8-4L-ppf"/>
<constraint firstItem="OrL-Ix-fmY" firstAttribute="top" secondItem="5TC-RQ-gzI" secondAttribute="bottom" constant="4" id="rpk-WN-DT9"/> <constraint firstItem="OrL-Ix-fmY" firstAttribute="top" secondItem="5TC-RQ-gzI" secondAttribute="bottom" constant="8" id="rpk-WN-DT9"/>
<constraint firstItem="72r-oi-X0f" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="wHU-od-8e8"/>
</constraints> </constraints>
<point key="canvasLocation" x="187" y="251"/> <point key="canvasLocation" x="187" y="251"/>
</customView> </customView>

5
Clocker/ApplicationDelegate.m

@ -104,6 +104,11 @@ void *kContextActivePanel = &kContextActivePanel;
[[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInteger:0] forKey:CLDisplaySunTimingKey]; [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInteger:0] forKey:CLDisplaySunTimingKey];
} }
NSNumber *displayFutureSlider = [[NSUserDefaults standardUserDefaults] objectForKey:CLDisplayFutureSliderKey];
if (displayFutureSlider == nil) {
[[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInteger:0] forKey:CLDisplayFutureSliderKey];
}
NSNumber *defaultTimeFormat = [[NSUserDefaults standardUserDefaults] objectForKey:CL24hourFormatSelectedKey]; NSNumber *defaultTimeFormat = [[NSUserDefaults standardUserDefaults] objectForKey:CL24hourFormatSelectedKey];
if (defaultTimeFormat == nil) { if (defaultTimeFormat == nil) {
[[NSUserDefaults standardUserDefaults] setObject:@1 forKey:CL24hourFormatSelectedKey]; [[NSUserDefaults standardUserDefaults] setObject:@1 forKey:CL24hourFormatSelectedKey];

21
Clocker/PanelController.m

@ -339,6 +339,18 @@ NSString *const CLTimezoneCellViewIdentifier = @"timeZoneCell";
cell.sunTime.stringValue = CLEmptyString; cell.sunTime.stringValue = CLEmptyString;
} }
NSNumber *displayFutureSlider = [[NSUserDefaults standardUserDefaults] objectForKey:CLDisplayFutureSliderKey];
if ([displayFutureSlider isEqualToNumber:[NSNumber numberWithInteger:0]])
{
self.futureSlider.hidden = NO;
self.sliderLabel.hidden = NO;
}
else
{
self.sliderLabel.hidden = YES;
self.futureSlider.hidden = YES;
}
[cell setUpAutoLayoutWithCell:cell]; [cell setUpAutoLayoutWithCell:cell];
return cell; return cell;
@ -611,14 +623,21 @@ NSString *const CLTimezoneCellViewIdentifier = @"timeZoneCell";
- (void)showOptions:(BOOL)value - (void)showOptions:(BOOL)value
{ {
if (!self.futureSlider.isHidden) {
self.sliderLabel.hidden = !value; self.sliderLabel.hidden = !value;
}
if (self.defaultPreferences.count == 0) if (self.defaultPreferences.count == 0)
{ {
value = YES; value = YES;
if (!self.futureSlider.isHidden)
{
self.sliderLabel.hidden = YES; self.sliderLabel.hidden = YES;
} }
}
self.shutdownButton.hidden = !value; self.shutdownButton.hidden = !value;
self.preferencesButton.hidden = !value; self.preferencesButton.hidden = !value;
@ -772,8 +791,10 @@ NSString *const CLTimezoneCellViewIdentifier = @"timeZoneCell";
NSMutableDictionary *newDictionary = [[NSMutableDictionary alloc] initWithDictionary:dictionary copyItems:YES]; NSMutableDictionary *newDictionary = [[NSMutableDictionary alloc] initWithDictionary:dictionary copyItems:YES];
if (json[@"sunrise"] && json[@"sunset"]) {
[newDictionary setObject:json[@"sunrise"] forKey:@"sunriseTime"]; [newDictionary setObject:json[@"sunrise"] forKey:@"sunriseTime"];
[newDictionary setObject:json[@"sunset"] forKey:@"sunsetTime"]; [newDictionary setObject:json[@"sunset"] forKey:@"sunsetTime"];
}
NSUInteger units = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay; NSUInteger units = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay;
NSDateComponents *comps = [[NSCalendar currentCalendar] components:units fromDate:newDictionary[@"nextUpdate"]]; NSDateComponents *comps = [[NSCalendar currentCalendar] components:units fromDate:newDictionary[@"nextUpdate"]];

1
Clocker/Utilities/CommonStrings.h

@ -22,5 +22,6 @@ extern NSString *const CLPlaceIdentifier;
extern NSString *const CLRelativeDateKey; extern NSString *const CLRelativeDateKey;
extern NSString *const CLThemeKey; extern NSString *const CLThemeKey;
extern NSString *const CLDisplaySunTimingKey; extern NSString *const CLDisplaySunTimingKey;
extern NSString *const CLDisplayFutureSliderKey;
@end @end

1
Clocker/Utilities/CommonStrings.m

@ -22,5 +22,6 @@ NSString *const CLCustomLabelChangedNotification = @"CLCustomLabelChangedNotific
NSString *const CLRelativeDateKey = @"relativeDate"; NSString *const CLRelativeDateKey = @"relativeDate";
NSString *const CLThemeKey = @"defaultTheme"; NSString *const CLThemeKey = @"defaultTheme";
NSString *const CLDisplaySunTimingKey = @"displaySuntime"; NSString *const CLDisplaySunTimingKey = @"displaySuntime";
NSString *const CLDisplayFutureSliderKey = @"displayFutureSlider";
@end @end

Loading…
Cancel
Save