Browse Source

Minor Changes

Localization
Abhishek Banthia 9 years ago
parent
commit
f55f01f4bc
  1. 7
      Clocker.xcodeproj/project.pbxproj
  2. BIN
      Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate
  3. 28
      Clocker/ApplicationDelegate.m
  4. 10
      Clocker/ColoredButton.m
  5. 15
      Clocker/PanelController.m
  6. 65
      Clocker/PreferencesWindow.xib
  7. 32
      Clocker/PreferencesWindowController.m
  8. 58
      Media.xcassets/AppIcon.appiconset/Contents.json
  9. 6
      Media.xcassets/Contents.json

7
Clocker.xcodeproj/project.pbxproj

@ -13,6 +13,7 @@
9A4379281BEC223900F4E27F /* Crashlytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A4379241BEC223900F4E27F /* Crashlytics.framework */; settings = {ASSET_TAGS = (); }; }; 9A4379281BEC223900F4E27F /* Crashlytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A4379241BEC223900F4E27F /* Crashlytics.framework */; settings = {ASSET_TAGS = (); }; };
9A43792A1BEC230A00F4E27F /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A4379291BEC230A00F4E27F /* libc++.tbd */; }; 9A43792A1BEC230A00F4E27F /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A4379291BEC230A00F4E27F /* libc++.tbd */; };
9A43792C1BEC231100F4E27F /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A43792B1BEC231100F4E27F /* libz.tbd */; }; 9A43792C1BEC231100F4E27F /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A43792B1BEC231100F4E27F /* libz.tbd */; };
9A43792E1BEC256200F4E27F /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9A43792D1BEC256200F4E27F /* Media.xcassets */; settings = {ASSET_TAGS = (); }; };
9A8605AE1BEC148400A810A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605AD1BEC148400A810A4 /* main.m */; }; 9A8605AE1BEC148400A810A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605AD1BEC148400A810A4 /* main.m */; };
9A8605B31BEC14A600A810A4 /* ColoredButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605B21BEC14A600A810A4 /* ColoredButton.m */; }; 9A8605B31BEC14A600A810A4 /* ColoredButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605B21BEC14A600A810A4 /* ColoredButton.m */; };
9A8605B61BEC14BE00A810A4 /* MenubarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605B41BEC14BE00A810A4 /* MenubarController.m */; }; 9A8605B61BEC14BE00A810A4 /* MenubarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605B41BEC14BE00A810A4 /* MenubarController.m */; };
@ -23,7 +24,6 @@
9A8605C01BEC14F600A810A4 /* Panel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605BD1BEC14F600A810A4 /* Panel.m */; }; 9A8605C01BEC14F600A810A4 /* Panel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605BD1BEC14F600A810A4 /* Panel.m */; };
9A8605C11BEC14F600A810A4 /* PreferencesWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605BE1BEC14F600A810A4 /* PreferencesWindowController.m */; }; 9A8605C11BEC14F600A810A4 /* PreferencesWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605BE1BEC14F600A810A4 /* PreferencesWindowController.m */; };
9A8605D41BEC155B00A810A4 /* Clock.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605C21BEC155B00A810A4 /* Clock.jpeg */; settings = {ASSET_TAGS = (); }; }; 9A8605D41BEC155B00A810A4 /* Clock.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605C21BEC155B00A810A4 /* Clock.jpeg */; settings = {ASSET_TAGS = (); }; };
9A8605D51BEC155B00A810A4 /* Clocker-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605C31BEC155B00A810A4 /* Clocker-Info.plist */; settings = {ASSET_TAGS = (); }; };
9A8605D61BEC155B00A810A4 /* Panel.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605CD1BEC155B00A810A4 /* Panel.xib */; settings = {ASSET_TAGS = (); }; }; 9A8605D61BEC155B00A810A4 /* Panel.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605CD1BEC155B00A810A4 /* Panel.xib */; settings = {ASSET_TAGS = (); }; };
9A8605D71BEC155B00A810A4 /* PreferencesWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605CE1BEC155B00A810A4 /* PreferencesWindow.xib */; settings = {ASSET_TAGS = (); }; }; 9A8605D71BEC155B00A810A4 /* PreferencesWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605CE1BEC155B00A810A4 /* PreferencesWindow.xib */; settings = {ASSET_TAGS = (); }; };
9A8605D81BEC155B00A810A4 /* PowerIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605CF1BEC155B00A810A4 /* PowerIcon.png */; settings = {ASSET_TAGS = (); }; }; 9A8605D81BEC155B00A810A4 /* PowerIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605CF1BEC155B00A810A4 /* PowerIcon.png */; settings = {ASSET_TAGS = (); }; };
@ -42,6 +42,7 @@
9A4379241BEC223900F4E27F /* Crashlytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Crashlytics.framework; sourceTree = "<group>"; }; 9A4379241BEC223900F4E27F /* Crashlytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Crashlytics.framework; sourceTree = "<group>"; };
9A4379291BEC230A00F4E27F /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; }; 9A4379291BEC230A00F4E27F /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
9A43792B1BEC231100F4E27F /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; 9A43792B1BEC231100F4E27F /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
9A43792D1BEC256200F4E27F /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = "<group>"; };
9A8605AD1BEC148400A810A4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Clocker/main.m; sourceTree = "<group>"; }; 9A8605AD1BEC148400A810A4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Clocker/main.m; sourceTree = "<group>"; };
9A8605B21BEC14A600A810A4 /* ColoredButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ColoredButton.m; path = Clocker/ColoredButton.m; sourceTree = "<group>"; }; 9A8605B21BEC14A600A810A4 /* ColoredButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ColoredButton.m; path = Clocker/ColoredButton.m; sourceTree = "<group>"; };
9A8605B41BEC14BE00A810A4 /* MenubarController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MenubarController.m; path = Clocker/MenubarController.m; sourceTree = "<group>"; }; 9A8605B41BEC14BE00A810A4 /* MenubarController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MenubarController.m; path = Clocker/MenubarController.m; sourceTree = "<group>"; };
@ -168,6 +169,7 @@
DD4F7BF913C30F9F00825C6E = { DD4F7BF913C30F9F00825C6E = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
9A43792D1BEC256200F4E27F /* Media.xcassets */,
9A8605E01BEC15F400A810A4 /* XIB */, 9A8605E01BEC15F400A810A4 /* XIB */,
9A8605E11BEC160700A810A4 /* Images */, 9A8605E11BEC160700A810A4 /* Images */,
9A8605E41BEC164C00A810A4 /* Main */, 9A8605E41BEC164C00A810A4 /* Main */,
@ -255,11 +257,11 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
9A8605D51BEC155B00A810A4 /* Clocker-Info.plist in Resources */,
9A8605D71BEC155B00A810A4 /* PreferencesWindow.xib in Resources */, 9A8605D71BEC155B00A810A4 /* PreferencesWindow.xib in Resources */,
9A8605DF1BEC15C400A810A4 /* MainMenu.xib in Resources */, 9A8605DF1BEC15C400A810A4 /* MainMenu.xib in Resources */,
9A8605D91BEC155B00A810A4 /* Status.png in Resources */, 9A8605D91BEC155B00A810A4 /* Status.png in Resources */,
9A8605D61BEC155B00A810A4 /* Panel.xib in Resources */, 9A8605D61BEC155B00A810A4 /* Panel.xib in Resources */,
9A43792E1BEC256200F4E27F /* Media.xcassets in Resources */,
9A8605D41BEC155B00A810A4 /* Clock.jpeg in Resources */, 9A8605D41BEC155B00A810A4 /* Clock.jpeg in Resources */,
9A8605DC1BEC155B00A810A4 /* StatusHighlighted@2x.png in Resources */, 9A8605DC1BEC155B00A810A4 /* StatusHighlighted@2x.png in Resources */,
9A8605DA1BEC155B00A810A4 /* Status@2x.png in Resources */, 9A8605DA1BEC155B00A810A4 /* Status@2x.png in Resources */,
@ -390,6 +392,7 @@
buildSettings = { buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES; COMBINE_HIDPI_IMAGES = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)", "$(PROJECT_DIR)",

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

Binary file not shown.

28
Clocker/ApplicationDelegate.m

@ -59,6 +59,34 @@ void *kContextActivePanel = &kContextActivePanel;
- (void)applicationDidFinishLaunching:(NSNotification *)notification - (void)applicationDidFinishLaunching:(NSNotification *)notification
{ {
if ([[NSUserDefaults standardUserDefaults] objectForKey:@"noOfLaunches"] == nil)
{
NSNumber *numberOfLaunches = @1;
[[NSUserDefaults standardUserDefaults] setObject:numberOfLaunches forKey:@"noOfLaunches"];
}
else
{
//Check the number of times app has been launched.
NSNumber *numberOfLaunches = [[NSUserDefaults standardUserDefaults] objectForKey:@"noOfLaunches"];
NSInteger launches = numberOfLaunches.integerValue;
launches++;
numberOfLaunches = [NSNumber numberWithInteger:launches];
[[NSUserDefaults standardUserDefaults] setObject:numberOfLaunches forKey:@"noOfLaunches"];
if (numberOfLaunches.integerValue == 5)
{
NSAlert *reviewAlert = [[NSAlert alloc] init];
reviewAlert.alertStyle = NSInformationalAlertStyle;
reviewAlert.messageText = @"Spead the word, maybe?";
reviewAlert.informativeText = @"Clocker is completely open source. If it has helped you in any way, please leave a kind review on the App Store!";
[reviewAlert addButtonWithTitle:@"Cancel"];
[reviewAlert runModal];
}
}
// Install icon into the menu bar // Install icon into the menu bar
self.menubarController = [[MenubarController alloc] init]; self.menubarController = [[MenubarController alloc] init];

10
Clocker/ColoredButton.m

@ -36,14 +36,13 @@
- (void)setButtonTitleFor:(NSButton*)button toString:(NSString*)title withColor:(NSColor*)color - (void)setButtonTitleFor:(NSButton*)button toString:(NSString*)title withColor:(NSColor*)color
{ {
NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
[style setAlignment:NSLeftTextAlignment]; NSFont *font = [NSFont fontWithName:@"HelveticaNeue-Light" size:12.0];
NSFont *font = [NSFont fontWithName:@"HelveticaNeue-Light" size:13.0]; NSDictionary *attrsDictionary = [NSDictionary dictionaryWithObjectsAndKeys:color, NSForegroundColorAttributeName, font,NSFontAttributeName, nil];
NSDictionary *attrsDictionary = [NSDictionary dictionaryWithObjectsAndKeys:color, NSForegroundColorAttributeName, style, NSParagraphStyleAttributeName, font,NSFontAttributeName, nil];
NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc]initWithString:title attributes:attrsDictionary]; NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc]initWithString:title attributes:attrsDictionary];
[attrString setAlignment:NSTextAlignmentLeft range:NSMakeRange(0, self.title.length)];
[button setAttributedTitle:attrString]; [button setAttributedTitle:attrString];
@ -53,6 +52,7 @@
{ {
NSString *title = self.title; NSString *title = self.title;
NSColor *color = [NSColor blackColor]; NSColor *color = [NSColor blackColor];
self.imagePosition = NSImageLeft;
[self setButtonTitleFor:self toString:title withColor:color]; [self setButtonTitleFor:self toString:title withColor:color];
} }

