enable sandbox for mac appstore and use Pictures directory on osx
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||||
<key>NSHumanReadableCopyright</key>
|
<key>NSHumanReadableCopyright</key>
|
||||||
<string>Copyright © 2017 Omar Mohamed Ali Mudhir. All rights reserved.</string>
|
<string>Copyright © 2018 OmixLab Ltd. All rights reserved.</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string>NSApplication</string>
|
<string>NSApplication</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
|||||||
10
PanoPainter-OSX/PanoPainter.entitlements
Normal file
10
PanoPainter-OSX/PanoPainter.entitlements
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>com.apple.security.app-sandbox</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.assets.pictures.read-write</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -319,6 +319,7 @@
|
|||||||
AD3B1EBF1E3B8B7600E918E3 /* layout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = layout.h; sourceTree = "<group>"; };
|
AD3B1EBF1E3B8B7600E918E3 /* layout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = layout.h; sourceTree = "<group>"; };
|
||||||
AD43267F21599A5B006DE7F6 /* node_usermanual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = node_usermanual.h; sourceTree = "<group>"; };
|
AD43267F21599A5B006DE7F6 /* node_usermanual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = node_usermanual.h; sourceTree = "<group>"; };
|
||||||
AD43268021599A5B006DE7F6 /* node_usermanual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = node_usermanual.cpp; sourceTree = "<group>"; };
|
AD43268021599A5B006DE7F6 /* node_usermanual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = node_usermanual.cpp; sourceTree = "<group>"; };
|
||||||
|
AD432683215A2B31006DE7F6 /* PanoPainter.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = PanoPainter.entitlements; sourceTree = "<group>"; };
|
||||||
AD4C08CF1E89BD0F0051D85F /* asset.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = asset.cpp; sourceTree = "<group>"; };
|
AD4C08CF1E89BD0F0051D85F /* asset.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = asset.cpp; sourceTree = "<group>"; };
|
||||||
AD4C08D01E89BD0F0051D85F /* asset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asset.h; sourceTree = "<group>"; };
|
AD4C08D01E89BD0F0051D85F /* asset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asset.h; sourceTree = "<group>"; };
|
||||||
AD4C08D11E89BD0F0051D85F /* bezier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bezier.cpp; sourceTree = "<group>"; };
|
AD4C08D11E89BD0F0051D85F /* bezier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bezier.cpp; sourceTree = "<group>"; };
|
||||||
@@ -506,6 +507,7 @@
|
|||||||
AD0E5C9D1ECC6F2B00C35669 /* PanoPainter-OSX */ = {
|
AD0E5C9D1ECC6F2B00C35669 /* PanoPainter-OSX */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
AD432683215A2B31006DE7F6 /* PanoPainter.entitlements */,
|
||||||
AD0E5CA41ECC6F2B00C35669 /* Assets.xcassets */,
|
AD0E5CA41ECC6F2B00C35669 /* Assets.xcassets */,
|
||||||
AD0E5CA61ECC6F2B00C35669 /* MainMenu.xib */,
|
AD0E5CA61ECC6F2B00C35669 /* MainMenu.xib */,
|
||||||
AD0E5CA91ECC6F2B00C35669 /* Info.plist */,
|
AD0E5CA91ECC6F2B00C35669 /* Info.plist */,
|
||||||
@@ -893,6 +895,11 @@
|
|||||||
CreatedOnToolsVersion = 7.2;
|
CreatedOnToolsVersion = 7.2;
|
||||||
DevelopmentTeam = ERD9AYQ49S;
|
DevelopmentTeam = ERD9AYQ49S;
|
||||||
ProvisioningStyle = Automatic;
|
ProvisioningStyle = Automatic;
|
||||||
|
SystemCapabilities = {
|
||||||
|
com.apple.Sandbox = {
|
||||||
|
enabled = 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
AD787ADC20D4611100C4712A = {
|
AD787ADC20D4611100C4712A = {
|
||||||
CreatedOnToolsVersion = 9.4.1;
|
CreatedOnToolsVersion = 9.4.1;
|
||||||
@@ -1319,6 +1326,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "c++14";
|
CLANG_CXX_LANGUAGE_STANDARD = "c++14";
|
||||||
CLANG_ENABLE_MODULES = NO;
|
CLANG_ENABLE_MODULES = NO;
|
||||||
|
CODE_SIGN_ENTITLEMENTS = "PanoPainter-OSX/PanoPainter.entitlements";
|
||||||
CODE_SIGN_IDENTITY = "Mac Developer";
|
CODE_SIGN_IDENTITY = "Mac Developer";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
@@ -1342,6 +1350,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "c++14";
|
CLANG_CXX_LANGUAGE_STANDARD = "c++14";
|
||||||
CLANG_ENABLE_MODULES = NO;
|
CLANG_ENABLE_MODULES = NO;
|
||||||
|
CODE_SIGN_ENTITLEMENTS = "PanoPainter-OSX/PanoPainter.entitlements";
|
||||||
CODE_SIGN_IDENTITY = "Mac Developer";
|
CODE_SIGN_IDENTITY = "Mac Developer";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
|
|||||||
16
src/app.cpp
16
src/app.cpp
@@ -108,8 +108,20 @@ void App::initAssets()
|
|||||||
|
|
||||||
void App::initLog()
|
void App::initLog()
|
||||||
{
|
{
|
||||||
#if defined(__IOS__) || defined(__OSX__)
|
#if defined(__IOS__)
|
||||||
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||||
|
NSString* docpath = (NSString*)[paths objectAtIndex:0];
|
||||||
|
data_path = [docpath cStringUsingEncoding:NSASCIIStringEncoding];
|
||||||
|
|
||||||
|
NSString* recpath = [docpath stringByAppendingString:@"/rec"];
|
||||||
|
rec_path = [recpath cStringUsingEncoding:NSASCIIStringEncoding];
|
||||||
|
NSError* recerr = nil;
|
||||||
|
if (![[NSFileManager defaultManager] createDirectoryAtPath:recpath withIntermediateDirectories:YES attributes:nil error:&recerr])
|
||||||
|
{
|
||||||
|
LOG("error creating rec path: %s", [[recerr localizedDescription] cStringUsingEncoding:NSASCIIStringEncoding]);
|
||||||
|
}
|
||||||
|
#elif defined(__OSX__)
|
||||||
|
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSPicturesDirectory, NSUserDomainMask, YES);
|
||||||
NSString* docpath = [(NSString*)[paths objectAtIndex:0] stringByAppendingString:@"/PanoPainter"];
|
NSString* docpath = [(NSString*)[paths objectAtIndex:0] stringByAppendingString:@"/PanoPainter"];
|
||||||
|
|
||||||
NSError* docerr = nil;
|
NSError* docerr = nil;
|
||||||
@@ -126,7 +138,7 @@ void App::initLog()
|
|||||||
{
|
{
|
||||||
LOG("error creating rec path: %s", [[recerr localizedDescription] cStringUsingEncoding:NSASCIIStringEncoding]);
|
LOG("error creating rec path: %s", [[recerr localizedDescription] cStringUsingEncoding:NSASCIIStringEncoding]);
|
||||||
}
|
}
|
||||||
#elif _WIN32
|
#elif defined(_WIN32)
|
||||||
//CHAR my_documents[MAX_PATH];
|
//CHAR my_documents[MAX_PATH];
|
||||||
//HRESULT result = SHGetFolderPathA(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, my_documents);
|
//HRESULT result = SHGetFolderPathA(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, my_documents);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user