diff --git a/Clocker.xcodeproj/project.pbxproj b/Clocker.xcodeproj/project.pbxproj index 9458434..06ef9ad 100755 --- a/Clocker.xcodeproj/project.pbxproj +++ b/Clocker.xcodeproj/project.pbxproj @@ -7,17 +7,17 @@ objects = { /* Begin PBXBuildFile section */ - 9A2000D11BFBD472002BFDE8 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9A2000CF1BFBD472002BFDE8 /* Localizable.strings */; settings = {ASSET_TAGS = (); }; }; - 9A25F7451C1A5E17007D369B /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9A25F7421C1A5E17007D369B /* Info.plist */; settings = {ASSET_TAGS = (); }; }; - 9A25F7461C1A5E17007D369B /* iRate.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 9A25F7431C1A5E17007D369B /* iRate.bundle */; settings = {ASSET_TAGS = (); }; }; - 9A25F7471C1A5E17007D369B /* iRate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A25F7441C1A5E17007D369B /* iRate.m */; settings = {ASSET_TAGS = (); }; }; - 9A4379251BEC223900F4E27F /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A4379211BEC223900F4E27F /* Security.framework */; settings = {ASSET_TAGS = (); }; }; - 9A4379261BEC223900F4E27F /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A4379221BEC223900F4E27F /* SystemConfiguration.framework */; settings = {ASSET_TAGS = (); }; }; - 9A4379271BEC223900F4E27F /* Fabric.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A4379231BEC223900F4E27F /* Fabric.framework */; settings = {ASSET_TAGS = (); }; }; - 9A4379281BEC223900F4E27F /* Crashlytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A4379241BEC223900F4E27F /* Crashlytics.framework */; settings = {ASSET_TAGS = (); }; }; + 9A2000D11BFBD472002BFDE8 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9A2000CF1BFBD472002BFDE8 /* Localizable.strings */; }; + 9A25F7451C1A5E17007D369B /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9A25F7421C1A5E17007D369B /* Info.plist */; }; + 9A25F7461C1A5E17007D369B /* iRate.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 9A25F7431C1A5E17007D369B /* iRate.bundle */; }; + 9A25F7471C1A5E17007D369B /* iRate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A25F7441C1A5E17007D369B /* iRate.m */; }; + 9A4379251BEC223900F4E27F /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A4379211BEC223900F4E27F /* Security.framework */; }; + 9A4379261BEC223900F4E27F /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A4379221BEC223900F4E27F /* SystemConfiguration.framework */; }; + 9A4379271BEC223900F4E27F /* Fabric.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A4379231BEC223900F4E27F /* Fabric.framework */; }; + 9A4379281BEC223900F4E27F /* Crashlytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A4379241BEC223900F4E27F /* Crashlytics.framework */; }; 9A43792A1BEC230A00F4E27F /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A4379291BEC230A00F4E27F /* libc++.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 = (); }; }; + 9A43792E1BEC256200F4E27F /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9A43792D1BEC256200F4E27F /* Media.xcassets */; }; 9A8605AE1BEC148400A810A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605AD1BEC148400A810A4 /* main.m */; }; 9A8605B31BEC14A600A810A4 /* ColoredButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605B21BEC14A600A810A4 /* ColoredButton.m */; }; 9A8605B61BEC14BE00A810A4 /* MenubarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605B41BEC14BE00A810A4 /* MenubarController.m */; }; @@ -27,15 +27,23 @@ 9A8605BF1BEC14F600A810A4 /* BackgroundView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605BC1BEC14F600A810A4 /* BackgroundView.m */; }; 9A8605C01BEC14F600A810A4 /* Panel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605BD1BEC14F600A810A4 /* Panel.m */; }; 9A8605C11BEC14F600A810A4 /* PreferencesWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605BE1BEC14F600A810A4 /* PreferencesWindowController.m */; }; - 9A8605D81BEC155B00A810A4 /* PowerIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605CF1BEC155B00A810A4 /* PowerIcon.png */; settings = {ASSET_TAGS = (); }; }; - 9A8605D91BEC155B00A810A4 /* Status.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605D01BEC155B00A810A4 /* Status.png */; settings = {ASSET_TAGS = (); }; }; - 9A8605DA1BEC155B00A810A4 /* Status@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605D11BEC155B00A810A4 /* Status@2x.png */; settings = {ASSET_TAGS = (); }; }; - 9A8605DB1BEC155B00A810A4 /* StatusHighlighted.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605D21BEC155B00A810A4 /* StatusHighlighted.png */; settings = {ASSET_TAGS = (); }; }; - 9A8605DC1BEC155B00A810A4 /* StatusHighlighted@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605D31BEC155B00A810A4 /* StatusHighlighted@2x.png */; settings = {ASSET_TAGS = (); }; }; - 9A8605DF1BEC15C400A810A4 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605DD1BEC15C400A810A4 /* MainMenu.xib */; settings = {ASSET_TAGS = (); }; }; + 9A8605D81BEC155B00A810A4 /* PowerIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605CF1BEC155B00A810A4 /* PowerIcon.png */; }; + 9A8605D91BEC155B00A810A4 /* Status.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605D01BEC155B00A810A4 /* Status.png */; }; + 9A8605DA1BEC155B00A810A4 /* Status@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605D11BEC155B00A810A4 /* Status@2x.png */; }; + 9A8605DB1BEC155B00A810A4 /* StatusHighlighted.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605D21BEC155B00A810A4 /* StatusHighlighted.png */; }; + 9A8605DC1BEC155B00A810A4 /* StatusHighlighted@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605D31BEC155B00A810A4 /* StatusHighlighted@2x.png */; }; + 9A8605DF1BEC15C400A810A4 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9A8605DD1BEC15C400A810A4 /* MainMenu.xib */; }; + 9AB935781C1AD79D001285A0 /* ClockerIcon-16.png in Resources */ = {isa = PBXBuildFile; fileRef = 9AB935771C1AD79D001285A0 /* ClockerIcon-16.png */; }; + 9AB9357B1C1AD8F7001285A0 /* CLRatingCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AB9357A1C1AD8F7001285A0 /* CLRatingCellView.m */; }; 9ABA38AC1BFAD7F80073EA4D /* Panel.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9ABA38AE1BFAD7F80073EA4D /* Panel.xib */; }; 9ABA38AF1BFAD83F0073EA4D /* PreferencesWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9ABA38B11BFAD83F0073EA4D /* PreferencesWindow.xib */; }; 9AC678E41C1ABAB9003B4F6B /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AC678E31C1ABAB9003B4F6B /* QuartzCore.framework */; }; + 9AD232741C1B96A700D1D446 /* ClockerIcon-256.png in Resources */ = {isa = PBXBuildFile; fileRef = 9AD232731C1B96A700D1D446 /* ClockerIcon-256.png */; }; + 9AD232781C1B985700D1D446 /* CLAboutWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AD232761C1B985700D1D446 /* CLAboutWindowController.m */; }; + 9AD232791C1B985700D1D446 /* CLAboutWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9AD232771C1B985700D1D446 /* CLAboutWindow.xib */; }; + 9AD2327B1C1B995900D1D446 /* Vector.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD2327A1C1B995900D1D446 /* Vector.jpg */; }; + 9AD2327D1C1B9A9000D1D446 /* aboutTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 9AD2327C1C1B9A9000D1D446 /* aboutTemplate.png */; }; + 9AD2327F1C1BA04800D1D446 /* FB-FindUsonFacebook-online-144.png in Resources */ = {isa = PBXBuildFile; fileRef = 9AD2327E1C1BA04800D1D446 /* FB-FindUsonFacebook-online-144.png */; }; DD4F7C0913C30F9F00825C6E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD4F7C0813C30F9F00825C6E /* Cocoa.framework */; }; /* End PBXBuildFile section */ @@ -93,9 +101,19 @@ 9A8605D11BEC155B00A810A4 /* Status@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Status@2x.png"; path = "Clocker/Status@2x.png"; sourceTree = ""; }; 9A8605D21BEC155B00A810A4 /* StatusHighlighted.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = StatusHighlighted.png; path = Clocker/StatusHighlighted.png; sourceTree = ""; }; 9A8605D31BEC155B00A810A4 /* StatusHighlighted@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "StatusHighlighted@2x.png"; path = "Clocker/StatusHighlighted@2x.png"; sourceTree = ""; }; + 9AB935771C1AD79D001285A0 /* ClockerIcon-16.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ClockerIcon-16.png"; path = "Icons/ClockerIcon-16.png"; sourceTree = ""; }; + 9AB935791C1AD8F7001285A0 /* CLRatingCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CLRatingCellView.h; path = Clocker/CLRatingCellView.h; sourceTree = ""; }; + 9AB9357A1C1AD8F7001285A0 /* CLRatingCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CLRatingCellView.m; path = Clocker/CLRatingCellView.m; sourceTree = ""; }; 9ABA38B31BFAD8520073EA4D /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = fr.lproj/Panel.xib; sourceTree = ""; }; 9ABA38B41BFAD8520073EA4D /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = fr.lproj/PreferencesWindow.xib; sourceTree = ""; }; 9AC678E31C1ABAB9003B4F6B /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 9AD232731C1B96A700D1D446 /* ClockerIcon-256.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ClockerIcon-256.png"; path = "Icons/ClockerIcon-256.png"; sourceTree = ""; }; + 9AD232751C1B985700D1D446 /* CLAboutWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CLAboutWindowController.h; path = Clocker/AboutUsWindow/CLAboutWindowController.h; sourceTree = ""; }; + 9AD232761C1B985700D1D446 /* CLAboutWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CLAboutWindowController.m; path = Clocker/AboutUsWindow/CLAboutWindowController.m; sourceTree = ""; }; + 9AD232771C1B985700D1D446 /* CLAboutWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = CLAboutWindow.xib; path = Clocker/AboutUsWindow/CLAboutWindow.xib; sourceTree = ""; }; + 9AD2327A1C1B995900D1D446 /* Vector.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = Vector.jpg; path = ../Vector.jpg; sourceTree = ""; }; + 9AD2327C1C1B9A9000D1D446 /* aboutTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = aboutTemplate.png; path = ../../../Downloads/aboutTemplate.png; sourceTree = ""; }; + 9AD2327E1C1BA04800D1D446 /* FB-FindUsonFacebook-online-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "FB-FindUsonFacebook-online-144.png"; path = "../../../Downloads/logos-and-badges_find-us_online/png/FB-FindUsonFacebook-online-144.png"; sourceTree = ""; }; DD4F7C0413C30F9F00825C6E /* Clocker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Clocker.app; sourceTree = BUILT_PRODUCTS_DIR; }; DD4F7C0813C30F9F00825C6E /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; DD4F7C0B13C30F9F00825C6E /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; @@ -147,6 +165,9 @@ 9A8605DD1BEC15C400A810A4 /* MainMenu.xib */, 9ABA38AE1BFAD7F80073EA4D /* Panel.xib */, 9ABA38B11BFAD83F0073EA4D /* PreferencesWindow.xib */, + 9AD232751C1B985700D1D446 /* CLAboutWindowController.h */, + 9AD232761C1B985700D1D446 /* CLAboutWindowController.m */, + 9AD232771C1B985700D1D446 /* CLAboutWindow.xib */, ); name = XIB; sourceTree = ""; @@ -154,6 +175,11 @@ 9A8605E11BEC160700A810A4 /* Images */ = { isa = PBXGroup; children = ( + 9AD2327E1C1BA04800D1D446 /* FB-FindUsonFacebook-online-144.png */, + 9AD2327C1C1B9A9000D1D446 /* aboutTemplate.png */, + 9AD2327A1C1B995900D1D446 /* Vector.jpg */, + 9AD232731C1B96A700D1D446 /* ClockerIcon-256.png */, + 9AB935771C1AD79D001285A0 /* ClockerIcon-16.png */, 9A8605CF1BEC155B00A810A4 /* PowerIcon.png */, 9A8605D01BEC155B00A810A4 /* Status.png */, 9A8605D11BEC155B00A810A4 /* Status@2x.png */, @@ -181,6 +207,8 @@ 9A8605C51BEC155B00A810A4 /* StatusItemView.h */, 9A8605BC1BEC14F600A810A4 /* BackgroundView.m */, 9A8605B81BEC14DC00A810A4 /* StatusItemView.m */, + 9AB935791C1AD8F7001285A0 /* CLRatingCellView.h */, + 9AB9357A1C1AD8F7001285A0 /* CLRatingCellView.m */, ); name = Views; sourceTree = ""; @@ -319,16 +347,22 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 9AD2327F1C1BA04800D1D446 /* FB-FindUsonFacebook-online-144.png in Resources */, 9ABA38AF1BFAD83F0073EA4D /* PreferencesWindow.xib in Resources */, 9A8605DF1BEC15C400A810A4 /* MainMenu.xib in Resources */, 9A8605D91BEC155B00A810A4 /* Status.png in Resources */, 9ABA38AC1BFAD7F80073EA4D /* Panel.xib in Resources */, 9A43792E1BEC256200F4E27F /* Media.xcassets in Resources */, + 9AB935781C1AD79D001285A0 /* ClockerIcon-16.png in Resources */, + 9AD232741C1B96A700D1D446 /* ClockerIcon-256.png in Resources */, 9A25F7461C1A5E17007D369B /* iRate.bundle in Resources */, 9A2000D11BFBD472002BFDE8 /* Localizable.strings in Resources */, + 9AD232791C1B985700D1D446 /* CLAboutWindow.xib in Resources */, 9A8605DC1BEC155B00A810A4 /* StatusHighlighted@2x.png in Resources */, 9A8605DA1BEC155B00A810A4 /* Status@2x.png in Resources */, + 9AD2327B1C1B995900D1D446 /* Vector.jpg in Resources */, 9A25F7451C1A5E17007D369B /* Info.plist in Resources */, + 9AD2327D1C1B9A9000D1D446 /* aboutTemplate.png in Resources */, 9A8605DB1BEC155B00A810A4 /* StatusHighlighted.png in Resources */, 9A8605D81BEC155B00A810A4 /* PowerIcon.png in Resources */, ); @@ -358,10 +392,12 @@ buildActionMask = 2147483647; files = ( 9A8605BF1BEC14F600A810A4 /* BackgroundView.m in Sources */, + 9AB9357B1C1AD8F7001285A0 /* CLRatingCellView.m in Sources */, 9A25F7471C1A5E17007D369B /* iRate.m in Sources */, 9A8605C01BEC14F600A810A4 /* Panel.m in Sources */, 9A8605C11BEC14F600A810A4 /* PreferencesWindowController.m in Sources */, 9A8605BA1BEC14DC00A810A4 /* StatusItemView.m in Sources */, + 9AD232781C1B985700D1D446 /* CLAboutWindowController.m in Sources */, 9A8605BB1BEC14DC00A810A4 /* PanelController.m in Sources */, 9A8605B61BEC14BE00A810A4 /* MenubarController.m in Sources */, 9A8605B71BEC14BE00A810A4 /* ApplicationDelegate.m in Sources */, diff --git a/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate b/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate index fac4230..e73a226 100644 Binary files a/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate and b/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Clocker/AboutUsWindow/CLAboutWindow.xib b/Clocker/AboutUsWindow/CLAboutWindow.xib new file mode 100644 index 0000000..9c69c8c --- /dev/null +++ b/Clocker/AboutUsWindow/CLAboutWindow.xib @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Clocker/AboutUsWindow/CLAboutWindowController.h b/Clocker/AboutUsWindow/CLAboutWindowController.h new file mode 100644 index 0000000..0a0438a --- /dev/null +++ b/Clocker/AboutUsWindow/CLAboutWindowController.h @@ -0,0 +1,15 @@ +// +// CLAboutWindowController.h +// Clocker +// +// Created by Abhishek Banthia on 12/11/15. +// +// + +#import + +@interface CLAboutWindowController : NSWindowController + ++ (instancetype)sharedReference; + +@end diff --git a/Clocker/AboutUsWindow/CLAboutWindowController.m b/Clocker/AboutUsWindow/CLAboutWindowController.m new file mode 100644 index 0000000..6a375d9 --- /dev/null +++ b/Clocker/AboutUsWindow/CLAboutWindowController.m @@ -0,0 +1,59 @@ +// +// CLAboutWindowController.m +// Clocker +// +// Created by Abhishek Banthia on 12/11/15. +// +// + +#import "CLAboutWindowController.h" + +@interface CLAboutWindowController () + +@end + +static CLAboutWindowController *sharedAboutUs = nil; + +@implementation CLAboutWindowController + +- (void)windowDidLoad { + [super windowDidLoad]; + + self.window.titleVisibility = NSWindowTitleHidden; + self.window.titlebarAppearsTransparent = YES; + self.window.styleMask |= NSFullSizeContentViewWindowMask; + + // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. +} + ++ (instancetype)sharedReference +{ + if (sharedAboutUs == nil) + { + /*Using a thread safe pattern*/ + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedAboutUs = [[self alloc] initWithWindowNibName:@"CLAboutWindow"]; + + }); + + } + + return sharedAboutUs; +} +- (IBAction)viewSource:(id)sender +{ + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://github.com/Abhishaker17/Clocker"]]; +} +- (IBAction)reportIssue:(id)sender +{ + // + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://github.com/Abhishaker17/Clocker/issues"]]; +} + +- (IBAction)openFacebookPage:(id)sender +{ + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://www.facebook.com/ClockerMenubarClock/"]]; +} + +@end diff --git a/Clocker/ApplicationDelegate.m b/Clocker/ApplicationDelegate.m index c07c88c..c805a5e 100755 --- a/Clocker/ApplicationDelegate.m +++ b/Clocker/ApplicationDelegate.m @@ -59,10 +59,7 @@ void *kContextActivePanel = &kContextActivePanel; + (void)initialize { //Configure iRate - [iRate sharedInstance].daysUntilPrompt = 0; - [iRate sharedInstance].usesUntilPrompt = 5; [iRate sharedInstance].appStoreID = 1056643111; - [iRate sharedInstance].useAllAvailableLanguages = NO; } #pragma mark - NSApplicationDelegate diff --git a/Clocker/Base.lproj/PreferencesWindow.xib b/Clocker/Base.lproj/PreferencesWindow.xib index 7dff807..a2b9aea 100644 --- a/Clocker/Base.lproj/PreferencesWindow.xib +++ b/Clocker/Base.lproj/PreferencesWindow.xib @@ -1,7 +1,7 @@ - + - + @@ -10,7 +10,6 @@ - @@ -22,20 +21,19 @@ - + - + - + @@ -64,7 +61,6 @@ - @@ -102,29 +98,23 @@ - - - - - - - - - - - - - - + - - - @@ -204,19 +165,32 @@ - - - + + + + + + + + + + + + + + + + - + @@ -238,7 +212,6 @@ - @@ -282,27 +255,22 @@ - - - - @@ -351,7 +316,6 @@ - @@ -375,7 +339,6 @@ - @@ -383,6 +346,7 @@ + diff --git a/Clocker/CLRatingCellView.h b/Clocker/CLRatingCellView.h new file mode 100644 index 0000000..a762af1 --- /dev/null +++ b/Clocker/CLRatingCellView.h @@ -0,0 +1,17 @@ +// +// CLRatingCellView.h +// Clocker +// +// Created by Abhishek Banthia on 12/11/15. +// +// + +#import + +@interface CLRatingCellView : NSTableCellView + +@property (weak, nonatomic) IBOutlet NSTextField *leftField; +@property (weak, nonatomic) IBOutlet NSButton *leftButton; +@property (weak, nonatomic) IBOutlet NSButton *rightButton; + +@end diff --git a/Clocker/CLRatingCellView.m b/Clocker/CLRatingCellView.m new file mode 100644 index 0000000..62e0d9f --- /dev/null +++ b/Clocker/CLRatingCellView.m @@ -0,0 +1,95 @@ +// +// CLRatingCellView.m +// Clocker +// +// Created by Abhishek Banthia on 12/11/15. +// +// + +#import "CLRatingCellView.h" +#import "iRate.h" +#import +#import "PanelController.h" + +@implementation CLRatingCellView + +- (void)drawRect:(NSRect)dirtyRect { + [super drawRect:dirtyRect]; + + // Drawing code here. +} + +- (IBAction)actionOnNegativeFeedback:(id)sender +{ + NSButton *leftButton = (NSButton *)sender; + + if ([leftButton.title isEqualToString:@"Not Really"]) { + [self setAnimatedStringValue:@"Mind giving us some feedback?" andTextField:self.leftField]; + } + else + { + //Make the row disappear and call remind later + PanelController *panelRef = [[[NSApplication sharedApplication] mainWindow] windowController]; + panelRef.showReviewCell = NO; + [panelRef updateDefaultPreferences]; + [panelRef closePanel]; + [[iRate sharedInstance] remindLater]; + } +} + +- (IBAction)actionOnPositiveFeedback:(id)sender +{ + NSButton *rightButton = (NSButton *)sender; + + if ([rightButton.title isEqualToString:@"Yes!"]) { + [self setAnimatedStringValue:@"Rate us on the App Store, then?" andTextField:self.leftField]; + } + else + { + //Make the row disappear and call rate + + [[iRate sharedInstance] rate]; + PanelController *panelRef = [[[NSApplication sharedApplication] mainWindow] windowController]; + panelRef.showReviewCell = NO; + [panelRef updateDefaultPreferences]; + } +} + +- (void) setAnimatedStringValue:(NSString *)aString andTextField:(NSTextField *)textfield +{ + if ([[textfield stringValue] isEqual: aString]) + { + return; + } + + [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) { + [context setDuration: 1.0]; + [context setTimingFunction: [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseOut]]; + [self.imageView.animator setAlphaValue:0.0]; + [self.leftButton.animator setAlphaValue:0.0]; + [self.rightButton.animator setAlphaValue:0.0]; + [textfield.animator setAlphaValue: 0.0]; + } + completionHandler:^{ + [textfield setStringValue: aString]; + [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) { + [context setDuration: 1.0]; + [context setTimingFunction: [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseIn]]; + [self.imageView.animator setAlphaValue: 1.0]; + [textfield.animator setAlphaValue: 1.0]; + [self.leftButton.animator setAlphaValue:1.0]; + [self.rightButton.animator setAlphaValue:1.0]; + if ([self.leftButton.title isEqualToString:@"Not Really"]) { + [self.leftButton.animator setTitle:@"No, thanks"]; + } + if ([self.rightButton.title isEqualToString:@"Yes!"]) { + [self.rightButton.animator setTitle:@"Ok, sure"]; + } + + } completionHandler: ^{ + }]; + }]; +} + + +@end diff --git a/Clocker/PanelController.h b/Clocker/PanelController.h index dbff934..441888b 100755 --- a/Clocker/PanelController.h +++ b/Clocker/PanelController.h @@ -65,7 +65,7 @@ @property (weak) IBOutlet NSButton *shutdownButton; @property (weak) IBOutlet NSButton *preferencesButton; - +@property (assign) BOOL showReviewCell; - (id)initWithDelegate:(id)delegate; diff --git a/Clocker/PanelController.m b/Clocker/PanelController.m index ca85b7f..f272506 100755 --- a/Clocker/PanelController.m +++ b/Clocker/PanelController.m @@ -31,6 +31,7 @@ #import "StatusItemView.h" #import "MenubarController.h" #import +#import "CLRatingCellView.h" #define OPEN_DURATION .15 #define CLOSE_DURATION .1 @@ -91,11 +92,13 @@ - (void) updateDefaultPreferences { + NSArray *defaultZones = [[NSUserDefaults standardUserDefaults] objectForKey:@"defaultPreferences"]; self.defaultPreferences = self.defaultPreferences == nil ? [[NSMutableArray alloc] initWithArray:defaultZones] : [NSMutableArray arrayWithArray:defaultZones]; - self.scrollViewHeight.constant = self.defaultPreferences.count*55 + 30; + self.scrollViewHeight.constant = self.showReviewCell ? (self.defaultPreferences.count+1)*55+30 : self.defaultPreferences.count*55 + 30; + } #pragma mark - Public accessors @@ -184,11 +187,10 @@ NSRect screenRect = [[[NSScreen screens] objectAtIndex:0] frame]; NSRect statusRect = [self statusRectForWindow:panel]; - NSRect panelRect = [panel frame]; panelRect.size.width = PANEL_WIDTH; - panelRect.size.height = self.defaultPreferences.count*55 + 30; + panelRect.size.height = self.showReviewCell ? (self.defaultPreferences.count+1)*55+30: self.defaultPreferences.count*55 + 30; panelRect.origin.x = roundf(NSMidX(statusRect) - NSWidth(panelRect) / 2); panelRect.origin.y = NSMaxY(statusRect) - NSHeight(panelRect); @@ -248,11 +250,20 @@ -(NSInteger)numberOfRowsInTableView:(NSTableView *)tableView { + if (self.showReviewCell) { + return self.defaultPreferences.count+1; + } return self.defaultPreferences.count; } -(NSView*)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { + if (self.showReviewCell && row == self.defaultPreferences.count) { + CLRatingCellView *cellView = [self.mainTableview makeViewWithIdentifier:@"ratingCellView" owner:self]; + return cellView; + } + + NSTableCellView *cell = [tableView makeViewWithIdentifier:@"timeZoneCell" owner:self]; NSTextField *cellText = [cell viewWithTag:100]; diff --git a/Clocker/PreferencesWindowController.h b/Clocker/PreferencesWindowController.h index 1ca89c4..b9cfe97 100644 --- a/Clocker/PreferencesWindowController.h +++ b/Clocker/PreferencesWindowController.h @@ -30,6 +30,7 @@ // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import +#import "CLAboutWindowController.h" @class AvailableTimezonesPanel; @@ -38,6 +39,7 @@ @property (strong, nonatomic) NSMutableArray *timeZoneArray; @property (strong, nonatomic) NSMutableArray *selectedTimeZones; @property (strong, nonatomic) NSArray *filteredArray; +@property (strong, nonatomic) CLAboutWindowController *aboutUsWindow; @property (atomic, assign) BOOL launchOnLogin; + (instancetype)sharedPreferences; diff --git a/Clocker/PreferencesWindowController.m b/Clocker/PreferencesWindowController.m index d7d93ad..4991574 100644 --- a/Clocker/PreferencesWindowController.m +++ b/Clocker/PreferencesWindowController.m @@ -34,6 +34,7 @@ #import "Panel.h" #import "PanelController.h" #import "ApplicationDelegate.h" +#import @interface PreferencesWindowController () @@ -46,7 +47,6 @@ @property (weak) IBOutlet NSButton *is24HourFormatSelected; @property (weak) IBOutlet NSTextField *messageLabel; -@property (weak) IBOutlet NSTextField *openSourceMessage; @end @@ -62,11 +62,6 @@ static PreferencesWindowController *sharedPreferences = nil; [self.customView setWantsLayer:YES]; // view's backing store is using a Core Animation Layer [self.customView setLayer:viewLayer]; - [self.openSourceMessage setAllowsEditingTextAttributes: YES]; - [self.openSourceMessage setSelectable:YES]; - NSString *credits = @"Clocker v1.0 is open source. You can find the source code here!"; - [self.openSourceMessage setAttributedStringValue:[self stringFromHTML:credits withFont:[self.openSourceMessage font]]]; - self.window.titleVisibility = NSWindowTitleHidden; NSMutableArray *defaultTimeZones = [[NSUserDefaults standardUserDefaults] objectForKey:@"defaultPreferences"]; @@ -460,18 +455,11 @@ static PreferencesWindowController *sharedPreferences = nil; } } -- (IBAction)supportAction:(id)sender +- (IBAction)openAboutUsWindow:(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];*/ - - NSString *issuePage = @"https://github.com/Abhishaker17/Clocker/issues"; - NSURL *mainURL = [NSURL URLWithString:issuePage]; - [[NSWorkspace sharedWorkspace] openURL:mainURL]; + self.aboutUsWindow = [CLAboutWindowController sharedReference]; + [self.aboutUsWindow showWindow:nil]; + [NSApp activateIgnoringOtherApps:YES]; } diff --git a/Clocker/Rate App/iRate.h b/Clocker/Rate App/iRate.h index 12f981c..1c27d8b 100755 --- a/Clocker/Rate App/iRate.h +++ b/Clocker/Rate App/iRate.h @@ -167,6 +167,8 @@ typedef NS_ENUM(NSUInteger, iRateErrorCode) - (void)promptIfAllCriteriaMet; - (void)openRatingsPageInAppStore; - (void)logEvent:(BOOL)deferPrompt; +- (void)rate; +- (void)remindLater; @end diff --git a/Clocker/Rate App/iRate.m b/Clocker/Rate App/iRate.m index e7fc9f7..77733a2 100755 --- a/Clocker/Rate App/iRate.m +++ b/Clocker/Rate App/iRate.m @@ -32,7 +32,7 @@ #import "iRate.h" - +#import "PanelController.h" #import #if !__has_feature(objc_arc) @@ -936,19 +936,10 @@ static NSString *const iRateMacAppStoreURLFormat = @"macappstore://itunes.apple. #endif { -// [alert beginSheetModalForWindow:[NSApplication sharedApplication].mainWindow completionHandler:^(NSModalResponse returnCode) { -// [self didDismissAlert:alert withButtonAtIndex:returnCode - NSAlertFirstButtonReturn]; -// }]; - - NSModalResponse modalResponse = [alert runModal]; - NSLog(@"Modal response code:%zd", modalResponse); - if (modalResponse == NSModalResponseStop) { - [self rate]; - } - else - { - [self remindLater]; - } + PanelController *panelRef = (PanelController *)[[[NSApplication sharedApplication] + mainWindow] windowController]; + panelRef.showReviewCell = YES; + [panelRef updateDefaultPreferences]; } #endif diff --git a/Clocker/de.lproj/PreferencesWindow.xib b/Clocker/de.lproj/PreferencesWindow.xib index ddfd8f6..42f648f 100644 --- a/Clocker/de.lproj/PreferencesWindow.xib +++ b/Clocker/de.lproj/PreferencesWindow.xib @@ -1,7 +1,7 @@ - + - + @@ -10,7 +10,6 @@ - @@ -22,20 +21,19 @@ - + - + - + @@ -64,7 +61,6 @@ - @@ -102,29 +98,23 @@ - - - - - - - - - - - - - - - - + - @@ -204,19 +165,33 @@ - - - + + + + + + + + + + + + + + + + + - + @@ -238,7 +213,6 @@ - @@ -282,27 +256,22 @@ - - - - @@ -351,7 +317,6 @@ - @@ -375,7 +340,6 @@ - @@ -383,6 +347,7 @@ + diff --git a/Clocker/en.lproj/Panel.xib b/Clocker/en.lproj/Panel.xib index 6c8d0b6..34cc4d0 100755 --- a/Clocker/en.lproj/Panel.xib +++ b/Clocker/en.lproj/Panel.xib @@ -1,7 +1,7 @@ - + - + @@ -35,7 +35,6 @@ - @@ -64,7 +63,6 @@ - @@ -77,7 +75,6 @@ - @@ -90,7 +87,6 @@ - @@ -106,11 +102,74 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -120,22 +179,18 @@ - - @@ -143,7 +198,6 @@ - @@ -156,7 +210,6 @@ - @@ -171,7 +224,6 @@ - @@ -193,7 +245,6 @@ - @@ -203,6 +254,7 @@ + diff --git a/Clocker/en.lproj/PreferencesWindow.xib b/Clocker/en.lproj/PreferencesWindow.xib index ed9a78a..44676b8 100644 --- a/Clocker/en.lproj/PreferencesWindow.xib +++ b/Clocker/en.lproj/PreferencesWindow.xib @@ -1,7 +1,7 @@ - + - + @@ -10,7 +10,6 @@ - @@ -19,23 +18,22 @@ - - + + - + - + - + @@ -64,7 +61,6 @@ - @@ -102,29 +98,23 @@ - - - - - - - - - - - - - - + - - - @@ -204,19 +165,33 @@ - - - + + + + + + + + + + + + + + + + + - + @@ -238,7 +213,6 @@ - @@ -282,27 +256,22 @@ - - - - @@ -351,7 +317,6 @@ - @@ -375,7 +340,6 @@ - @@ -383,6 +347,7 @@ + diff --git a/Clocker/fr.lproj/PreferencesWindow.xib b/Clocker/fr.lproj/PreferencesWindow.xib index a3c5139..a8edd11 100644 --- a/Clocker/fr.lproj/PreferencesWindow.xib +++ b/Clocker/fr.lproj/PreferencesWindow.xib @@ -1,7 +1,7 @@ - + - + @@ -10,7 +10,6 @@ - @@ -22,20 +21,19 @@ - + - + - + @@ -64,7 +61,6 @@ - @@ -102,29 +98,23 @@ - - - - - - - - - - - - - - - - - + - - - + + + + + + + + + + + + + + + + - + @@ -239,7 +213,6 @@ - @@ -283,27 +256,22 @@ - - - - @@ -352,7 +317,6 @@ - @@ -376,7 +340,6 @@ - @@ -384,6 +347,7 @@ + diff --git a/Clocker/ja.lproj/Panel.xib b/Clocker/ja.lproj/Panel.xib index 6c8d0b6..af226a3 100755 --- a/Clocker/ja.lproj/Panel.xib +++ b/Clocker/ja.lproj/Panel.xib @@ -1,7 +1,7 @@ - + - + @@ -35,7 +35,6 @@ - @@ -64,7 +63,6 @@ - @@ -77,7 +75,6 @@ - @@ -90,7 +87,6 @@ - @@ -106,7 +102,6 @@ - @@ -120,22 +115,18 @@ - - @@ -143,7 +134,6 @@ - @@ -156,7 +146,6 @@ - @@ -171,7 +160,6 @@ - @@ -193,7 +181,6 @@ - diff --git a/Clocker/ja.lproj/PreferencesWindow.xib b/Clocker/ja.lproj/PreferencesWindow.xib index 14154e1..a5d88c0 100644 --- a/Clocker/ja.lproj/PreferencesWindow.xib +++ b/Clocker/ja.lproj/PreferencesWindow.xib @@ -1,7 +1,7 @@ - + - + @@ -10,7 +10,6 @@ - @@ -22,20 +21,19 @@ - + - + - + @@ -64,7 +61,6 @@ - @@ -102,29 +98,23 @@ - - - - - - - - - - - - - - - - - + - - - + + + + + + + + + + + + + + + + - + @@ -238,7 +212,6 @@ - @@ -282,27 +255,22 @@ - - - - @@ -351,7 +316,6 @@ - @@ -375,7 +339,6 @@ - @@ -383,6 +346,7 @@ +