15
Clocker/PanelController.m

@ -98,13 +98,7 @@
} }
if (self.defaultPreferences.count <= 10) { self.scrollViewHeight.constant = self.defaultPreferences.count*55 + 30;
self.scrollViewHeight.constant = self.window.contentView.frame.size.height;
}
else
{
self.scrollViewHeight.constant = 550;
}
} }
#pragma mark - Public accessors #pragma mark - Public accessors
@ -204,14 +198,7 @@
NSRect panelRect = [panel frame]; NSRect panelRect = [panel frame];
panelRect.size.width = PANEL_WIDTH; panelRect.size.width = PANEL_WIDTH;
if (self.defaultPreferences.count <= 10)
{
panelRect.size.height = self.defaultPreferences.count*55 + 30; panelRect.size.height = self.defaultPreferences.count*55 + 30;
}
else
{
panelRect.size.height = 500;
}
panelRect.origin.x = roundf(NSMidX(statusRect) - NSWidth(panelRect) / 2); panelRect.origin.x = roundf(NSMidX(statusRect) - NSWidth(panelRect) / 2);
panelRect.origin.y = NSMaxY(statusRect) - NSHeight(panelRect); panelRect.origin.y = NSMaxY(statusRect) - NSHeight(panelRect);

65
Clocker/PreferencesWindow.xib

