diff --git a/Clocker.xcodeproj/project.pbxproj b/Clocker.xcodeproj/project.pbxproj index ae4b301..c2c5678 100755 --- a/Clocker.xcodeproj/project.pbxproj +++ b/Clocker.xcodeproj/project.pbxproj @@ -42,6 +42,7 @@ 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; }; 9A43792D1BEC256200F4E27F /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = ""; }; + 9A5B1A8D1BECDFB700A77C68 /* Clocker.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = Clocker.entitlements; path = Clocker/Clocker.entitlements; sourceTree = ""; }; 9A8605AD1BEC148400A810A4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Clocker/main.m; sourceTree = ""; }; 9A8605B21BEC14A600A810A4 /* ColoredButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ColoredButton.m; path = Clocker/ColoredButton.m; sourceTree = ""; }; 9A8605B41BEC14BE00A810A4 /* MenubarController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MenubarController.m; path = Clocker/MenubarController.m; sourceTree = ""; }; @@ -166,6 +167,7 @@ DD4F7BF913C30F9F00825C6E = { isa = PBXGroup; children = ( + 9A5B1A8D1BECDFB700A77C68 /* Clocker.entitlements */, 9A43792D1BEC256200F4E27F /* Media.xcassets */, 9A8605E01BEC15F400A810A4 /* XIB */, 9A8605E11BEC160700A810A4 /* Images */, @@ -234,6 +236,11 @@ TargetAttributes = { DD4F7C0313C30F9F00825C6E = { DevelopmentTeam = AJS5SNW8EY; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; }; }; }; @@ -320,6 +327,61 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 9A5B1A8B1BECDB5B00A77C68 /* Distribution */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "Mac Developer: Abhishek Banthia (75WFZYE9LW)"; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.10; + PROVISIONING_PROFILE = ""; + SDKROOT = macosx; + }; + name = Distribution; + }; + 9A5B1A8C1BECDB5B00A77C68 /* Distribution */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_ENTITLEMENTS = Clocker/Clocker.entitlements; + CODE_SIGN_IDENTITY = "Mac Developer: Abhishek Banthia (75WFZYE9LW)"; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Clocker/Clocker-Prefix.pch"; + INFOPLIST_FILE = "Clocker/Clocker-Info.plist"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + PRODUCT_BUNDLE_IDENTIFIER = com.abhishek.Clocker; + PRODUCT_NAME = Clocker; + PROVISIONING_PROFILE = ""; + WRAPPER_EXTENSION = app; + }; + name = Distribution; + }; DD4F7C2013C30F9F00825C6E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -331,6 +393,7 @@ CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "Mac Developer: Abhishek Banthia (75WFZYE9LW)"; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -354,6 +417,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.10; ONLY_ACTIVE_ARCH = YES; + PROVISIONING_PROFILE = ""; SDKROOT = macosx; }; name = Debug; @@ -369,6 +433,7 @@ CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "Mac Developer: Abhishek Banthia (75WFZYE9LW)"; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -384,6 +449,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.10; + PROVISIONING_PROFILE = ""; SDKROOT = macosx; }; name = Release; @@ -393,7 +459,8 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "3rd Party Mac Developer Application: Abhishek Banthia (AJS5SNW8EY)"; + CODE_SIGN_ENTITLEMENTS = Clocker/Clocker.entitlements; + CODE_SIGN_IDENTITY = "Mac Developer: Abhishek Banthia (75WFZYE9LW)"; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( @@ -406,7 +473,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.10; PRODUCT_BUNDLE_IDENTIFIER = com.abhishek.Clocker; PRODUCT_NAME = Clocker; - PROVISIONING_PROFILE = "1885f3d2-2a35-4a0b-b465-4c0119f4bbaf"; + PROVISIONING_PROFILE = ""; WRAPPER_EXTENSION = app; }; name = Debug; @@ -416,7 +483,8 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "3rd Party Mac Developer Application: Abhishek Banthia (AJS5SNW8EY)"; + CODE_SIGN_ENTITLEMENTS = Clocker/Clocker.entitlements; + CODE_SIGN_IDENTITY = "Mac Developer: Abhishek Banthia (75WFZYE9LW)"; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -428,7 +496,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.10; PRODUCT_BUNDLE_IDENTIFIER = com.abhishek.Clocker; PRODUCT_NAME = Clocker; - PROVISIONING_PROFILE = "1885f3d2-2a35-4a0b-b465-4c0119f4bbaf"; + PROVISIONING_PROFILE = ""; WRAPPER_EXTENSION = app; }; name = Release; @@ -441,6 +509,7 @@ buildConfigurations = ( DD4F7C2013C30F9F00825C6E /* Debug */, DD4F7C2113C30F9F00825C6E /* Release */, + 9A5B1A8B1BECDB5B00A77C68 /* Distribution */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -450,6 +519,7 @@ buildConfigurations = ( DD4F7C2313C30F9F00825C6E /* Debug */, DD4F7C2413C30F9F00825C6E /* Release */, + 9A5B1A8C1BECDB5B00A77C68 /* Distribution */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate b/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate index b4ac319..8705c62 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/Clocker.entitlements b/Clocker/Clocker.entitlements new file mode 100644 index 0000000..852fa1a --- /dev/null +++ b/Clocker/Clocker.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/Clocker/PanelController.m b/Clocker/PanelController.m index ead2ea8..045d3c7 100755 --- a/Clocker/PanelController.m +++ b/Clocker/PanelController.m @@ -88,15 +88,7 @@ { NSArray *defaultZones = [[NSUserDefaults standardUserDefaults] objectForKey:@"defaultPreferences"]; - if (self.defaultPreferences == nil) - { - self.defaultPreferences = [[NSMutableArray alloc] initWithArray:defaultZones]; - } - else - { - self.defaultPreferences = [NSMutableArray arrayWithArray:defaultZones]; - } - + self.defaultPreferences = self.defaultPreferences == nil ? [[NSMutableArray alloc] initWithArray:defaultZones] : [NSMutableArray arrayWithArray:defaultZones]; self.scrollViewHeight.constant = self.defaultPreferences.count*55 + 30; } @@ -114,14 +106,7 @@ { _hasActivePanel = flag; - if (_hasActivePanel) - { - [self openPanel]; - } - else - { - [self closePanel]; - } + _hasActivePanel ? [self openPanel] : [self closePanel]; } } diff --git a/Clocker/PreferencesWindowController.m b/Clocker/PreferencesWindowController.m index 02e94c6..7a8ef2a 100644 --- a/Clocker/PreferencesWindowController.m +++ b/Clocker/PreferencesWindowController.m @@ -263,14 +263,8 @@ static PreferencesWindowController *sharedPreferences = nil; [self.selectedTimeZones removeObjectsInArray:itemsToRemove]; - NSArray *defaultTimeZones = [[NSUserDefaults standardUserDefaults] objectForKey:@"defaultPreferences"]; NSMutableArray *newDefaults; - if (defaultTimeZones == nil) - { - defaultTimeZones = [[NSMutableArray alloc] init]; - } - newDefaults = [[NSMutableArray alloc] initWithArray:self.selectedTimeZones]; diff --git a/Clocker/StatusItemView.m b/Clocker/StatusItemView.m index d9bdf38..70bad43 100755 --- a/Clocker/StatusItemView.m +++ b/Clocker/StatusItemView.m @@ -66,11 +66,8 @@ self.image = [NSImage imageNamed:@"StatusHighlighted"]; } else - { - if (self.isHighlighted) - self.image = [NSImage imageNamed:@"StatusHighlighted"]; - else - self.image = [NSImage imageNamed:@"Status"]; + { + self.image = self.isHighlighted ? [NSImage imageNamed:@"StatusHighlighted"] : [NSImage imageNamed:@"Status"]; } [self.statusItem drawStatusBarBackgroundInRect:dirtyRect withHighlight:self.isHighlighted];