├── FileCopyDemo
├── dropzone.png
├── main.m
├── FileCopyDemo.entitlements
├── DestinationViewController.h
├── SourceViewController.h
├── AppDelegate.h
├── FileCopyCell.h
├── Images.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── FileCopyCell.m
├── Info.plist
├── FileCopyViewController.h
├── FileCopyManager.h
├── FileCopyManager.m
├── QueueWindowController.h
├── SourceViewController.m
├── DestinationViewController.m
├── AppDelegate.m
├── FileCopyOperation.h
├── FileCopyOperation.m
├── FileCopyViewController.m
├── QueueWindowController.m
├── Queue.xib
├── FileCopyWindow.xib
└── Base.lproj
│ └── MainMenu.xib
├── FileCopyDemo.xcodeproj
├── xcuserdata
│ └── LAROD.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── FileCopyDemo.xcscheme
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── LAROD.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
└── project.pbxproj
├── FileCopyDemoTests
├── Info.plist
└── FileCopyDemoTests.m
├── README.md
└── License
/FileCopyDemo/dropzone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larod/FileCopyDemo/HEAD/FileCopyDemo/dropzone.png
--------------------------------------------------------------------------------
/FileCopyDemo.xcodeproj/xcuserdata/LAROD.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/FileCopyDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/FileCopyDemo.xcodeproj/project.xcworkspace/xcuserdata/LAROD.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/larod/FileCopyDemo/HEAD/FileCopyDemo.xcodeproj/project.xcworkspace/xcuserdata/LAROD.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/FileCopyDemo/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // FileCopyDemo
4 | //
5 | // Created by LAROD on 4/1/15.
6 | // Copyright (c) 2015 LAR0d. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | int main(int argc, const char * argv[]) {
12 | return NSApplicationMain(argc, argv);
13 | }
14 |
--------------------------------------------------------------------------------
/FileCopyDemo/FileCopyDemo.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.files.bookmarks.app-scope
8 |
9 | com.apple.security.files.user-selected.read-write
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/FileCopyDemo.xcodeproj/xcuserdata/LAROD.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | FileCopyDemo.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 78DA0FB01ACCB728001D3D57
16 |
17 | primary
18 |
19 |
20 | 78DA0FC31ACCB728001D3D57
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/FileCopyDemo/DestinationViewController.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2015 Luis A. Rodríguez-Rivera
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | #import
18 |
19 | @interface DestinationViewController : NSView
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/FileCopyDemo/SourceViewController.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2015 Luis A. Rodríguez-Rivera
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | #import
18 | #import
19 |
20 | @interface SourceViewController : NSView
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/FileCopyDemoTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | com.larod.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/FileCopyDemoTests/FileCopyDemoTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // FileCopyDemoTests.m
3 | // FileCopyDemoTests
4 | //
5 | // Created by LAROD on 4/1/15.
6 | // Copyright (c) 2015 LAR0d. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface FileCopyDemoTests : XCTestCase
13 |
14 | @end
15 |
16 | @implementation FileCopyDemoTests
17 |
18 | - (void)setUp {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown {
24 | // Put teardown code here. This method is called after the invocation of each test method in the class.
25 | [super tearDown];
26 | }
27 |
28 | - (void)testExample {
29 | // This is an example of a functional test case.
30 | XCTAssert(YES, @"Pass");
31 | }
32 |
33 | - (void)testPerformanceExample {
34 | // This is an example of a performance test case.
35 | [self measureBlock:^{
36 | // Put the code you want to measure the time of here.
37 | }];
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/FileCopyDemo/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2015 Luis A. Rodríguez-Rivera
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | #import
18 | #import "QueueWindowController.h"
19 |
20 | @interface AppDelegate : NSObject
21 |
22 | @property (weak) IBOutlet NSTextField * sourceLabel; ///< GUI source label.
23 | @property (weak) IBOutlet NSTextField * destinationLabel; ///< GUI destination label.
24 |
25 | /**
26 | * Returns the QueueWindowController instance.
27 | */
28 | -(QueueWindowController*)getQueueController;
29 |
30 | @end
31 |
32 |
--------------------------------------------------------------------------------
/FileCopyDemo/FileCopyCell.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2015 Luis A. Rodríguez-Rivera
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | #import
18 |
19 | @class FileCopyOperation;
20 | /**
21 | * Custom class for rows containing FileCopyOperation objects.
22 | */
23 | @interface FileCopyCell : NSTableCellView
24 |
25 | @property (nonatomic, weak) IBOutlet NSTextField * fileName;
26 | @property (nonatomic, weak) IBOutlet NSTextField * status;
27 | @property (nonatomic, weak) IBOutlet NSTextField * totalBytes;
28 | @property (nonatomic, weak) IBOutlet NSProgressIndicator * progressBar;
29 | @property (nonatomic, weak) IBOutlet NSImageView * icon;
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/FileCopyDemo/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "mac",
5 | "size" : "16x16",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "mac",
10 | "size" : "16x16",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "mac",
15 | "size" : "32x32",
16 | "scale" : "1x"
17 | },
18 | {
19 | "idiom" : "mac",
20 | "size" : "32x32",
21 | "scale" : "2x"
22 | },
23 | {
24 | "idiom" : "mac",
25 | "size" : "128x128",
26 | "scale" : "1x"
27 | },
28 | {
29 | "idiom" : "mac",
30 | "size" : "128x128",
31 | "scale" : "2x"
32 | },
33 | {
34 | "idiom" : "mac",
35 | "size" : "256x256",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "mac",
40 | "size" : "256x256",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "mac",
45 | "size" : "512x512",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "mac",
50 | "size" : "512x512",
51 | "scale" : "2x"
52 | }
53 | ],
54 | "info" : {
55 | "version" : 1,
56 | "author" : "xcode"
57 | }
58 | }
--------------------------------------------------------------------------------
/FileCopyDemo/FileCopyCell.m:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2015 Luis A. Rodríguez-Rivera
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | #import "FileCopyCell.h"
18 | #import "FileCopyOperation.h"
19 | #import "AppDelegate.h"
20 |
21 | @implementation FileCopyCell
22 | @synthesize fileName;
23 | @synthesize status;
24 | @synthesize totalBytes;
25 | @synthesize icon;
26 | @synthesize progressBar;
27 |
28 | - (void)drawRect:(NSRect)dirtyRect {
29 | [super drawRect:dirtyRect];
30 | }
31 | -(IBAction)cancelOpr:(id)sender {
32 | NSButton *button = (NSButton*)sender;
33 | FileCopyOperation *opr = [(NSTableCellView*)[button superview]objectValue];
34 | [opr cancel];
35 | }
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/FileCopyDemo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | com.larod.$(PRODUCT_NAME:rfc1034identifier)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSMinimumSystemVersion
26 | $(MACOSX_DEPLOYMENT_TARGET)
27 | NSHumanReadableCopyright
28 | Copyright © 2015 LAR0d. All rights reserved.
29 | NSMainNibFile
30 | MainMenu
31 | NSPrincipalClass
32 | NSApplication
33 |
34 |
35 |
--------------------------------------------------------------------------------
/FileCopyDemo/FileCopyViewController.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2015 Luis A. Rodríguez-Rivera
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | #import
18 | #import "FileCopyOperation.h"
19 |
20 | @interface FileCopyViewController : NSWindowController
21 |
22 | /**
23 | * Creates a FileCopyOperation object with the parameters given and
24 | * adds the operation to the FileCopyManager fileCopyQueue.
25 | * @param source The source URL.
26 | * @param destination The destination URL.
27 | * @see FileCopyManager
28 | * @see FileCopyOperation
29 | * @return void
30 | */
31 | -(void)addFileCopyOperationWithSource:(NSURL*)source andDestination:(NSURL*)destination;
32 |
33 | /**
34 | * Removes the FileCopyOperation represented object from the table view and the fileCopyOperations array.
35 | * @param object The object to be removed.
36 | */
37 | -(void)removeObject:(id)object;
38 | @end
39 |
--------------------------------------------------------------------------------
/FileCopyDemo/FileCopyManager.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2015 Luis A. Rodríguez-Rivera
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | #import
18 | #import
19 | #import "FileCopyOperation.h"
20 |
21 | @interface FileCopyManager : NSObject
22 |
23 | @property (nonatomic, strong, readonly) NSOperationQueue * fileCopyQueue; ///< Holds all FileCopyOperation objects.
24 |
25 | /**
26 | * Returns the shared file copy manager object for the process.
27 | * This method always returns the same file copy manager object.
28 | * @return The default FileCopyManager object.
29 | */
30 | +(instancetype)sharedFileCopyManager;
31 |
32 | /**
33 | * Adds a FileCopyOperation object to the fileCopyQueue.
34 | * @param opr The FileCopyOperation to add to the fileCopyQueue.
35 | */
36 | -(void)addOPeration:(FileCopyOperation*)opr;
37 |
38 | /**
39 | * Returns the maximum concurrent FileCopyOperation objects.
40 | * @return The maximum count of FileCopyOperation objects that can run concurrently.
41 | */
42 | -(int)maxConcurrentOperations;
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/FileCopyDemo/FileCopyManager.m:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2015 Luis A. Rodríguez-Rivera
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | #import "FileCopyManager.h"
18 | #import "FileCopyOperation.h"
19 | #import
20 | #define MAX_CONCURRENT_OPERATIONS 4
21 |
22 | @implementation FileCopyManager
23 | @synthesize fileCopyQueue;
24 |
25 | +(instancetype)sharedFileCopyManager {
26 | static FileCopyManager *sharedFileCopyManager = nil;
27 | static dispatch_once_t onceToken;
28 |
29 | dispatch_once(&onceToken, ^{
30 | sharedFileCopyManager = [[[self class]alloc]init];
31 | });
32 | return sharedFileCopyManager;
33 | }
34 | -(instancetype)init {
35 | self = [super init];
36 | if (self) {
37 | fileCopyQueue = [NSOperationQueue new];
38 | [fileCopyQueue setMaxConcurrentOperationCount:MAX_CONCURRENT_OPERATIONS];
39 | }
40 | return self;
41 | }
42 | -(void)addOPeration:(FileCopyOperation*)opr {
43 | [fileCopyQueue addOperation:opr];
44 | }
45 | -(int)maxConcurrentOperations {
46 | return MAX_CONCURRENT_OPERATIONS;
47 | }
48 | @end
49 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # FileCopyManager
2 | Welcome To My FileCopyManager Project
3 |
4 | Apple hasn't provided an API for a file copy operation with progress callback. The only option devs have to get this functionality is to use a lower level API, in this case copyfile(3). As always, Apple's documentation is scarce and there are no real examples on how to use this API to achieve the desired functionality. I started to work on this project with the goal of creating a couple of classes that could be easily integrated with any project and provide that familiar Finder's file copy manager. This project is not perfect and needs some work but is a start. It works well with files, I haven't tested or implemented folder handling yet. Is still a work in progress but if you want to contribute you are more than welcome to do so. The FileOperation class that wraps copyfile(3) is based on the implementation of @rustle, you can get it here, I highly recommend to study his project. Rustle's implementation is geared towards a terminal application but the FileCopyOperation class is more complete and can handle folders.
5 |
6 | I spent many hours trying to save people's time, if you wish to contribute you are more than welcome to do so. If you have any comments or ways to make this project better please send me a note. Thanks!
7 |
8 | I have added another file copy window to the application, you can now choose between two styles of copy managers. You'll need to restart the application when switching modes.
9 |
10 | Here is the main window, you can select which mode you want to use.
11 |
12 |
13 | The Queue will resize the window dynamically.
14 |
15 |
16 | The FileCopyWindow shows you the amount of operations on queue and has a button to cancel all operations.
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/FileCopyDemo/QueueWindowController.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2015 Luis A. Rodríguez-Rivera
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | #import
18 | #import "FileCopyOperation.h"
19 |
20 | @class FileCopyManager;
21 | /**
22 | * Main queue controller for adding, removing or cancelling FileCopyOperations.
23 | */
24 | @interface QueueWindowController : NSWindowController
25 |
26 | @property (nonatomic) NSMutableArray * fileCopyOperations; ///< Holds all FileCopyOperations objects for progress tracking and cleaning up purposes.
27 |
28 | /**
29 | * Creates a FileCopyOperation object with the parameters given and
30 | * adds the operation to the FileCopyManager's FileCopyQueue.
31 | * @param source The source URL.
32 | * @param destination The destination URL.
33 | * @see FileCopyManager
34 | * @see FileCopyOperation
35 | * @return void
36 | */
37 | - (void)addFileCopyOperationWithSource:(NSURL*)source andDestination:(NSURL*)destination;
38 |
39 | /**
40 | * Cancels all queued and executing operations currently on the FileCopyManager's FileCopyQueue.
41 | * @see FileCopyManager
42 | */
43 | - (void)cancelAllOperations;
44 |
45 | /**
46 | * Removes the FileCopyOperation represented object from the table view and the fileCopyOperations array.
47 | * @param object The object to be removed.
48 | */
49 | - (void)removeObject:(id)object;
50 | @end
51 |
--------------------------------------------------------------------------------
/FileCopyDemo/SourceViewController.m:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2015 Luis A. Rodríguez-Rivera
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | #import "SourceViewController.h"
18 | #import "AppDelegate.h"
19 |
20 | @implementation SourceViewController
21 |
22 | -(void)awakeFromNib {
23 | //NSLog(@"%s",__func__);
24 | [self registerForDraggedTypes:[NSArray arrayWithObject:NSURLPboardType]];
25 | self.wantsLayer = YES;
26 | self.layer.contents = [[NSImage alloc]initWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"dropzone" ofType:@"png"]];
27 | }
28 | -(NSDragOperation)draggingEntered:(id)sender {
29 | NSPasteboard *pboard = [sender draggingPasteboard];
30 | NSArray *pboardClasses = @[[NSURL class]];
31 | NSDictionary *pboardDictionary = @{NSPasteboardURLReadingFileURLsOnlyKey: @YES};
32 | NSArray *pboardObjects = [pboard readObjectsForClasses:pboardClasses options:pboardDictionary];
33 |
34 | if (pboardObjects.count == 1) {
35 | NSURL *url = [pboardObjects firstObject];
36 | if (![self isDirectory:url]) {
37 | return NSDragOperationCopy;
38 | } else {
39 | return NSDragOperationNone;
40 | }
41 | }
42 | return NSDragOperationNone;
43 | }
44 | -(BOOL)performDragOperation:(id)sender {
45 | NSURL *fileURL = [NSURL URLFromPasteboard:[sender draggingPasteboard]];
46 | AppDelegate *appDelegate = (AppDelegate*)[[NSApplication sharedApplication]delegate];
47 | [appDelegate.sourceLabel setStringValue:fileURL.path];
48 | return YES;
49 | }
50 | -(BOOL)isDirectory:(NSURL*)url {
51 | NSNumber *isDir;
52 | [url getResourceValue:&isDir forKey:NSURLIsDirectoryKey error:nil];
53 | if (isDir.boolValue) {
54 | return YES;
55 | } else {
56 | return NO;
57 | }
58 | }
59 | @end
60 |
--------------------------------------------------------------------------------
/FileCopyDemo/DestinationViewController.m:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2015 Luis A. Rodríguez-Rivera
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | #import "DestinationViewController.h"
18 | #import "AppDelegate.h"
19 |
20 | @implementation DestinationViewController
21 |
22 | -(void)awakeFromNib {
23 | //NSLog(@"%s",__func__);
24 | [self registerForDraggedTypes:[NSArray arrayWithObject:NSURLPboardType]];
25 | self.wantsLayer = YES;
26 | self.layer.contents = [[NSImage alloc]initWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"dropzone" ofType:@"png"]];
27 | }
28 | -(NSDragOperation)draggingEntered:(id)sender {
29 | NSPasteboard *pboard = [sender draggingPasteboard];
30 | NSArray *pboardClasses = @[[NSURL class]];
31 | NSDictionary *pboardDictionary = @{NSPasteboardURLReadingFileURLsOnlyKey: @YES};
32 | NSArray *pboardObjects = [pboard readObjectsForClasses:pboardClasses options:pboardDictionary];
33 |
34 | if (pboardObjects.count == 1) {
35 | NSURL *url = [pboardObjects firstObject];
36 | if ([self isDirectory:url]) {
37 | return NSDragOperationCopy;
38 | } else {
39 | return NSDragOperationNone;
40 | }
41 | }
42 | return NSDragOperationNone;
43 | }
44 | -(BOOL)performDragOperation:(id)sender {
45 | NSURL *fileURL = [NSURL URLFromPasteboard:[sender draggingPasteboard]];
46 | AppDelegate *appDelegate = (AppDelegate*)[[NSApplication sharedApplication]delegate];
47 | [appDelegate.destinationLabel setStringValue:fileURL.path];
48 | return YES;
49 | }
50 | -(BOOL)isDirectory:(NSURL*)url {
51 | NSNumber *isDir;
52 | [url getResourceValue:&isDir forKey:NSURLIsDirectoryKey error:nil];
53 | if (isDir.boolValue) {
54 | return YES;
55 | } else {
56 | return NO;
57 | }
58 | }
59 | @end
60 |
--------------------------------------------------------------------------------
/FileCopyDemo/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2015 Luis A. Rodríguez-Rivera
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | #import "AppDelegate.h"
18 | #import "QueueWindowController.h"
19 | #import "FileCopyViewController.h"
20 |
21 | @interface AppDelegate()
22 | @property (weak) IBOutlet NSButton * queueButton;
23 | @property (weak) IBOutlet NSButton * fileCopyButton;
24 | @end
25 |
26 | @implementation AppDelegate
27 | FileCopyViewController *_fileCopyViewController;
28 | QueueWindowController * _queueWindowController;
29 |
30 | -(IBAction)addQueueOperation:(id)sender {
31 | // ----------------------------------------------------------------------------------------------------
32 | // This is some lazy instantiation for the _queueWindorController
33 | // ----------------------------------------------------------------------------------------------------
34 | if (!_queueWindowController) {
35 | _queueWindowController = [[QueueWindowController alloc]initWithWindowNibName:@"Queue"];
36 | [_fileCopyButton setEnabled:NO];
37 | }
38 | [_queueWindowController showWindow:nil];
39 |
40 | // ----------------------------------------------------------------------------------------------------
41 | // Do your checks here, check if the file already exists and handle if the file should be
42 | // overwritten, or renamed.
43 | // Beyond this point [addFileCopyOperationWithSource:andDestination:] will only check if the urls are
44 | // reachable, if the file urls can be reached the operation will be queued.
45 | // ----------------------------------------------------------------------------------------------------
46 |
47 | [_queueWindowController addFileCopyOperationWithSource:[NSURL fileURLWithPath:_sourceLabel.stringValue] andDestination:[NSURL fileURLWithPath:_destinationLabel.stringValue]];
48 |
49 | }
50 | -(IBAction)addFileCopyWindowOperation:(id)sender {
51 | if (!_fileCopyViewController) {
52 | _fileCopyViewController = [[FileCopyViewController alloc]initWithWindowNibName:@"FileCopyWindow"];
53 | [_queueButton setEnabled:NO];
54 | }
55 | [_fileCopyViewController showWindow:nil];
56 |
57 | [_fileCopyViewController addFileCopyOperationWithSource:[NSURL fileURLWithPath:_sourceLabel.stringValue] andDestination:[NSURL fileURLWithPath:_destinationLabel.stringValue]];
58 | }
59 | -(QueueWindowController *)getQueueController {
60 | return _queueWindowController;
61 | }
62 | @end
63 |
--------------------------------------------------------------------------------
/FileCopyDemo/FileCopyOperation.h:
--------------------------------------------------------------------------------
1 | /*
2 | This implementation is based on the RSTLCopyOperation implementation
3 | created by Doug Russell Copyright (c) 2013 Doug Russell. All rights reserved.
4 |
5 | I modified that implementation to be more friendly to use with OS X 10.10 operation queues,
6 | I highly recommend everyone to study his implementation which is more complete and can
7 | handle folders. I added an additional protocol and more properties to make it easy for devs
8 | to update guis.
9 |
10 | Copyright 2015 Luis A. Rodríguez-Rivera
11 |
12 | Licensed under the Apache License, Version 2.0 (the "License");
13 | you may not use this file except in compliance with the License.
14 | You may obtain a copy of the License at
15 |
16 | http://www.apache.org/licenses/LICENSE-2.0
17 |
18 | Unless required by applicable law or agreed to in writing, software
19 | distributed under the License is distributed on an "AS IS" BASIS,
20 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 | See the License for the specific language governing permissions and
22 | limitations under the License.
23 | */
24 |
25 | #import
26 |
27 | typedef NS_ENUM(int8_t, FILE_COPY_STATE) {
28 | COPY_NOT_STARTED,
29 | COPY_IN_PROGRESS,
30 | COPY_FINISHED,
31 | COPY_FAILED,
32 | };
33 |
34 | // Delegate declaration
35 | @protocol FileCopyOperationDelegate;
36 |
37 | // FileCopyOperation interface
38 | @interface FileCopyOperation : NSOperation
39 |
40 | @property (nonatomic, readonly) NSURL * srcURL; ///< Source URL.
41 | @property (nonatomic, readonly) NSURL * dstURL; ///< Destination URL.
42 | @property (nonatomic, readonly) NSString * fName; ///< File name of the media being copied.
43 | @property (nonatomic, readonly) NSNumber * fSize; ///< File size of the file being copied.
44 | @property (nonatomic) NSNumber * bWritten; ///< Bytes written so far.
45 |
46 | @property (readonly) FILE_COPY_STATE fCopyState; ///< FileCopyOperation current state.
47 | @property (weak) id delegate; ///< FileCopyOperationDelegate.
48 | @property (readonly) int fCopyExitCode; ///< FileCopyOperation exit code.
49 |
50 | /**
51 | * Creates a new FileCopyOperationObject.
52 | * @param src Source URL.
53 | * @param dst Destination URL.
54 | * @param delegata The FileCopyOperationDelegate
55 | * @return A new FileCopyOperation object initialized with the parameters given.
56 | */
57 | - (instancetype)initWithSource:(NSURL *)src andDestination:(NSURL *)dst andDelegate:(id )delegate;
58 |
59 | @end
60 |
61 | /** Delegate implementation */
62 | @protocol FileCopyOperationDelegate
63 | @optional
64 | /**
65 | * This delegate method gets called when the FileCopyOperation is about to start.
66 | * Any GUI prep code goes here.
67 | * @param fileCopyOperation The FileCopyOperation object.
68 | */
69 | - (void)fileCopyOperationWillStart:(FileCopyOperation*)fileCopyOperation;
70 |
71 | /**
72 | * This delegate method gets called when the FileCopyOperation finishes.
73 | * Any cleanup code goes here.
74 | * @param fileCopyOperation The FileCopyOperation object.
75 | */
76 | - (void)fileCopyOperationDidFinished:(FileCopyOperation*)fileCopyOperation;
77 |
78 | /**
79 | * This delegate method gets called when FileCopyOperation writes data.
80 | * Is used to update file copy progress.
81 | * @param fileCopyOperation The FileCopyOperation object.
82 | */
83 | - (void)fileCopyOperationStatusUpdate:(FileCopyOperation*)fileCopyOperation;
84 | @end
85 |
--------------------------------------------------------------------------------
/FileCopyDemo.xcodeproj/xcuserdata/LAROD.xcuserdatad/xcschemes/FileCopyDemo.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
75 |
77 |
83 |
84 |
85 |
86 |
87 |
88 |
94 |
96 |
102 |
103 |
104 |
105 |
107 |
108 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/FileCopyDemo/FileCopyOperation.m:
--------------------------------------------------------------------------------
1 | /*
2 | This implementation is based on the RSTLCopyOperation implementation
3 | created by Doug Russell Copyright (c) 2013 Doug Russell. All rights reserved.
4 |
5 | I modified that implementation to be more friendly to use with OS X 10.10 operation queues,
6 | I highly recommend everyone to study his implementation which is more complete and can
7 | handle folders. I added an additional protocol and more properties to make it easy for devs
8 | to update guis.
9 |
10 | Copyright 2015 Luis A. Rodríguez-Rivera
11 |
12 | Licensed under the Apache License, Version 2.0 (the "License");
13 | you may not use this file except in compliance with the License.
14 | You may obtain a copy of the License at
15 |
16 | http://www.apache.org/licenses/LICENSE-2.0
17 |
18 | Unless required by applicable law or agreed to in writing, software
19 | distributed under the License is distributed on an "AS IS" BASIS,
20 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 | See the License for the specific language governing permissions and
22 | limitations under the License.
23 | */
24 |
25 | #import
26 | #import "FileCopyOperation.h"
27 | #import "FileCopyManager.h"
28 | #import "AppDelegate.h"
29 | #include "copyfile.h"
30 |
31 | @interface FileCopyOperation()
32 | @property FILE_COPY_STATE fCopyState;
33 | @property int fCopyExitCode;
34 | @end
35 |
36 | @implementation FileCopyOperation
37 |
38 | -(instancetype)initWithSource:(NSURL *)src andDestination:(NSURL *)dst andDelegate:(id )delegate {
39 | self = [super init];
40 | if (self) {
41 | _srcURL = src;
42 | _dstURL = dst;
43 | _fName = src.lastPathComponent;
44 |
45 | NSDictionary *fileInfo = [[NSFileManager defaultManager]attributesOfItemAtPath:src.path error:nil];
46 | _fSize = [fileInfo valueForKey:NSFileSize];
47 | _bWritten = [NSNumber numberWithLongLong:0];
48 |
49 | self.qualityOfService = NSQualityOfServiceUtility;
50 | self.queuePriority = NSOperationQueuePriorityNormal;
51 | self.delegate = delegate;
52 | }
53 | return self;
54 | }
55 | - (int)flags {
56 | // ----------------------------------------------------------------------------------------------------
57 | // Need to update flags if accepting directories.
58 | // ----------------------------------------------------------------------------------------------------
59 | int flags = COPYFILE_ALL | COPYFILE_NOFOLLOW;
60 | return flags;
61 | }
62 | static int copyFileCallback(int what, int stage, copyfile_state_t state, const char *sourcePath, const char *destPath, void *context) {
63 | // ----------------------------------------------------------------------------------------------------
64 | //
65 | // ----------------------------------------------------------------------------------------------------
66 | FileCopyOperation *self = (__bridge FileCopyOperation*)context;
67 | if ([self isCancelled]) {
68 | return COPYFILE_QUIT;
69 | }
70 |
71 | switch (what) {
72 | case COPYFILE_COPY_DATA:
73 | switch (stage) {
74 | case COPYFILE_PROGRESS: {
75 | off_t copiedBytes;
76 | const int returnCode = copyfile_state_get(state, COPYFILE_STATE_COPIED, &copiedBytes);
77 | if (returnCode == 0) {
78 | self.bWritten = [NSNumber numberWithLongLong:copiedBytes];
79 | } else {
80 | NSLog(@"Copyfile state error...");
81 | }
82 | }
83 | break;
84 |
85 | case COPYFILE_ERR: {
86 | NSLog(@"Copyfile data error...");
87 | }
88 | break;
89 | }
90 | break;
91 | }
92 | return COPYFILE_CONTINUE;
93 | }
94 | -(void)main {
95 | // ----------------------------------------------------------------------------------------------------
96 | //
97 | // ----------------------------------------------------------------------------------------------------
98 | [self.delegate respondsToSelector:@selector(fileCopyOperationWillStart:)] ? [self.delegate fileCopyOperationWillStart:self] : nil;
99 |
100 | self.fCopyState = COPY_IN_PROGRESS;
101 |
102 | copyfile_state_t copyFileState = copyfile_state_alloc();
103 | copyfile_state_set(copyFileState, COPYFILE_STATE_STATUS_CB, ©FileCallback);
104 | copyfile_state_set(copyFileState, COPYFILE_STATE_STATUS_CTX, (__bridge void*)self);
105 |
106 | const char *srcPath = [_srcURL.path fileSystemRepresentation];
107 | const char *dstPath = [_dstURL.path fileSystemRepresentation];
108 |
109 | self.fCopyExitCode = copyfile(srcPath, dstPath, copyFileState, [self flags]);
110 | self.fCopyState = (self.fCopyExitCode == 0) ? COPY_FINISHED : COPY_FAILED;
111 |
112 | [self.delegate respondsToSelector:@selector(fileCopyOperationDidFinished:)] ? [self.delegate fileCopyOperationDidFinished:self] : nil;
113 |
114 | copyfile_state_free(copyFileState);
115 | }
116 |
117 | @end
118 |
--------------------------------------------------------------------------------
/FileCopyDemo/FileCopyViewController.m:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2015 Luis A. Rodríguez-Rivera
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | #import "FileCopyViewController.h"
18 | #import "FileCopyManager.h"
19 | #import "FileCopyCell.h"
20 |
21 | @interface FileCopyViewController ()
22 | @property (weak) IBOutlet NSTableView * tableView;
23 | @property (weak) IBOutlet NSTextField * statusLabel;
24 | @property (nonatomic) NSMutableArray * fileCopyOperations;
25 | @end
26 |
27 | @implementation FileCopyViewController
28 | FileCopyManager * fileCopyManager;
29 | NSTimer *updateTimer;
30 |
31 | -(void)windowDidLoad {
32 | [super windowDidLoad];
33 | _fileCopyOperations = [NSMutableArray new];
34 | if (!fileCopyManager) {
35 | fileCopyManager = [FileCopyManager sharedFileCopyManager];
36 | [fileCopyManager.fileCopyQueue addObserver:self forKeyPath:@"operationCount" options:NSKeyValueObservingOptionNew context:(void*)fileCopyManager];
37 | }
38 | }
39 | -(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
40 | // ----------------------------------------------------------------------------------------------------
41 | // If I let each operation notify when it has new data, they will slow down the app considerably with
42 | // many [tableView reloadData] messages. Instead if there are operations in the queue I update the
43 | // table every 1ms. If there are no more operations in queue the window will close and the timer will
44 | // get invalidated.
45 | // ----------------------------------------------------------------------------------------------------
46 | if (fileCopyManager.fileCopyQueue.operationCount == 0) {
47 | if (updateTimer) {
48 | [updateTimer invalidate];
49 | }
50 | [_statusLabel performSelectorOnMainThread:@selector(setStringValue:) withObject:@"" waitUntilDone:NO];
51 | [self performSelectorOnMainThread:@selector(close) withObject:nil waitUntilDone:NO];
52 | } else {
53 | updateTimer = [NSTimer scheduledTimerWithTimeInterval:0.1f target:self selector:@selector(updateProgress:) userInfo:nil repeats:YES];
54 | }
55 | }
56 | -(void)updateProgress:(id)sender {
57 | dispatch_async(dispatch_get_main_queue(), ^{
58 | [_tableView reloadData];
59 | [_statusLabel performSelectorOnMainThread:@selector(setStringValue:) withObject:[NSString stringWithFormat:@"%@ operations",[NSNumber numberWithLong:fileCopyManager.fileCopyQueue.operations.count]] waitUntilDone:NO];
60 | });
61 | }
62 | -(void)addFileCopyOperationWithSource:(NSURL *)source andDestination:(NSURL *)destination {
63 | NSError *srcError, *dstError;
64 | // ----------------------------------------------------------------------------------------------------
65 | // This method checks if the source and destination urls are reachable and creates a FileCopyOperation
66 | // once the operation is created is added to the queue using [fileCopyManager addOperation:].
67 | // ----------------------------------------------------------------------------------------------------
68 | if ([source checkResourceIsReachableAndReturnError:&srcError] && [destination checkResourceIsReachableAndReturnError:&dstError]) {
69 | FileCopyOperation *opr = [[FileCopyOperation alloc]initWithSource:source andDestination:[NSURL fileURLWithPath:[destination.path stringByAppendingPathComponent:source.lastPathComponent] isDirectory:NO] andDelegate:self];
70 | [fileCopyManager addOPeration:opr];
71 | } else {
72 | srcError ? [NSAlert alertWithError:srcError] : nil;
73 | dstError ? [NSAlert alertWithError:dstError] : nil;
74 | }
75 | }
76 | -(IBAction)cancelAllOperations:(id)sender {
77 | [fileCopyManager.fileCopyQueue cancelAllOperations];
78 | }
79 | -(void)removeObject:(id)object {
80 | // ----------------------------------------------------------------------------------------------------
81 | // This method is called from -(void)fileCopyOperationDidFinished:(FileCopyOperation *)fileCopyOperation
82 | // it finds the index of the object to be removed, if is found it removes the row from the table and
83 | // the _fileCopyOperations array.
84 | // ----------------------------------------------------------------------------------------------------
85 | NSInteger row = [_fileCopyOperations indexOfObject:object];
86 | if (row != NSNotFound) {
87 | [_tableView removeRowsAtIndexes:[NSIndexSet indexSetWithIndex:row] withAnimation:NSTableViewAnimationEffectNone];
88 | [_fileCopyOperations removeObject:object];
89 | }
90 | }
91 | #pragma mark FileCopyOperationDelegate
92 | -(void)fileCopyOperationWillStart:(FileCopyOperation *)fileCopyOperation {
93 | [_fileCopyOperations performSelectorOnMainThread:@selector(addObject:) withObject:fileCopyOperation waitUntilDone:YES];
94 | }
95 | -(void)fileCopyOperationDidFinished:(FileCopyOperation *)fileCopyOperation {
96 | [self performSelectorOnMainThread:@selector(removeObject:) withObject:fileCopyOperation waitUntilDone:YES];
97 | }
98 | #pragma mark NSTableView
99 | -(NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
100 | return [_fileCopyOperations count];
101 | }
102 | -(id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
103 | return [_fileCopyOperations objectAtIndex:row];
104 | }
105 | -(NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
106 | FileCopyCell *cell = [tableView makeViewWithIdentifier:@"FileOperationCell" owner:self];
107 | FileCopyOperation *opr = [_fileCopyOperations objectAtIndex:row];
108 |
109 | [cell.fileName setStringValue:[NSString stringWithFormat:@"Copying \"%@\"",opr.fName]];
110 | [cell.progressBar setDoubleValue:((opr.bWritten.doubleValue / opr.fSize.doubleValue) * 100)];
111 | [cell.totalBytes setStringValue:[NSString stringWithFormat:@"of %@",[NSByteCountFormatter stringFromByteCount:opr.fSize.longLongValue countStyle:NSByteCountFormatterCountStyleFile]]];
112 | // At some point add time left to the status (Time remainig (elapsedTime/data processed) * dataLeft = timeLeft).
113 | [cell.status setStringValue:[NSString stringWithFormat:@"%@",[NSByteCountFormatter stringFromByteCount:opr.bWritten.longLongValue countStyle:NSByteCountFormatterCountStyleFile]]];
114 | [cell.icon setImage:[[NSWorkspace sharedWorkspace]iconForFile:opr.srcURL.path]];
115 | return cell;
116 | }
117 | @end
118 |
--------------------------------------------------------------------------------
/FileCopyDemo/QueueWindowController.m:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2015 Luis A. Rodríguez-Rivera
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | #import "QueueWindowController.h"
18 | #import "FileCopyOperation.h"
19 | #import "FileCopyManager.h"
20 | #import "FileCopyCell.h"
21 |
22 | #define TABLE_BUFFER 2
23 | #define ROW_HEIGHT 60
24 |
25 | @interface QueueWindowController ()
26 | @property (weak) IBOutlet NSTableView * tableView;
27 | @property (weak) IBOutlet NSScrollView * scrollView;
28 | @end
29 |
30 | @implementation QueueWindowController
31 | int rows;
32 | NSTimer *updateTimer;
33 | NSRect windowFrame;
34 | FileCopyManager * fileCopyManager;
35 |
36 | #pragma mark Class Methods
37 | -(void)windowDidLoad {
38 | [super windowDidLoad];
39 | _fileCopyOperations = [NSMutableArray new];
40 | windowFrame = [self.window frame];
41 | rows = 0;
42 |
43 | // ----------------------------------------------------------------------------------------------------
44 | // Use this line of code if loading an external nib for a row.
45 | // You'll need to call [tableView makeViewWithIdentifier:@"FileCopyCell" owner:self] in
46 | // -(NSView *)tableView:(NSTableView *)tableView
47 | // viewForTableColumn:(NSTableColumn *)tableColumn
48 | // row:(NSInteger)row
49 | //[_tableView registerNib:[[NSNib alloc]initWithNibNamed:@"FileCopyCell" bundle:nil] forIdentifier:@"FileCopyCell"];
50 | // ----------------------------------------------------------------------------------------------------
51 |
52 | // ----------------------------------------------------------------------------------------------------
53 | // This a lazy instantiation of the singleton [FileCopyManager sharedFileCopyManager] the observer
54 | // keeps track of the number of operations in queue. I use it to size the window as additional
55 | // operations are added.
56 | // ----------------------------------------------------------------------------------------------------
57 | if (!fileCopyManager) {
58 | fileCopyManager = [FileCopyManager sharedFileCopyManager];
59 | [fileCopyManager.fileCopyQueue addObserver:self forKeyPath:@"operationCount" options:NSKeyValueObservingOptionNew context:(void*)fileCopyManager];
60 | }
61 | }
62 | -(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
63 | // ----------------------------------------------------------------------------------------------------
64 | // If I let each operation notify when it has new data, they will slow down the app considerably with
65 | // many [tableView reloadData] messages. Instead if there are operations in the queue I update the
66 | // table every 1ms. If there are no more operations in queue the window will close and the timer will
67 | // get invalidated.
68 | // ----------------------------------------------------------------------------------------------------
69 | if (fileCopyManager.fileCopyQueue.operationCount == 0) {
70 | if (updateTimer) {
71 | [updateTimer invalidate];
72 | }
73 | dispatch_async(dispatch_get_main_queue(), ^{
74 | [self close];
75 | [self.window setFrame:windowFrame display:NO animate:NO];
76 | });
77 | } else {
78 | updateTimer = [NSTimer scheduledTimerWithTimeInterval:0.1f target:self selector:@selector(updateProgress:) userInfo:nil repeats:YES];
79 | }
80 | }
81 | -(void)updateProgress:(id)sender {
82 | dispatch_async(dispatch_get_main_queue(), ^{
83 | [_tableView reloadData];
84 | });
85 | }
86 | -(void)addFileCopyOperationWithSource:(NSURL *)source andDestination:(NSURL *)destination {
87 | NSError *srcError, *dstError;
88 | // ----------------------------------------------------------------------------------------------------
89 | // This method checks if the source and destination urls are reachable and creates a FileCopyOperation
90 | // once the operation is created is added to the queue using [fileCopyManager addOperation:].
91 | // ----------------------------------------------------------------------------------------------------
92 | if ([source checkResourceIsReachableAndReturnError:&srcError] && [destination checkResourceIsReachableAndReturnError:&dstError]) {
93 | FileCopyOperation *opr = [[FileCopyOperation alloc]initWithSource:source andDestination:[NSURL fileURLWithPath:[destination.path stringByAppendingPathComponent:source.lastPathComponent] isDirectory:NO] andDelegate:self];
94 | [fileCopyManager addOPeration:opr];
95 | } else {
96 | srcError ? [NSAlert alertWithError:srcError] : nil;
97 | dstError ? [NSAlert alertWithError:dstError] : nil;
98 | }
99 | }
100 | -(void)cancelAllOperations {
101 | [fileCopyManager.fileCopyQueue cancelAllOperations];
102 | }
103 | -(void)removeObject:(id)object {
104 | // ----------------------------------------------------------------------------------------------------
105 | // This method is called from -(void)fileCopyOperationDidFinished:(FileCopyOperation *)fileCopyOperation
106 | // it finds the index of the object to be removed, if is found it removes the row from the table and
107 | // the _fileCopyOperations array.
108 | // ----------------------------------------------------------------------------------------------------
109 | NSInteger row = [_fileCopyOperations indexOfObject:object];
110 | if (row != NSNotFound) {
111 | [_tableView removeRowsAtIndexes:[NSIndexSet indexSetWithIndex:row] withAnimation:NSTableViewAnimationEffectNone];
112 | [_fileCopyOperations removeObject:object];
113 | }
114 | }
115 |
116 | // ----------------------------------------------------------------------------------------------------
117 | // These two methods are used to increase or decrase the size of the window depending on how many
118 | // rows are visible in the tableView. They are called from the FileCopyOperationDelegate methods.
119 | // ----------------------------------------------------------------------------------------------------
120 | -(void)addRowSpace:(id)sender {
121 | NSRect frame = [self.window frame];
122 | frame.origin.y -= (ROW_HEIGHT - TABLE_BUFFER);
123 | frame.size.height += (ROW_HEIGHT - TABLE_BUFFER);
124 | [self.window setFrame:frame display:YES animate:YES];
125 | }
126 | -(void)removeRowSpace:(id)sender {
127 | NSRect frame = [self.window frame];
128 | frame.origin.y += (ROW_HEIGHT - TABLE_BUFFER);
129 | frame.size.height -= (ROW_HEIGHT - TABLE_BUFFER);
130 | [self.window setFrame:frame display:YES animate:YES];
131 | }
132 | #pragma mark FileCopyOperationDelegate
133 | -(void)fileCopyOperationWillStart:(FileCopyOperation *)fileCopyOperation {
134 | // ----------------------------------------------------------------------------------------------------
135 | // This method is called before the [copyfile] actualy starts, the operation is added to the
136 | // _fileCopyOperations array, [addRowSpace:] sizes the window in proportion to the current operations.
137 | // For example if two rows are visible and a third operation is added the window will be sized to
138 | // accommodate three rows.
139 | // ----------------------------------------------------------------------------------------------------
140 | [_fileCopyOperations performSelectorOnMainThread:@selector(addObject:) withObject:fileCopyOperation waitUntilDone:YES];
141 | ++rows;
142 | if (rows > 1 && rows <= [fileCopyManager maxConcurrentOperations]) {
143 | [self performSelectorOnMainThread:@selector(addRowSpace:) withObject:nil waitUntilDone:NO];
144 | }
145 | }
146 | -(void)fileCopyOperationDidFinished:(FileCopyOperation *)fileCopyOperation {
147 | // ----------------------------------------------------------------------------------------------------
148 | // This method is called after the [copyfile:] is finished, it allows the queueController to clean
149 | // things up. First it calls [removeRowSpace:] to size the window depending on how many operations
150 | // are left in queue and then it calls [removeObject:] to clean the GUI.
151 | // ----------------------------------------------------------------------------------------------------
152 | --rows;
153 | if (rows > 0) {
154 | [self performSelectorOnMainThread:@selector(removeRowSpace:) withObject:nil waitUntilDone:NO];
155 | }
156 | [self performSelectorOnMainThread:@selector(removeObject:) withObject:fileCopyOperation waitUntilDone:YES];
157 | }
158 | #pragma mark NSTableView
159 | // ----------------------------------------------------------------------------------------------------
160 | // These need no explanation, NSTableViewDatasource and NSTableViewDelegate methods.
161 | // ----------------------------------------------------------------------------------------------------
162 | -(NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
163 | return [_fileCopyOperations count];
164 | }
165 | -(id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
166 | return [_fileCopyOperations objectAtIndex:row];
167 | }
168 | -(NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
169 | FileCopyCell *cell = [tableView makeViewWithIdentifier:@"FileOperationCell" owner:self];
170 | FileCopyOperation *opr = [_fileCopyOperations objectAtIndex:row];
171 |
172 | [cell.fileName setStringValue:[NSString stringWithFormat:@"Copying \"%@\"",opr.fName]];
173 | [cell.progressBar setDoubleValue:((opr.bWritten.doubleValue / opr.fSize.doubleValue) * 100)];
174 | [cell.totalBytes setStringValue:[NSString stringWithFormat:@"of %@",[NSByteCountFormatter stringFromByteCount:opr.fSize.longLongValue countStyle:NSByteCountFormatterCountStyleFile]]];
175 | // At some point add time left to the status (Time remainig (elapsedTime/data processed) * dataLeft = timeLeft).
176 | [cell.status setStringValue:[NSString stringWithFormat:@"%@",[NSByteCountFormatter stringFromByteCount:opr.bWritten.longLongValue countStyle:NSByteCountFormatterCountStyleFile]]];
177 | [cell.icon setImage:[[NSWorkspace sharedWorkspace]iconForFile:opr.srcURL.path]];
178 | return cell;
179 | }
180 |
181 | @end
182 |
--------------------------------------------------------------------------------
/License:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright 2015 Luis A. Rodríguez-Rivera
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/FileCopyDemo/Queue.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
--------------------------------------------------------------------------------
/FileCopyDemo/FileCopyWindow.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
--------------------------------------------------------------------------------
/FileCopyDemo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 782F37DE1AD5519200A6296A /* QueueWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 782F37DD1AD5519200A6296A /* QueueWindowController.m */; };
11 | 7848424E1B1E0669009CE4D1 /* README.md in Sources */ = {isa = PBXBuildFile; fileRef = 7848424D1B1E0669009CE4D1 /* README.md */; };
12 | 787B4EAB1ACD3BEE00EDCC92 /* FileCopyManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 787B4EAA1ACD3BEE00EDCC92 /* FileCopyManager.m */; };
13 | 787B4EAE1ACD597900EDCC92 /* FileCopyOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 787B4EAD1ACD597900EDCC92 /* FileCopyOperation.m */; };
14 | 787B4EB11ACE0F2500EDCC92 /* Queue.xib in Resources */ = {isa = PBXBuildFile; fileRef = 787B4EB01ACE0F2500EDCC92 /* Queue.xib */; };
15 | 787B4EBC1ACE7E3300EDCC92 /* dropzone.png in Resources */ = {isa = PBXBuildFile; fileRef = 787B4EBB1ACE7E3300EDCC92 /* dropzone.png */; };
16 | 78BDEFBC1AD6C13900F0B285 /* FileCopyCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 78BDEFBB1AD6C13900F0B285 /* FileCopyCell.m */; };
17 | 78DA0FB81ACCB728001D3D57 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 78DA0FB71ACCB728001D3D57 /* AppDelegate.m */; };
18 | 78DA0FBA1ACCB728001D3D57 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 78DA0FB91ACCB728001D3D57 /* main.m */; };
19 | 78DA0FBC1ACCB728001D3D57 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 78DA0FBB1ACCB728001D3D57 /* Images.xcassets */; };
20 | 78DA0FBF1ACCB728001D3D57 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 78DA0FBD1ACCB728001D3D57 /* MainMenu.xib */; };
21 | 78DA0FCB1ACCB728001D3D57 /* FileCopyDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 78DA0FCA1ACCB728001D3D57 /* FileCopyDemoTests.m */; };
22 | 78F413EA1B1C993A0026BB04 /* FileCopyWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 78F413E91B1C993A0026BB04 /* FileCopyWindow.xib */; };
23 | 78F413ED1B1C9C380026BB04 /* FileCopyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 78F413EC1B1C9C380026BB04 /* FileCopyViewController.m */; };
24 | 78F67BF31ACF1D5A00EB3737 /* DestinationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 78F67BF01ACF1D5A00EB3737 /* DestinationViewController.m */; };
25 | 78F67BF41ACF1D5A00EB3737 /* SourceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 78F67BF21ACF1D5A00EB3737 /* SourceViewController.m */; };
26 | /* End PBXBuildFile section */
27 |
28 | /* Begin PBXContainerItemProxy section */
29 | 78DA0FC51ACCB728001D3D57 /* PBXContainerItemProxy */ = {
30 | isa = PBXContainerItemProxy;
31 | containerPortal = 78DA0FA91ACCB728001D3D57 /* Project object */;
32 | proxyType = 1;
33 | remoteGlobalIDString = 78DA0FB01ACCB728001D3D57;
34 | remoteInfo = FileCopyDemo;
35 | };
36 | /* End PBXContainerItemProxy section */
37 |
38 | /* Begin PBXFileReference section */
39 | 782F37DC1AD5519200A6296A /* QueueWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QueueWindowController.h; sourceTree = ""; };
40 | 782F37DD1AD5519200A6296A /* QueueWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QueueWindowController.m; sourceTree = ""; };
41 | 7848424D1B1E0669009CE4D1 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = SOURCE_ROOT; };
42 | 787B4EA91ACD3BEE00EDCC92 /* FileCopyManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileCopyManager.h; sourceTree = ""; };
43 | 787B4EAA1ACD3BEE00EDCC92 /* FileCopyManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileCopyManager.m; sourceTree = ""; };
44 | 787B4EAC1ACD597900EDCC92 /* FileCopyOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileCopyOperation.h; sourceTree = ""; };
45 | 787B4EAD1ACD597900EDCC92 /* FileCopyOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileCopyOperation.m; sourceTree = ""; };
46 | 787B4EB01ACE0F2500EDCC92 /* Queue.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = Queue.xib; sourceTree = ""; };
47 | 787B4EBB1ACE7E3300EDCC92 /* dropzone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dropzone.png; sourceTree = ""; };
48 | 78BDEFBA1AD6C13900F0B285 /* FileCopyCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileCopyCell.h; sourceTree = ""; };
49 | 78BDEFBB1AD6C13900F0B285 /* FileCopyCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileCopyCell.m; sourceTree = ""; };
50 | 78DA0FB11ACCB728001D3D57 /* FileCopyDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FileCopyDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
51 | 78DA0FB51ACCB728001D3D57 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
52 | 78DA0FB61ACCB728001D3D57 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
53 | 78DA0FB71ACCB728001D3D57 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
54 | 78DA0FB91ACCB728001D3D57 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
55 | 78DA0FBB1ACCB728001D3D57 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
56 | 78DA0FBE1ACCB728001D3D57 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; };
57 | 78DA0FC41ACCB728001D3D57 /* FileCopyDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FileCopyDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
58 | 78DA0FC91ACCB728001D3D57 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
59 | 78DA0FCA1ACCB728001D3D57 /* FileCopyDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FileCopyDemoTests.m; sourceTree = ""; };
60 | 78DA0FD41ACCB73C001D3D57 /* FileCopyDemo.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = FileCopyDemo.entitlements; sourceTree = ""; };
61 | 78F413E91B1C993A0026BB04 /* FileCopyWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FileCopyWindow.xib; sourceTree = ""; };
62 | 78F413EB1B1C9C380026BB04 /* FileCopyViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileCopyViewController.h; sourceTree = ""; };
63 | 78F413EC1B1C9C380026BB04 /* FileCopyViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileCopyViewController.m; sourceTree = ""; };
64 | 78F67BEF1ACF1D5A00EB3737 /* DestinationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DestinationViewController.h; sourceTree = ""; };
65 | 78F67BF01ACF1D5A00EB3737 /* DestinationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DestinationViewController.m; sourceTree = ""; };
66 | 78F67BF11ACF1D5A00EB3737 /* SourceViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceViewController.h; sourceTree = ""; };
67 | 78F67BF21ACF1D5A00EB3737 /* SourceViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SourceViewController.m; sourceTree = ""; };
68 | /* End PBXFileReference section */
69 |
70 | /* Begin PBXFrameworksBuildPhase section */
71 | 78DA0FAE1ACCB728001D3D57 /* Frameworks */ = {
72 | isa = PBXFrameworksBuildPhase;
73 | buildActionMask = 2147483647;
74 | files = (
75 | );
76 | runOnlyForDeploymentPostprocessing = 0;
77 | };
78 | 78DA0FC11ACCB728001D3D57 /* Frameworks */ = {
79 | isa = PBXFrameworksBuildPhase;
80 | buildActionMask = 2147483647;
81 | files = (
82 | );
83 | runOnlyForDeploymentPostprocessing = 0;
84 | };
85 | /* End PBXFrameworksBuildPhase section */
86 |
87 | /* Begin PBXGroup section */
88 | 78DA0FA81ACCB728001D3D57 = {
89 | isa = PBXGroup;
90 | children = (
91 | 78DA0FB31ACCB728001D3D57 /* FileCopyDemo */,
92 | 78DA0FC71ACCB728001D3D57 /* FileCopyDemoTests */,
93 | 78DA0FB21ACCB728001D3D57 /* Products */,
94 | );
95 | sourceTree = "";
96 | };
97 | 78DA0FB21ACCB728001D3D57 /* Products */ = {
98 | isa = PBXGroup;
99 | children = (
100 | 78DA0FB11ACCB728001D3D57 /* FileCopyDemo.app */,
101 | 78DA0FC41ACCB728001D3D57 /* FileCopyDemoTests.xctest */,
102 | );
103 | name = Products;
104 | sourceTree = "";
105 | };
106 | 78DA0FB31ACCB728001D3D57 /* FileCopyDemo */ = {
107 | isa = PBXGroup;
108 | children = (
109 | 78DA0FB61ACCB728001D3D57 /* AppDelegate.h */,
110 | 78DA0FB71ACCB728001D3D57 /* AppDelegate.m */,
111 | 78F67BEF1ACF1D5A00EB3737 /* DestinationViewController.h */,
112 | 78F67BF01ACF1D5A00EB3737 /* DestinationViewController.m */,
113 | 78F67BF11ACF1D5A00EB3737 /* SourceViewController.h */,
114 | 78F67BF21ACF1D5A00EB3737 /* SourceViewController.m */,
115 | 782F37DC1AD5519200A6296A /* QueueWindowController.h */,
116 | 782F37DD1AD5519200A6296A /* QueueWindowController.m */,
117 | 78F413EB1B1C9C380026BB04 /* FileCopyViewController.h */,
118 | 78F413EC1B1C9C380026BB04 /* FileCopyViewController.m */,
119 | 787B4EA91ACD3BEE00EDCC92 /* FileCopyManager.h */,
120 | 787B4EAA1ACD3BEE00EDCC92 /* FileCopyManager.m */,
121 | 787B4EAC1ACD597900EDCC92 /* FileCopyOperation.h */,
122 | 787B4EAD1ACD597900EDCC92 /* FileCopyOperation.m */,
123 | 78BDEFBA1AD6C13900F0B285 /* FileCopyCell.h */,
124 | 78BDEFBB1AD6C13900F0B285 /* FileCopyCell.m */,
125 | 78DA0FBD1ACCB728001D3D57 /* MainMenu.xib */,
126 | 787B4EB01ACE0F2500EDCC92 /* Queue.xib */,
127 | 78F413E91B1C993A0026BB04 /* FileCopyWindow.xib */,
128 | 78DA0FBB1ACCB728001D3D57 /* Images.xcassets */,
129 | 787B4EBB1ACE7E3300EDCC92 /* dropzone.png */,
130 | 78DA0FD41ACCB73C001D3D57 /* FileCopyDemo.entitlements */,
131 | 78DA0FB41ACCB728001D3D57 /* Supporting Files */,
132 | );
133 | path = FileCopyDemo;
134 | sourceTree = "";
135 | };
136 | 78DA0FB41ACCB728001D3D57 /* Supporting Files */ = {
137 | isa = PBXGroup;
138 | children = (
139 | 7848424D1B1E0669009CE4D1 /* README.md */,
140 | 78DA0FB51ACCB728001D3D57 /* Info.plist */,
141 | 78DA0FB91ACCB728001D3D57 /* main.m */,
142 | );
143 | name = "Supporting Files";
144 | sourceTree = "";
145 | };
146 | 78DA0FC71ACCB728001D3D57 /* FileCopyDemoTests */ = {
147 | isa = PBXGroup;
148 | children = (
149 | 78DA0FCA1ACCB728001D3D57 /* FileCopyDemoTests.m */,
150 | 78DA0FC81ACCB728001D3D57 /* Supporting Files */,
151 | );
152 | path = FileCopyDemoTests;
153 | sourceTree = "";
154 | };
155 | 78DA0FC81ACCB728001D3D57 /* Supporting Files */ = {
156 | isa = PBXGroup;
157 | children = (
158 | 78DA0FC91ACCB728001D3D57 /* Info.plist */,
159 | );
160 | name = "Supporting Files";
161 | sourceTree = "";
162 | };
163 | /* End PBXGroup section */
164 |
165 | /* Begin PBXNativeTarget section */
166 | 78DA0FB01ACCB728001D3D57 /* FileCopyDemo */ = {
167 | isa = PBXNativeTarget;
168 | buildConfigurationList = 78DA0FCE1ACCB728001D3D57 /* Build configuration list for PBXNativeTarget "FileCopyDemo" */;
169 | buildPhases = (
170 | 78DA0FAD1ACCB728001D3D57 /* Sources */,
171 | 78DA0FAE1ACCB728001D3D57 /* Frameworks */,
172 | 78DA0FAF1ACCB728001D3D57 /* Resources */,
173 | );
174 | buildRules = (
175 | );
176 | dependencies = (
177 | );
178 | name = FileCopyDemo;
179 | productName = FileCopyDemo;
180 | productReference = 78DA0FB11ACCB728001D3D57 /* FileCopyDemo.app */;
181 | productType = "com.apple.product-type.application";
182 | };
183 | 78DA0FC31ACCB728001D3D57 /* FileCopyDemoTests */ = {
184 | isa = PBXNativeTarget;
185 | buildConfigurationList = 78DA0FD11ACCB728001D3D57 /* Build configuration list for PBXNativeTarget "FileCopyDemoTests" */;
186 | buildPhases = (
187 | 78DA0FC01ACCB728001D3D57 /* Sources */,
188 | 78DA0FC11ACCB728001D3D57 /* Frameworks */,
189 | 78DA0FC21ACCB728001D3D57 /* Resources */,
190 | );
191 | buildRules = (
192 | );
193 | dependencies = (
194 | 78DA0FC61ACCB728001D3D57 /* PBXTargetDependency */,
195 | );
196 | name = FileCopyDemoTests;
197 | productName = FileCopyDemoTests;
198 | productReference = 78DA0FC41ACCB728001D3D57 /* FileCopyDemoTests.xctest */;
199 | productType = "com.apple.product-type.bundle.unit-test";
200 | };
201 | /* End PBXNativeTarget section */
202 |
203 | /* Begin PBXProject section */
204 | 78DA0FA91ACCB728001D3D57 /* Project object */ = {
205 | isa = PBXProject;
206 | attributes = {
207 | LastUpgradeCheck = 0620;
208 | ORGANIZATIONNAME = LAR0d;
209 | TargetAttributes = {
210 | 78DA0FB01ACCB728001D3D57 = {
211 | CreatedOnToolsVersion = 6.2;
212 | SystemCapabilities = {
213 | com.apple.Sandbox = {
214 | enabled = 1;
215 | };
216 | };
217 | };
218 | 78DA0FC31ACCB728001D3D57 = {
219 | CreatedOnToolsVersion = 6.2;
220 | TestTargetID = 78DA0FB01ACCB728001D3D57;
221 | };
222 | };
223 | };
224 | buildConfigurationList = 78DA0FAC1ACCB728001D3D57 /* Build configuration list for PBXProject "FileCopyDemo" */;
225 | compatibilityVersion = "Xcode 3.2";
226 | developmentRegion = English;
227 | hasScannedForEncodings = 0;
228 | knownRegions = (
229 | en,
230 | Base,
231 | );
232 | mainGroup = 78DA0FA81ACCB728001D3D57;
233 | productRefGroup = 78DA0FB21ACCB728001D3D57 /* Products */;
234 | projectDirPath = "";
235 | projectRoot = "";
236 | targets = (
237 | 78DA0FB01ACCB728001D3D57 /* FileCopyDemo */,
238 | 78DA0FC31ACCB728001D3D57 /* FileCopyDemoTests */,
239 | );
240 | };
241 | /* End PBXProject section */
242 |
243 | /* Begin PBXResourcesBuildPhase section */
244 | 78DA0FAF1ACCB728001D3D57 /* Resources */ = {
245 | isa = PBXResourcesBuildPhase;
246 | buildActionMask = 2147483647;
247 | files = (
248 | 787B4EBC1ACE7E3300EDCC92 /* dropzone.png in Resources */,
249 | 78F413EA1B1C993A0026BB04 /* FileCopyWindow.xib in Resources */,
250 | 787B4EB11ACE0F2500EDCC92 /* Queue.xib in Resources */,
251 | 78DA0FBC1ACCB728001D3D57 /* Images.xcassets in Resources */,
252 | 78DA0FBF1ACCB728001D3D57 /* MainMenu.xib in Resources */,
253 | );
254 | runOnlyForDeploymentPostprocessing = 0;
255 | };
256 | 78DA0FC21ACCB728001D3D57 /* Resources */ = {
257 | isa = PBXResourcesBuildPhase;
258 | buildActionMask = 2147483647;
259 | files = (
260 | );
261 | runOnlyForDeploymentPostprocessing = 0;
262 | };
263 | /* End PBXResourcesBuildPhase section */
264 |
265 | /* Begin PBXSourcesBuildPhase section */
266 | 78DA0FAD1ACCB728001D3D57 /* Sources */ = {
267 | isa = PBXSourcesBuildPhase;
268 | buildActionMask = 2147483647;
269 | files = (
270 | 78DA0FBA1ACCB728001D3D57 /* main.m in Sources */,
271 | 78DA0FB81ACCB728001D3D57 /* AppDelegate.m in Sources */,
272 | 7848424E1B1E0669009CE4D1 /* README.md in Sources */,
273 | 787B4EAE1ACD597900EDCC92 /* FileCopyOperation.m in Sources */,
274 | 78F67BF41ACF1D5A00EB3737 /* SourceViewController.m in Sources */,
275 | 78BDEFBC1AD6C13900F0B285 /* FileCopyCell.m in Sources */,
276 | 782F37DE1AD5519200A6296A /* QueueWindowController.m in Sources */,
277 | 787B4EAB1ACD3BEE00EDCC92 /* FileCopyManager.m in Sources */,
278 | 78F413ED1B1C9C380026BB04 /* FileCopyViewController.m in Sources */,
279 | 78F67BF31ACF1D5A00EB3737 /* DestinationViewController.m in Sources */,
280 | );
281 | runOnlyForDeploymentPostprocessing = 0;
282 | };
283 | 78DA0FC01ACCB728001D3D57 /* Sources */ = {
284 | isa = PBXSourcesBuildPhase;
285 | buildActionMask = 2147483647;
286 | files = (
287 | 78DA0FCB1ACCB728001D3D57 /* FileCopyDemoTests.m in Sources */,
288 | );
289 | runOnlyForDeploymentPostprocessing = 0;
290 | };
291 | /* End PBXSourcesBuildPhase section */
292 |
293 | /* Begin PBXTargetDependency section */
294 | 78DA0FC61ACCB728001D3D57 /* PBXTargetDependency */ = {
295 | isa = PBXTargetDependency;
296 | target = 78DA0FB01ACCB728001D3D57 /* FileCopyDemo */;
297 | targetProxy = 78DA0FC51ACCB728001D3D57 /* PBXContainerItemProxy */;
298 | };
299 | /* End PBXTargetDependency section */
300 |
301 | /* Begin PBXVariantGroup section */
302 | 78DA0FBD1ACCB728001D3D57 /* MainMenu.xib */ = {
303 | isa = PBXVariantGroup;
304 | children = (
305 | 78DA0FBE1ACCB728001D3D57 /* Base */,
306 | );
307 | name = MainMenu.xib;
308 | sourceTree = "";
309 | };
310 | /* End PBXVariantGroup section */
311 |
312 | /* Begin XCBuildConfiguration section */
313 | 78DA0FCC1ACCB728001D3D57 /* Debug */ = {
314 | isa = XCBuildConfiguration;
315 | buildSettings = {
316 | ALWAYS_SEARCH_USER_PATHS = NO;
317 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
318 | CLANG_CXX_LIBRARY = "libc++";
319 | CLANG_ENABLE_MODULES = YES;
320 | CLANG_ENABLE_OBJC_ARC = YES;
321 | CLANG_WARN_BOOL_CONVERSION = YES;
322 | CLANG_WARN_CONSTANT_CONVERSION = YES;
323 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
324 | CLANG_WARN_EMPTY_BODY = YES;
325 | CLANG_WARN_ENUM_CONVERSION = YES;
326 | CLANG_WARN_INT_CONVERSION = YES;
327 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
328 | CLANG_WARN_UNREACHABLE_CODE = YES;
329 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
330 | CODE_SIGN_IDENTITY = "-";
331 | COPY_PHASE_STRIP = NO;
332 | ENABLE_STRICT_OBJC_MSGSEND = YES;
333 | GCC_C_LANGUAGE_STANDARD = gnu99;
334 | GCC_DYNAMIC_NO_PIC = NO;
335 | GCC_OPTIMIZATION_LEVEL = 0;
336 | GCC_PREPROCESSOR_DEFINITIONS = (
337 | "DEBUG=1",
338 | "$(inherited)",
339 | );
340 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
341 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
342 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
343 | GCC_WARN_UNDECLARED_SELECTOR = YES;
344 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
345 | GCC_WARN_UNUSED_FUNCTION = YES;
346 | GCC_WARN_UNUSED_VARIABLE = YES;
347 | MACOSX_DEPLOYMENT_TARGET = 10.10;
348 | MTL_ENABLE_DEBUG_INFO = YES;
349 | ONLY_ACTIVE_ARCH = YES;
350 | SDKROOT = macosx;
351 | };
352 | name = Debug;
353 | };
354 | 78DA0FCD1ACCB728001D3D57 /* Release */ = {
355 | isa = XCBuildConfiguration;
356 | buildSettings = {
357 | ALWAYS_SEARCH_USER_PATHS = NO;
358 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
359 | CLANG_CXX_LIBRARY = "libc++";
360 | CLANG_ENABLE_MODULES = YES;
361 | CLANG_ENABLE_OBJC_ARC = YES;
362 | CLANG_WARN_BOOL_CONVERSION = YES;
363 | CLANG_WARN_CONSTANT_CONVERSION = YES;
364 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
365 | CLANG_WARN_EMPTY_BODY = YES;
366 | CLANG_WARN_ENUM_CONVERSION = YES;
367 | CLANG_WARN_INT_CONVERSION = YES;
368 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
369 | CLANG_WARN_UNREACHABLE_CODE = YES;
370 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
371 | CODE_SIGN_IDENTITY = "-";
372 | COPY_PHASE_STRIP = NO;
373 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
374 | ENABLE_NS_ASSERTIONS = NO;
375 | ENABLE_STRICT_OBJC_MSGSEND = YES;
376 | GCC_C_LANGUAGE_STANDARD = gnu99;
377 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
378 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
379 | GCC_WARN_UNDECLARED_SELECTOR = YES;
380 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
381 | GCC_WARN_UNUSED_FUNCTION = YES;
382 | GCC_WARN_UNUSED_VARIABLE = YES;
383 | MACOSX_DEPLOYMENT_TARGET = 10.10;
384 | MTL_ENABLE_DEBUG_INFO = NO;
385 | SDKROOT = macosx;
386 | };
387 | name = Release;
388 | };
389 | 78DA0FCF1ACCB728001D3D57 /* Debug */ = {
390 | isa = XCBuildConfiguration;
391 | buildSettings = {
392 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
393 | CODE_SIGN_ENTITLEMENTS = FileCopyDemo/FileCopyDemo.entitlements;
394 | COMBINE_HIDPI_IMAGES = YES;
395 | INFOPLIST_FILE = FileCopyDemo/Info.plist;
396 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
397 | PRODUCT_NAME = "$(TARGET_NAME)";
398 | };
399 | name = Debug;
400 | };
401 | 78DA0FD01ACCB728001D3D57 /* Release */ = {
402 | isa = XCBuildConfiguration;
403 | buildSettings = {
404 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
405 | CODE_SIGN_ENTITLEMENTS = FileCopyDemo/FileCopyDemo.entitlements;
406 | COMBINE_HIDPI_IMAGES = YES;
407 | INFOPLIST_FILE = FileCopyDemo/Info.plist;
408 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
409 | PRODUCT_NAME = "$(TARGET_NAME)";
410 | };
411 | name = Release;
412 | };
413 | 78DA0FD21ACCB728001D3D57 /* Debug */ = {
414 | isa = XCBuildConfiguration;
415 | buildSettings = {
416 | BUNDLE_LOADER = "$(TEST_HOST)";
417 | COMBINE_HIDPI_IMAGES = YES;
418 | FRAMEWORK_SEARCH_PATHS = (
419 | "$(DEVELOPER_FRAMEWORKS_DIR)",
420 | "$(inherited)",
421 | );
422 | GCC_PREPROCESSOR_DEFINITIONS = (
423 | "DEBUG=1",
424 | "$(inherited)",
425 | );
426 | INFOPLIST_FILE = FileCopyDemoTests/Info.plist;
427 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
428 | PRODUCT_NAME = "$(TARGET_NAME)";
429 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FileCopyDemo.app/Contents/MacOS/FileCopyDemo";
430 | };
431 | name = Debug;
432 | };
433 | 78DA0FD31ACCB728001D3D57 /* Release */ = {
434 | isa = XCBuildConfiguration;
435 | buildSettings = {
436 | BUNDLE_LOADER = "$(TEST_HOST)";
437 | COMBINE_HIDPI_IMAGES = YES;
438 | FRAMEWORK_SEARCH_PATHS = (
439 | "$(DEVELOPER_FRAMEWORKS_DIR)",
440 | "$(inherited)",
441 | );
442 | INFOPLIST_FILE = FileCopyDemoTests/Info.plist;
443 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
444 | PRODUCT_NAME = "$(TARGET_NAME)";
445 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FileCopyDemo.app/Contents/MacOS/FileCopyDemo";
446 | };
447 | name = Release;
448 | };
449 | /* End XCBuildConfiguration section */
450 |
451 | /* Begin XCConfigurationList section */
452 | 78DA0FAC1ACCB728001D3D57 /* Build configuration list for PBXProject "FileCopyDemo" */ = {
453 | isa = XCConfigurationList;
454 | buildConfigurations = (
455 | 78DA0FCC1ACCB728001D3D57 /* Debug */,
456 | 78DA0FCD1ACCB728001D3D57 /* Release */,
457 | );
458 | defaultConfigurationIsVisible = 0;
459 | defaultConfigurationName = Release;
460 | };
461 | 78DA0FCE1ACCB728001D3D57 /* Build configuration list for PBXNativeTarget "FileCopyDemo" */ = {
462 | isa = XCConfigurationList;
463 | buildConfigurations = (
464 | 78DA0FCF1ACCB728001D3D57 /* Debug */,
465 | 78DA0FD01ACCB728001D3D57 /* Release */,
466 | );
467 | defaultConfigurationIsVisible = 0;
468 | defaultConfigurationName = Release;
469 | };
470 | 78DA0FD11ACCB728001D3D57 /* Build configuration list for PBXNativeTarget "FileCopyDemoTests" */ = {
471 | isa = XCConfigurationList;
472 | buildConfigurations = (
473 | 78DA0FD21ACCB728001D3D57 /* Debug */,
474 | 78DA0FD31ACCB728001D3D57 /* Release */,
475 | );
476 | defaultConfigurationIsVisible = 0;
477 | defaultConfigurationName = Release;
478 | };
479 | /* End XCConfigurationList section */
480 | };
481 | rootObject = 78DA0FA91ACCB728001D3D57 /* Project object */;
482 | }
483 |
--------------------------------------------------------------------------------
/FileCopyDemo/Base.lproj/MainMenu.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
726 |
727 |
728 |
729 |
730 |
731 |
742 |
743 |
744 |
745 |
746 |
747 |
755 |
756 |
757 |
758 |
759 |
760 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
--------------------------------------------------------------------------------