@ -9,6 +9,8 @@
<outlet property="availableTimezoneTableView" destination="6Hm-XH-CMI" id="GA1-tc-E9E"/> <outlet property="availableTimezoneTableView" destination="6Hm-XH-CMI" id="GA1-tc-E9E"/>
<outlet property="is24HourFormatSelected" destination="N47-gw-Pay" id="2MV-F1-uYf"/> <outlet property="is24HourFormatSelected" destination="N47-gw-Pay" id="2MV-F1-uYf"/>
<outlet property="messageLabel" destination="Rty-6T-aPw" id="Qg4-mk-P90"/> <outlet property="messageLabel" destination="Rty-6T-aPw" id="Qg4-mk-P90"/>
<outlet property="openSourceMessage" destination="cso-OX-qzB" id="yJg-DI-SX9"/>
<outlet property="reportBug" destination="psn-eC-m9g" id="zeL-Kw-pBY"/>
<outlet property="searchField" destination="5jL-eb-qdB" id="K6C-JS-ko0"/> <outlet property="searchField" destination="5jL-eb-qdB" id="K6C-JS-ko0"/>
<outlet property="timezonePanel" destination="Z6I-Ny-aGx" id="tXP-KH-Xfi"/> <outlet property="timezonePanel" destination="Z6I-Ny-aGx" id="tXP-KH-Xfi"/>
<outlet property="timezoneTableView" destination="oKD-AN-gPT" id="oD2-n0-4jf"/> <outlet property="timezoneTableView" destination="oKD-AN-gPT" id="oD2-n0-4jf"/>
@ -20,15 +22,15 @@
<window identifier="Selected Timezones" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" animationBehavior="documentWindow" id="F0z-JX-Cv5"> <window identifier="Selected Timezones" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" animationBehavior="documentWindow" id="F0z-JX-Cv5">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/> <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/> <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="407" y="179" width="439" height="392"/> <rect key="contentRect" x="407" y="179" width="439" height="426"/>
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="777"/> <rect key="screenRect" x="0.0" y="0.0" width="1280" height="777"/>
<value key="minSize" type="size" width="439" height="351"/> <value key="minSize" type="size" width="439" height="351"/>
<view key="contentView" id="se5-gp-TjO"> <view key="contentView" id="se5-gp-TjO">
<rect key="frame" x="0.0" y="0.0" width="439" height="392"/> <rect key="frame" x="0.0" y="0.0" width="439" height="426"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="DCz-qN-ydK"> <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="DCz-qN-ydK">
<rect key="frame" x="11" y="107" width="21" height="22"/> <rect key="frame" x="11" y="146" width="21" height="22"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="20" id="aUK-f8-pvY"/> <constraint firstAttribute="height" constant="20" id="aUK-f8-pvY"/>
<constraint firstAttribute="width" constant="21" id="hAr-3f-KNJ"/> <constraint firstAttribute="width" constant="21" id="hAr-3f-KNJ"/>
@ -43,7 +45,7 @@
</connections> </connections>
</button> </button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ixe-Sn-8qT"> <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ixe-Sn-8qT">
<rect key="frame" x="32" y="107" width="21" height="22"/> <rect key="frame" x="32" y="146" width="21" height="22"/>
<animations/> <animations/>
<buttonCell key="cell" type="smallSquare" bezelStyle="smallSquare" image="NSRemoveTemplate" imagePosition="overlaps" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="SVO-Wt-Mfb"> <buttonCell key="cell" type="smallSquare" bezelStyle="smallSquare" image="NSRemoveTemplate" imagePosition="overlaps" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="SVO-Wt-Mfb">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@ -54,13 +56,13 @@
</connections> </connections>
</button> </button>
<scrollView focusRingType="none" autohidesScrollers="YES" horizontalLineScroll="22" horizontalPageScroll="10" verticalLineScroll="22" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cI0-M7-C9h"> <scrollView focusRingType="none" autohidesScrollers="YES" horizontalLineScroll="22" horizontalPageScroll="10" verticalLineScroll="22" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cI0-M7-C9h">
<rect key="frame" x="10" y="134" width="419" height="250"/> <rect key="frame" x="10" y="173" width="419" height="245"/>
<clipView key="contentView" id="WWk-6i-nI7"> <clipView key="contentView" id="WWk-6i-nI7">
<rect key="frame" x="1" y="0.0" width="417" height="249"/> <rect key="frame" x="1" y="0.0" width="417" height="244"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnSelection="YES" autosaveColumns="NO" rowHeight="20" headerView="dKI-Ue-9QX" id="oKD-AN-gPT"> <tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnSelection="YES" autosaveColumns="NO" rowHeight="20" headerView="dKI-Ue-9QX" id="oKD-AN-gPT">
<rect key="frame" x="0.0" y="0.0" width="417" height="226"/> <rect key="frame" x="0.0" y="0.0" width="417" height="221"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<animations/> <animations/>
<size key="intercellSpacing" width="3" height="2"/> <size key="intercellSpacing" width="3" height="2"/>
@ -108,11 +110,11 @@
</tableHeaderView> </tableHeaderView>
</scrollView> </scrollView>
<button translatesAutoresizingMaskIntoConstraints="NO" id="P0l-kc-VxU" customClass="ColoredButton"> <button translatesAutoresizingMaskIntoConstraints="NO" id="P0l-kc-VxU" customClass="ColoredButton">
<rect key="frame" x="9" y="58" width="219" height="18"/> <rect key="frame" x="9" y="97" width="191" height="18"/>
<animations/> <animations/>
<buttonCell key="cell" type="check" title="Show only city/region name" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="jaB-eA-S6N"> <buttonCell key="cell" type="check" title="Show only City/Region name" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="jaB-eA-S6N">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" size="14" name="Helvetica-Light"/> <font key="font" size="12" name="Helvetica-Light"/>
</buttonCell> </buttonCell>
<connections> <connections>
<action selector="showOnlyCityName:" target="-2" id="1lf-cZ-gyt"/> <action selector="showOnlyCityName:" target="-2" id="1lf-cZ-gyt"/>
@ -120,18 +122,18 @@
</connections> </connections>
</button> </button>
<button translatesAutoresizingMaskIntoConstraints="NO" id="GDz-2Z-uX5" customClass="ColoredButton"> <button translatesAutoresizingMaskIntoConstraints="NO" id="GDz-2Z-uX5" customClass="ColoredButton">
<rect key="frame" x="9" y="39" width="219" height="18"/> <rect key="frame" x="9" y="75" width="191" height="18"/>
<animations/> <animations/>
<buttonCell key="cell" type="check" title="Start Clocker on system startup" bezelStyle="regularSquare" imagePosition="left" inset="2" id="h45-jZ-cPY"> <buttonCell key="cell" type="check" title="Start Clocker on system startup" bezelStyle="regularSquare" imagePosition="left" inset="2" id="h45-jZ-cPY">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" size="14" name="Helvetica-Light"/> <font key="font" size="12" name="Helvetica-Light"/>
</buttonCell> </buttonCell>
<connections> <connections>
<binding destination="-2" name="value" keyPath="self.launchOnLogin" id="Vqw-iQ-qOe"/> <binding destination="-2" name="value" keyPath="self.launchOnLogin" id="Vqw-iQ-qOe"/>
</connections> </connections>
</button> </button>
<button translatesAutoresizingMaskIntoConstraints="NO" id="N47-gw-Pay" customClass="ColoredButton"> <button translatesAutoresizingMaskIntoConstraints="NO" id="N47-gw-Pay" customClass="ColoredButton">
<rect key="frame" x="9" y="77" width="343" height="22"/> <rect key="frame" x="9" y="119" width="343" height="22"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="339" id="0eX-T7-EbU"/> <constraint firstAttribute="width" constant="339" id="0eX-T7-EbU"/>
<constraint firstAttribute="height" constant="18" id="qwS-Bk-vmy"/> <constraint firstAttribute="height" constant="18" id="qwS-Bk-vmy"/>
@ -139,52 +141,69 @@
<animations/> <animations/>
<buttonCell key="cell" type="check" title="Use a 24-hour clock" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="Fro-eC-cMC"> <buttonCell key="cell" type="check" title="Use a 24-hour clock" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="Fro-eC-cMC">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" size="14" name="Helvetica-Light"/> <font key="font" size="12" name="Helvetica-Light"/>
</buttonCell> </buttonCell>
<connections> <connections>
<action selector="timeFormatSelectionChanged:" target="-2" id="6vB-XV-sSq"/> <action selector="timeFormatSelectionChanged:" target="-2" id="6vB-XV-sSq"/>
<binding destination="sEG-Zb-KUM" name="value" keyPath="values.is24HourFormatSelected" id="wod-mK-9M5"/> <binding destination="sEG-Zb-KUM" name="value" keyPath="values.is24HourFormatSelected" id="wod-mK-9M5"/>
</connections> </connections>
</button> </button>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cso-OX-qzB"> <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cso-OX-qzB">
<rect key="frame" x="8" y="13" width="413" height="20"/> <rect key="frame" x="8" y="49" width="413" height="20"/>
<animations/> <animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" title="Clocker v1.0 is open source. Find the source code here." placeholderString="" id="l7j-wK-zcu"> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" state="on" focusRingType="none" placeholderString="Open Source Message" id="l7j-wK-zcu">
<font key="font" size="13" name="HelveticaNeue-Thin"/> <font key="font" size="13" name="HelveticaNeue-Thin"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell> </textFieldCell>
</textField> </textField>
<button toolTip="Say Hello!" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="psn-eC-m9g">
<rect key="frame" x="2" y="13" width="97" height="32"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="Url-R6-qPD"/>
<constraint firstAttribute="width" constant="85" id="Zyt-kT-9nT"/>
</constraints>
<animations/>
<buttonCell key="cell" type="push" title="Report Bug!" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="ZVb-7Q-E7k">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="supportAction:" target="-2" id="nlJ-e3-fCy"/>
</connections>
</button>
</subviews> </subviews>
<constraints> <constraints>
<constraint firstItem="psn-eC-m9g" firstAttribute="top" secondItem="cso-OX-qzB" secondAttribute="bottom" constant="8" id="1ah-5W-DP0"/>
<constraint firstItem="DCz-qN-ydK" firstAttribute="top" secondItem="cI0-M7-C9h" secondAttribute="bottom" constant="6" id="6Ye-VD-kSE"/> <constraint firstItem="DCz-qN-ydK" firstAttribute="top" secondItem="cI0-M7-C9h" secondAttribute="bottom" constant="6" id="6Ye-VD-kSE"/>
<constraint firstItem="cso-OX-qzB" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="10" id="Bux-4T-BB9"/> <constraint firstItem="cso-OX-qzB" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="10" id="Bux-4T-BB9"/>
<constraint firstItem="P0l-kc-VxU" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="11" id="DUR-uK-Ncx"/> <constraint firstItem="P0l-kc-VxU" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="11" id="DUR-uK-Ncx"/>
<constraint firstAttribute="bottom" secondItem="cso-OX-qzB" secondAttribute="bottom" constant="13" id="EdL-0P-Jrg"/>
<constraint firstItem="GDz-2Z-uX5" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="11" id="FLl-Pc-Gzn"/> <constraint firstItem="GDz-2Z-uX5" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="11" id="FLl-Pc-Gzn"/>
<constraint firstItem="cI0-M7-C9h" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="10" id="Fy5-6V-gu1"/> <constraint firstItem="cI0-M7-C9h" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="10" id="Fy5-6V-gu1"/>
<constraint firstItem="GDz-2Z-uX5" firstAttribute="top" secondItem="P0l-kc-VxU" secondAttribute="bottom" constant="5" id="NW3-cd-t0e"/> <constraint firstAttribute="bottom" secondItem="psn-eC-m9g" secondAttribute="bottom" constant="20" id="N2a-39-Xp7"/>
<constraint firstItem="GDz-2Z-uX5" firstAttribute="top" secondItem="P0l-kc-VxU" secondAttribute="bottom" constant="8" id="NW3-cd-t0e"/>
<constraint firstAttribute="trailing" secondItem="cso-OX-qzB" secondAttribute="trailing" constant="20" id="Q4B-CE-JrO"/> <constraint firstAttribute="trailing" secondItem="cso-OX-qzB" secondAttribute="trailing" constant="20" id="Q4B-CE-JrO"/>
<constraint firstItem="ixe-Sn-8qT" firstAttribute="leading" secondItem="DCz-qN-ydK" secondAttribute="trailing" id="TLA-Fw-F7P"/> <constraint firstItem="ixe-Sn-8qT" firstAttribute="leading" secondItem="DCz-qN-ydK" secondAttribute="trailing" id="TLA-Fw-F7P"/>
<constraint firstItem="P0l-kc-VxU" firstAttribute="top" secondItem="N47-gw-Pay" secondAttribute="bottom" constant="5" id="Tfe-Y8-KcS"/> <constraint firstItem="P0l-kc-VxU" firstAttribute="top" secondItem="N47-gw-Pay" secondAttribute="bottom" constant="8" id="Tfe-Y8-KcS"/>
<constraint firstItem="GDz-2Z-uX5" firstAttribute="width" secondItem="P0l-kc-VxU" secondAttribute="width" id="VUD-7V-5SX"/> <constraint firstItem="GDz-2Z-uX5" firstAttribute="width" secondItem="P0l-kc-VxU" secondAttribute="width" id="VUD-7V-5SX"/>
<constraint firstItem="DCz-qN-ydK" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="11" id="Waz-CP-UWF"/> <constraint firstItem="DCz-qN-ydK" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="11" id="Waz-CP-UWF"/>
<constraint firstItem="GDz-2Z-uX5" firstAttribute="height" secondItem="P0l-kc-VxU" secondAttribute="height" id="c2z-Ik-d6W"/> <constraint firstItem="GDz-2Z-uX5" firstAttribute="height" secondItem="P0l-kc-VxU" secondAttribute="height" id="c2z-Ik-d6W"/>
<constraint firstItem="N47-gw-Pay" firstAttribute="top" secondItem="ixe-Sn-8qT" secondAttribute="bottom" constant="11" id="gbd-HA-u9p"/> <constraint firstItem="N47-gw-Pay" firstAttribute="top" secondItem="ixe-Sn-8qT" secondAttribute="bottom" constant="8" id="gbd-HA-u9p"/>
<constraint firstItem="N47-gw-Pay" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="11" id="hXb-69-tI0"/> <constraint firstItem="N47-gw-Pay" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="11" id="hXb-69-tI0"/>
<constraint firstItem="ixe-Sn-8qT" firstAttribute="width" secondItem="DCz-qN-ydK" secondAttribute="width" id="o7k-jf-cL0"/> <constraint firstItem="ixe-Sn-8qT" firstAttribute="width" secondItem="DCz-qN-ydK" secondAttribute="width" id="o7k-jf-cL0"/>
<constraint firstItem="cso-OX-qzB" firstAttribute="top" secondItem="GDz-2Z-uX5" secondAttribute="bottom" constant="8" id="qZY-wv-3kN"/> <constraint firstItem="cso-OX-qzB" firstAttribute="top" secondItem="GDz-2Z-uX5" secondAttribute="bottom" constant="8" id="qZY-wv-3kN"/>
<constraint firstItem="ixe-Sn-8qT" firstAttribute="height" secondItem="DCz-qN-ydK" secondAttribute="height" id="rsK-UP-Umg"/> <constraint firstItem="ixe-Sn-8qT" firstAttribute="height" secondItem="DCz-qN-ydK" secondAttribute="height" id="rsK-UP-Umg"/>
<constraint firstItem="cI0-M7-C9h" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" constant="8" id="u5H-Ff-ivt"/> <constraint firstItem="cI0-M7-C9h" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" constant="8" id="u5H-Ff-ivt"/>
<constraint firstAttribute="trailing" secondItem="cI0-M7-C9h" secondAttribute="trailing" constant="10" id="ut9-6b-cdu"/> <constraint firstAttribute="trailing" secondItem="cI0-M7-C9h" secondAttribute="trailing" constant="10" id="ut9-6b-cdu"/>
<constraint firstItem="N47-gw-Pay" firstAttribute="top" secondItem="DCz-qN-ydK" secondAttribute="bottom" constant="11" id="x0C-Ev-Imb"/> <constraint firstItem="N47-gw-Pay" firstAttribute="top" secondItem="DCz-qN-ydK" secondAttribute="bottom" constant="8" id="x0C-Ev-Imb"/>
<constraint firstItem="psn-eC-m9g" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="8" id="xEn-ec-WQn"/>
</constraints> </constraints>
<animations/> <animations/>
</view> </view>
<connections> <connections>
<outlet property="delegate" destination="-2" id="0bl-1N-AYu"/> <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
</connections> </connections>
<point key="canvasLocation" x="304.5" y="240"/> <point key="canvasLocation" x="304.5" y="257"/>
</window> </window>
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hasShadow="NO" hidesOnDeactivate="YES" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="alertPanel" appearanceType="aqua" frameAutosaveName="" id="Z6I-Ny-aGx" customClass="Panel"> <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hasShadow="NO" hidesOnDeactivate="YES" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="alertPanel" appearanceType="aqua" frameAutosaveName="" id="Z6I-Ny-aGx" customClass="Panel">
<windowStyleMask key="styleMask" closable="YES" miniaturizable="YES" resizable="YES" documentModal="YES" nonactivatingPanel="YES" texturedBackground="YES"/> <windowStyleMask key="styleMask" closable="YES" miniaturizable="YES" resizable="YES" documentModal="YES" nonactivatingPanel="YES" texturedBackground="YES"/>

