Permalink
Browse files

Moving to Xcode framework project

  • Loading branch information...
nrj committed Dec 21, 2009
1 parent cc552f4 commit b44fba1ec1169fff3cd7f89ee8553ada3f41a339
View
@@ -199,8 +199,10 @@ - (void)handleFTPResponse:(int)code
case FTP_RESPONSE_READY_FOR_DATA:
if (!isUploading)
{
- [self performDelegateSelector:@selector(curl:transferDidBegin:)];
+ [transfer setStatus:TRANSFER_STATUS_UPLOADING];
+ [transfer setStatusMessage:[NSString stringWithFormat:@"Uploading (%d%%) to %@", [transfer progress], [transfer hostname]]];
[self performDelegateSelector:@selector(curl:transferStatusDidChange:)];
+ [self performDelegateSelector:@selector(curl:transferDidBegin:)];
[self setIsUploading:YES];
}
break;
View
@@ -22,13 +22,13 @@ static int handleClientProgress(void *clientp, double dltotal, double dlnow, dou
id <TransferRecord>transfer = [client transfer];
long totalProgressUnits = 100 * ([transfer totalFiles] + 1);
- int individualProgress = ([transfer totalFilesUploaded] * 100) + (ulnow * 100 / ultotal);
+ long individualProgress = ([transfer totalFilesUploaded] * 100) + (ulnow * 100 / ultotal);
int actualProgress = (individualProgress * 100) / totalProgressUnits;
if (actualProgress >= 0)
{
[transfer setProgress:actualProgress];
-
+ [transfer setStatusMessage:[NSString stringWithFormat:@"Uploading (%d%%) to %@", actualProgress, [transfer hostname]]];
[client performDelegateSelector:@selector(curl:transferDidProgress:)];
}
View
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>NSMainNibFile</key>
+ <string>MainMenu</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -6,23 +6,21 @@
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
- <string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
+ <string>org.objective-curl.${PRODUCT_NAME:identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
- <key>CFBundleName</key>
- <string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
- <string>APPL</string>
+ <string>FMWK</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
- <key>NSMainNibFile</key>
- <string>MainMenu</string>
<key>NSPrincipalClass</key>
- <string>NSApplication</string>
+ <string></string>
</dict>
</plist>
View
@@ -7,13 +7,18 @@
//
#import <Cocoa/Cocoa.h>
-
+#import "ftp.h"
@interface TestController : NSObject
{
IBOutlet NSButton *btn;
+ IBOutlet NSProgressIndicator *progress;
+
+ id <TransferRecord>upload;
}
+@property(readwrite, retain) id <TransferRecord>upload;
+
- (IBAction)runTest:(id)sender;
@end
View
@@ -7,31 +7,36 @@
//
#import "TestController.h"
-#import "CurlFTP.h"
-
@implementation TestController
+@synthesize upload;
+
+- (void)awakeFromNib
+{
+ [progress setUsesThreadedAnimation:YES];
+}
+
- (IBAction)runTest:(id)sender
{
CurlFTP *ftp = [[CurlFTP alloc] init];
// [ftp setVerbose:YES];
-
[ftp setShowProgress:YES];
[ftp setAuthUsername:@"nrj"];
-
+
[ftp setDelegate:self];
NSArray *filesToUpload = [[NSArray alloc] initWithObjects:@"/Users/nrj/Desktop/skreemr", NULL];
+
+ id <TransferRecord>newUpload = [ftp uploadFilesAndDirectories:filesToUpload
+ toHost:@"bender.local"
+ port:21
+ directory:@"/home/nrj/global"];
- [ftp uploadFilesAndDirectories:filesToUpload
- toHost:@"bender.local"
- port:21
- directory:@"/home/nrj/global"];
-
+ [self setUpload:newUpload];
}
- (void)curl:(CurlObject *)client transferFailedAuthentication:(id <TransferRecord>)aRecord
@@ -41,12 +46,12 @@ - (void)curl:(CurlObject *)client transferFailedAuthentication:(id <TransferReco
- (void)curl:(CurlObject *)client transferDidBegin:(id <TransferRecord>)aRecord
{
- NSLog(@"transferDidBegin", [aRecord progress]);
+ NSLog(@"transferDidBegin");
}
- (void)curl:(CurlObject *)client transferDidProgress:(id <TransferRecord>)aRecord
{
- NSLog(@"transferDidProgress %d", [aRecord progress]);
+ NSLog(@"transferDidProgress - %@", [aRecord statusMessage]);
}
- (void)curl:(CurlObject *)client transferDidFinish:(id <TransferRecord>)aRecord
View
@@ -0,0 +1,11 @@
+//
+// ftp.h
+// objective-curl
+//
+// Created by nrj on 12/20/09.
+// Copyright 2009. All rights reserved.
+//
+
+
+#import "CurlFTP.h"
+#import "Upload.h"
View
10 main.m
@@ -1,14 +1,6 @@
-//
-// main.m
-// objective-curl
-//
-// Created by nrj on 12/7/09.
-// Copyright __MyCompanyName__ 2009. All rights reserved.
-//
-
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
{
- return NSApplicationMain(argc, (const char **) argv);
+ return NSApplicationMain(argc, (const char **) argv);
}
Oops, something went wrong.

0 comments on commit b44fba1

Please sign in to comment.