Prepare app for MAS submission (app sandboxing)

This commit is contained in:
Gennadii Potapov 2020-01-21 15:35:58 +08:00
parent 149f969e3f
commit cac2bdc2b5
5 changed files with 22 additions and 3 deletions

View file

@ -45,6 +45,9 @@
NSString *statusItemText;
NSImage *statusItemImage;
IBOutlet NSTextField *forgottenItemLabel;
IBOutlet NSButton *forgottenFavoritesCheckbox;
IBOutlet NSButton *forgottenClippingsCheckbox;
// The menu attatched to same
IBOutlet NSMenu *jcMenu;
int jcMenuBaseItemsCount;
@ -55,6 +58,7 @@
NSEvent *menuOpenEvent;
IBOutlet NSSlider * heightSlider;
IBOutlet NSSlider * widthSlider;
// A timer which will let us check the pasteboard;
// this should default to every .5 seconds but be user-configurable
NSTimer *pollPBTimer;

View file

@ -57,7 +57,11 @@
@"displayClippingSource",
[NSNumber numberWithBool:NO],
@"saveForgottenClippings",
#ifdef SANDBOXING
[NSNumber numberWithBool:NO],
#else
[NSNumber numberWithBool:YES],
#endif
@"saveForgottenFavorites",
[NSNumber numberWithBool:NO],
@"suppressAccessibilityAlert",
@ -100,7 +104,7 @@
// Not registering for conflict notifications, since we just sync settings, and if the settings are conflictingly adjusted simultaneously on two systems there is nothing to say which setting is better.
[[MJCloudKitUserDefaultsSync sharedSync] startWithKeyMatchList:settingsSyncList
withContainerIdentifier:@"iCloud.com.mark-a-jerde.Flycut"];
withContainerIdentifier:kiCloudId];
}
else {
[[MJCloudKitUserDefaultsSync sharedSync] stopForKeyMatchList:settingsSyncList];
@ -624,6 +628,11 @@
action:@selector(setupBezel:)];
[appearancePanel addSubview:row];
nextYMax = row.frame.origin.y;
#ifdef SANDBOXING
forgottenItemLabel.hidden = YES;
forgottenClippingsCheckbox.hidden = YES;
forgottenFavoritesCheckbox.hidden = YES;
#endif
}
-(IBAction) showPreferencePanel:(id)sender

View file

@ -233,6 +233,9 @@
- (bool)saveFromStore:(FlycutStore*)store atIndex:(int)index withPrefix:(NSString*) prefix
{
#ifdef SANDBOXING
return NO;
# else
if ( [store jcListCount] > index ) {
// Get text from clipping store.
NSString *pbFullText = [self clippingStringWithCount:index inStore:store];
@ -261,6 +264,7 @@
return YES;
}
return NO;
#endif
}
- (bool)saveFromStackToFavorites
@ -560,7 +564,7 @@
{
if ( [[NSUserDefaults standardUserDefaults] boolForKey:@"syncSettingsViaICloud"] ) {
[[MJCloudKitUserDefaultsSync sharedSync] startWithKeyMatchList:settingsSyncList
withContainerIdentifier:@"iCloud.com.mark-a-jerde.Flycut"];
withContainerIdentifier:kiCloudId];
}
else {
[[MJCloudKitUserDefaultsSync sharedSync] stopForKeyMatchList:settingsSyncList];
@ -589,7 +593,7 @@
[[MJCloudKitUserDefaultsSync sharedSync] addNotificationFor:MJSyncNotificationSaveSuccess withSelector:@selector(checkPreferencesSaveSuccess:) withTarget: self];
[[MJCloudKitUserDefaultsSync sharedSync] startWithKeyMatchList:@[@"store"]
withContainerIdentifier:@"iCloud.com.mark-a-jerde.Flycut"];
withContainerIdentifier:kiCloudId];
}
else {
[[MJCloudKitUserDefaultsSync sharedSync] removeNotificationsFor:MJSyncNotificationChanges forTarget:self];

View file

@ -5,6 +5,8 @@
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#define kiCloudId @"iCloud.com.generalarcade.flycut"
#ifdef DEBUG
# define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else

Binary file not shown.