32
Clocker/PreferencesWindowController.m

@ -45,6 +45,8 @@
@property (weak) IBOutlet NSButton *is24HourFormatSelected; @property (weak) IBOutlet NSButton *is24HourFormatSelected;
@property (weak) IBOutlet NSTextField *messageLabel; @property (weak) IBOutlet NSTextField *messageLabel;
@property (weak) IBOutlet NSTextField *openSourceMessage;
@property (weak) IBOutlet NSButton *reportBug;
@end @end
@ -55,6 +57,17 @@ static PreferencesWindowController *sharedPreferences = nil;
- (void)windowDidLoad { - (void)windowDidLoad {
[super windowDidLoad]; [super windowDidLoad];
[self.openSourceMessage setAllowsEditingTextAttributes: YES];
[self.openSourceMessage setSelectable:YES];
NSString *credits = @"Clocker v1.0 is open source. You can find the source code <a href=\"https://github.com/Abhishaker17/Clocker\">here!</a>";
[self.openSourceMessage setAttributedStringValue:[self stringFromHTML:credits withFont:[self.openSourceMessage font]]];
NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc]initWithString:@"Report Bug!x"];
[attrString addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInt:NSUnderlineStyleSingle] range:NSMakeRange(0, attrString.length)];
[attrString addAttribute:NSForegroundColorAttributeName value:[NSColor blueColor] range:NSMakeRange(0, self.reportBug.title.length)];
[self.reportBug setAttributedStringValue:attrString];
NSMutableArray *defaultTimeZones = [[NSUserDefaults standardUserDefaults] objectForKey:@"defaultPreferences"]; NSMutableArray *defaultTimeZones = [[NSUserDefaults standardUserDefaults] objectForKey:@"defaultPreferences"];
if (!self.timeZoneArray || !self.selectedTimeZones) if (!self.timeZoneArray || !self.selectedTimeZones)
@ -77,6 +90,14 @@ static PreferencesWindowController *sharedPreferences = nil;
// Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
} }
-(NSAttributedString *)stringFromHTML:(NSString *)html withFont:(NSFont *)font
{
html = [NSString stringWithFormat:@"<span style=\"font-family:'%@'; font-size:%dpx;\">%@</span>", [font fontName], (int)[font pointSize], html];
NSData *data = [html dataUsingEncoding:NSUTF8StringEncoding];
NSAttributedString* string = [[NSAttributedString alloc] initWithHTML:data documentAttributes:nil];
return string;
}
-(id)copyWithZone:(NSZone *)zone -(id)copyWithZone:(NSZone *)zone
{ {
id copy = [[[self class] alloc] initWithWindowNibName:@"PreferencesWindow"]; id copy = [[[self class] alloc] initWithWindowNibName:@"PreferencesWindow"];
@ -409,4 +430,15 @@ static PreferencesWindowController *sharedPreferences = nil;
} }
} }
- (IBAction)supportAction:(id)sender
{
NSAppleScript *mailScript;
NSString *scriptString= @"tell application \"Mail\"\nset theAddress to \"abhishekbanthia@me.com\"\n set msg to make new outgoing message with properties {visible:true, subject:\"Regarding Clocker - We need to talk!\"}\ntell msg to make new to recipient at end of every to recipient with properties {address:theAddress}\n activate\nend tell";
mailScript = [[NSAppleScript alloc] initWithSource:scriptString];
NSDictionary *dict = nil;
[mailScript executeAndReturnError:&dict];
}
@end @end

58
Media.xcassets/AppIcon.appiconset/Contents.json

@ -0,0 +1,58 @@
{
"images" : [
{
"idiom" : "mac",
"size" : "16x16",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "16x16",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "32x32",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "32x32",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "128x128",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "128x128",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "256x256",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "256x256",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

6
Media.xcassets/Contents.json

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading…
Cancel
Save