Commit 74fe20cf authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Andreas Traczyk

app store: support sandboxing

- remove unnecessary entitlements
- save recorded calls and incoming files in the app folder.

Change-Id: Id2852f7cac65a1d75c76ed907a697dd0e1f5d069
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent b88d27f2
......@@ -4,18 +4,10 @@
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.assets.movies.read-write</key>
<true/>
<key>com.apple.security.assets.music.read-write</key>
<true/>
<key>com.apple.security.assets.pictures.read-write</key>
<true/>
<key>com.apple.security.device.camera</key>
<true/>
<key>com.apple.security.device.microphone</key>
<true/>
<key>com.apple.security.files.downloads.read-write</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.network.client</key>
......
......@@ -33,15 +33,23 @@
@property (assign) IBOutlet NSPopUpButton *inputDeviceList;
@property (assign) IBOutlet NSButton *alwaysRecordingButton;
@property (assign) IBOutlet NSButton *muteDTMFButton;
@property (assign) IBOutlet NSTextField *recordingHeaderTitle;
@property (assign) IBOutlet NSTextField *recordingpathLabel;
@property (assign) IBOutlet NSLayoutConstraint* audioMarginTopConstraint;
@property (assign) IBOutlet NSLayoutConstraint* audioMarginBottomConstraint;
@end
@implementation AudioPrefsVC
@synthesize recordingsPathControl;
@synthesize recordingsPathControl, recordingHeaderTitle, recordingpathLabel;
@synthesize outputDeviceList;
@synthesize inputDeviceList;
@synthesize alwaysRecordingButton;
@synthesize muteDTMFButton;
@synthesize audioMarginTopConstraint, audioMarginBottomConstraint;
- (void)loadView
{
......@@ -62,6 +70,16 @@
Audio::Settings::instance().areDTMFMuted()?NSOnState:NSOffState];
NSArray* pathComponentArray = [self pathComponentArrayWithCurrentUrl:Media::RecordingModel::instance().recordPath().toNSString()];
[recordingsPathControl setPathComponentCells:pathComponentArray];
if (appSandboxed()) {
[alwaysRecordingButton setHidden:YES];
[recordingsPathControl setEnabled:NO];
[recordingsPathControl setHidden: YES];
[recordingHeaderTitle setHidden: YES];
[recordingpathLabel setHidden: YES];
audioMarginTopConstraint.constant = 10.0f;
audioMarginBottomConstraint.constant = 67.0f;
}
}
- (IBAction)toggleMuteDTMF:(NSButton *)sender
......@@ -171,10 +189,7 @@
}
- (BOOL) panel:(id)sender shouldEnableURL:(NSURL*)url {
if(!appSandboxed()) {
return YES;
}
return isUrlAccessibleFromSandbox(url);
return YES;
}
#pragma mark - NSMenuDelegate methods
......
......@@ -56,6 +56,7 @@
__unsafe_unretained IBOutlet NSTextField* profileNameField;
__unsafe_unretained IBOutlet NSImageView* addProfilePhotoImage;
__unsafe_unretained IBOutlet NSButton *downloadFolder;
__unsafe_unretained IBOutlet NSTextField *downloadFolderLabel;
}
@end
......@@ -115,6 +116,12 @@
[photoView setBordered:NO];
}
}
if (appSandboxed()) {
[downloadFolder setHidden:YES];
[downloadFolder setEnabled:NO];
[downloadFolderLabel setHidden: YES];
return;
}
if (dataTransferModel) {
downloadFolder.title = [@(dataTransferModel->downloadDirectory.c_str()) lastPathComponent];
}
......@@ -276,10 +283,7 @@
#pragma mark - NSOpenSavePanelDelegate delegate methods
- (BOOL) panel:(id)sender shouldEnableURL:(NSURL*)url {
if(!appSandboxed()) {
return YES;
}
return isUrlAccessibleFromSandbox(url);
return YES;
}
@end
......@@ -40,6 +40,7 @@
#import <api/contactmodel.h>
#import <api/contact.h>
#import <api/datatransfermodel.h>
#import <media/recordingmodel.h>
// Ring
#import "AppDelegate.h"
......@@ -53,6 +54,7 @@
#import "views/NSColor+RingTheme.h"
#import "views/BackgroundView.h"
#import "ChooseAccountVC.h"
#import "utils.h"
@interface RingWindowController () <MigrateRingAccountsDelegate, NSToolbarDelegate>
......@@ -124,16 +126,17 @@ NSString* const kChangeAccountToolBarItemIdentifier = @"ChangeAccountToolBarIte
NSToolbar *toolbar = self.window.toolbar;
toolbar.delegate = self;
[toolbar insertItemWithItemIdentifier:kChangeAccountToolBarItemIdentifier atIndex:1];
// set download folder (default - 'Downloads')
// set download folder (default - 'Documents')
NSString* path = [[NSUserDefaults standardUserDefaults] stringForKey:Preferences::DownloadFolder];
if (!path || path.length == 0) {
NSURL *downloadsURL = [[NSFileManager defaultManager]
URLForDirectory:NSDownloadsDirectory
inDomain:NSUserDomainMask appropriateForURL:nil
create:YES error:nil];
path = [[downloadsURL path] stringByAppendingString:@"/"];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
path = [[paths objectAtIndex:0] stringByAppendingString:@"/"];
}
lrc_->getDataTransferModel().downloadDirectory = std::string([path UTF8String]);
if(appSandboxed()) {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
Media::RecordingModel::instance().setRecordPath(QString::fromNSString([paths objectAtIndex:0]));
}
}
- (void) connect
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14109" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14113" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14109"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
<capability name="Alignment constraints to the first baseline" minToolsVersion="6.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
......@@ -9,9 +9,13 @@
<customObject id="-2" userLabel="File's Owner" customClass="AudioPrefsVC">
<connections>
<outlet property="alwaysRecordingButton" destination="kOg-hX-1Q5" id="n6R-hv-JLY"/>
<outlet property="audioMarginBottomConstraint" destination="Oln-9b-2Ri" id="gcF-44-IOP"/>
<outlet property="audioMarginTopConstraint" destination="Fo0-5T-cmf" id="oRv-y8-en7"/>
<outlet property="inputDeviceList" destination="bK9-uH-jDb" id="zhZ-Cr-n6B"/>
<outlet property="muteDTMFButton" destination="Jyg-5H-Ygw" id="PDq-aH-ieL"/>
<outlet property="outputDeviceList" destination="9SA-9E-IzQ" id="YpE-Fz-J8P"/>
<outlet property="recordingHeaderTitle" destination="ftI-JV-7cE" id="pKF-X5-Ykn"/>
<outlet property="recordingpathLabel" destination="She-fN-vzD" id="DKZ-Ln-xNz"/>
<outlet property="recordingsPathControl" destination="nyE-tZ-v4C" id="4cw-pY-c3Z"/>
<outlet property="view" destination="deY-JV-Rfe" id="ebJ-o2-NpL"/>
</connections>
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14109" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14113" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14109"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
......@@ -10,6 +10,7 @@
<outlet property="addProfilePhotoImage" destination="3l7-TU-AMG" id="oQC-jN-JV0"/>
<outlet property="checkIntervalPopUp" destination="RYP-3d-PCa" id="JNO-GR-CV8"/>
<outlet property="downloadFolder" destination="7bY-JW-z0U" id="ylD-Yb-I2N"/>
<outlet property="downloadFolderLabel" destination="IHD-1X-sid" id="XnP-ui-hIA"/>
<outlet property="historyChangedLabel" destination="Gyi-ID-Z3v" id="aoO-Fh-UCQ"/>
<outlet property="historyStepper" destination="QmA-ZI-ZL5" id="dDV-1G-rZs"/>
<outlet property="historySwitch" destination="DgD-2y-4g5" id="GYk-pz-jGT"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment