add an option to "Validate existing data" to open window; get mac build compiling

This commit is contained in:
Mitchell Livingston 2008-01-09 19:52:11 +00:00
parent 5d93bd2c93
commit 34396e7820
5 changed files with 568 additions and 480 deletions

View File

@ -44,6 +44,8 @@
BOOL fDeleteTorrent, fDeleteEnable;
int fGroupValue;
NSTimer * fTimer;
}
- (id) initWithTorrent: (Torrent *) torrent destination: (NSString *) path controller: (Controller *) controller
@ -56,6 +58,8 @@
- (void) add: (id) sender;
- (void) cancelAdd: (id) sender;
- (void) verifyLocalData: (id) sender;
- (void) updateGroupMenu: (NSNotification *) notification;
- (void) showGroupsWindow: (id) sender;

View File

@ -29,9 +29,14 @@
#import "NSMenuAdditions.h"
#import "ExpandedPathToIconTransformer.h"
#define UPDATE_SECONDS 1.0
@interface AddWindowController (Private)
- (void) updateTorrent;
- (void) folderChoiceClosed: (NSOpenPanel *) openPanel returnCode: (int) code contextInfo: (void *) contextInfo;
- (void) setGroupsMenu;
- (void) changeGroupValue: (id) sender;
@ -112,6 +117,9 @@
[fLocationField setStringValue: @""];
[fLocationImageView setImage: nil];
}
fTimer = [NSTimer scheduledTimerWithTimeInterval: UPDATE_SECONDS target: self
selector: @selector(updateTorrent) userInfo: nil repeats: YES];
}
- (void) windowDidLoad
@ -122,9 +130,11 @@
}
- (void) dealloc
{
{NSLog(@"dealloc");
[[NSNotificationCenter defaultCenter] removeObserver: self];
[fTimer invalidate];
[fDestination release];
[super dealloc];
@ -154,6 +164,9 @@
- (void) add: (id) sender
{
[fTimer invalidate];
fTimer = nil;
[fTorrent setWaitToStart: [fStartCheck state] == NSOnState];
[fTorrent setGroupValue: [[fGroupPopUp selectedItem] tag]];
@ -166,9 +179,18 @@
- (void) cancelAdd: (id) sender
{
[fTimer invalidate];
fTimer = nil;
[fController askOpenConfirmed: self add: NO];
}
- (void) verifyLocalData: (id) sender
{
[fTorrent resetCache];
[self updateTorrent];
}
- (void) updateGroupMenu: (NSNotification *) notification
{
[self setGroupsMenu];
@ -194,6 +216,12 @@
@implementation AddWindowController (Private)
- (void) updateTorrent
{
[fTorrent updateFileStat];
[fFileController reloadData];
}
- (void) folderChoiceClosed: (NSOpenPanel *) openPanel returnCode: (int) code contextInfo: (void *) contextInfo
{
if (code == NSOKButton)
@ -209,8 +237,6 @@
[iconTransformer release];
[fTorrent changeDownloadFolder: fDestination];
[fFileController reloadData];
}
else
{

File diff suppressed because it is too large Load Diff

View File

@ -759,7 +759,7 @@ typedef enum
break;
}
int status = [[peer objectForKey: @"Status"] intValue];
/*int status = [[peer objectForKey: @"Status"] intValue];
if (status & TR_PEER_STATUS_HANDSHAKE)
[components addObject: NSLocalizedString(@"Handshaking", "Inspector -> peer -> status")];
else
@ -786,8 +786,8 @@ typedef enum
if ([peerStatusArray count] > 0)
[components addObject: [peerStatusArray componentsJoinedByString: @" - "]];
}
}*/
return [components componentsJoinedByString: @"\n"];
}
return nil;

View File

@ -874,7 +874,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
[NSNumber numberWithFloat: peer->progress], @"Progress",
[NSNumber numberWithBool: peer->isEncrypted], @"Encryption",
[NSString stringWithCString: (char *)peer->client encoding: NSUTF8StringEncoding], @"Client",
[NSNumber numberWithInt: peer->status], @"Status", nil];
/*[NSNumber numberWithInt: peer->status], @"Status",*/ nil];
if (peer->isDownloading)
[dic setObject: [NSNumber numberWithFloat: peer->uploadToRate] forKey: @"UL To Rate"];