moved Wagic Version macros into a new header file so that iOS can use it.

updated iOS port to use wagic versioning macros.
This commit is contained in:
techdragon.nguyen@gmail.com
2012-02-05 11:16:43 +00:00
parent 5c293e2fbb
commit 5c3baedf83
6 changed files with 69 additions and 29 deletions

View File

@@ -17,5 +17,7 @@
@property (nonatomic, retain) UITextView *downloadMessageStatus;
@property (nonatomic, retain) UIProgressView *downloadProgressView;
@property (nonatomic, retain) NSString *kDownloadFileName;
@property (nonatomic, retain) NSString *kDownloadIosUpdateFileName;
@end

View File

@@ -10,17 +10,18 @@
#import "wagicAppDelegate.h"
#import "ASIHTTPRequest.h"
#import "QuartzCore/QuartzCore.h"
#include "Wagic_Version.h"
@implementation WagicDownloadProgressViewController
@synthesize downloadProgressView;
@synthesize downloadMessageStatus;
@synthesize kDownloadIosUpdateFileName;
@synthesize kDownloadFileName;
#define WAGIC_IOS_RESOURCE_NAME WAGIC_CORE_VERSION_STRING "_iOS.zip"
static NSString *kDownloadUrlPath = @"http://wagic.googlecode.com/files/";
static NSString *kDownloadFileName = @"core_0171.zip";
static NSString *kDownloadIosUpdateFileName = @"core_0171_iOS.zip";
- (void) handleFailedDownload: (NSNotification *) sender
{
@@ -102,6 +103,9 @@ static NSString *kDownloadIosUpdateFileName = @"core_0171_iOS.zip";
NSURL *url = nil;
NSString *downloadFilename = nil;
// determine which file to download
kDownloadFileName = [NSString stringWithCString: WAGIC_RESOURCE_NAME encoding:NSUTF8StringEncoding];
kDownloadIosUpdateFileName = [NSString stringWithCString: WAGIC_IOS_RESOURCE_NAME encoding:NSUTF8StringEncoding];
if ([downloadType isEqualToString: @"core"])
{
downloadFilename = kDownloadFileName;
@@ -154,6 +158,19 @@ static NSString *kDownloadIosUpdateFileName = @"core_0171_iOS.zip";
[pool drain], pool = nil;
}
- (void) dealloc
{
[kDownloadFileName release], kDownloadFileName = nil;
[kDownloadIosUpdateFileName release], kDownloadIosUpdateFileName = nil;
if (downloadProgressView)
[downloadProgressView release], downloadProgressView = nil;
if (downloadMessageStatus)
[downloadMessageStatus release], downloadMessageStatus = nil;
[super dealloc];
}
- (id) init
{
NSNotificationCenter *dnc = [NSNotificationCenter defaultCenter];