Skip to content

Commit

Permalink
update Lock.app
Browse files Browse the repository at this point in the history
  • Loading branch information
siong1987 committed Nov 12, 2017
1 parent 8cbedea commit 55fd721
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
17 changes: 11 additions & 6 deletions Lock/Lock.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
88314F531A1CC71E00C7A348 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88314F521A1CC71E00C7A348 /* Images.xcassets */; };
88314F561A1CC71E00C7A348 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 88314F541A1CC71E00C7A348 /* MainMenu.xib */; };
88314F621A1CC71E00C7A348 /* LockTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88314F611A1CC71E00C7A348 /* LockTests.m */; };
88314F6C1A1CC77200C7A348 /* ScreenSaver.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88314F6B1A1CC77200C7A348 /* ScreenSaver.framework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -36,15 +35,13 @@
88314F5B1A1CC71E00C7A348 /* LockTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LockTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
88314F601A1CC71E00C7A348 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
88314F611A1CC71E00C7A348 /* LockTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LockTests.m; sourceTree = "<group>"; };
88314F6B1A1CC77200C7A348 /* ScreenSaver.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ScreenSaver.framework; path = System/Library/Frameworks/ScreenSaver.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
88314F451A1CC71E00C7A348 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
88314F6C1A1CC77200C7A348 /* ScreenSaver.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -61,7 +58,6 @@
88314F3F1A1CC71E00C7A348 = {
isa = PBXGroup;
children = (
88314F6B1A1CC77200C7A348 /* ScreenSaver.framework */,
88314F4A1A1CC71E00C7A348 /* Lock */,
88314F5E1A1CC71E00C7A348 /* LockTests */,
88314F491A1CC71E00C7A348 /* Products */,
Expand Down Expand Up @@ -165,6 +161,7 @@
88314F471A1CC71E00C7A348 = {
CreatedOnToolsVersion = 6.1;
DevelopmentTeam = UPETBWQE65;
ProvisioningStyle = Automatic;
};
88314F5A1A1CC71E00C7A348 = {
CreatedOnToolsVersion = 6.1;
Expand Down Expand Up @@ -330,23 +327,29 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = UPETBWQE65;
INFOPLIST_FILE = Lock/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
};
name = Debug;
};
88314F671A1CC71E00C7A348 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = UPETBWQE65;
INFOPLIST_FILE = Lock/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
};
name = Release;
};
Expand Down Expand Up @@ -405,6 +408,7 @@
88314F671A1CC71E00C7A348 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
88314F681A1CC71E00C7A348 /* Build configuration list for PBXNativeTarget "LockTests" */ = {
isa = XCConfigurationList;
Expand All @@ -413,6 +417,7 @@
88314F6A1A1CC71E00C7A348 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
9 changes: 0 additions & 9 deletions Lock/Lock/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,4 @@

@interface AppDelegate : NSObject <NSApplicationDelegate>


@end

// ref: http://stackoverflow.com/questions/11609751/osx-lion-bug-desktop-may-become-unusable-when-launching-screensaver-programmati/11626752#11626752
@interface ScreenSaverController : NSObject + controller;
@end

@protocol ScreenSaverControl
- (void)screenSaverStartNow;
@end
3 changes: 2 additions & 1 deletion Lock/Lock/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ @interface AppDelegate ()
@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
[[ScreenSaverController controller] screenSaverStartNow];
NSAppleScript *lockScript = [[NSAppleScript alloc] initWithSource:@"activate application \"ScreenSaverEngine\""];
[lockScript executeAndReturnError:nil];

// Quit the app
[[NSApplication sharedApplication] terminate:nil];
Expand Down

0 comments on commit 55fd721

Please sign in to comment.