Remove some logging and add the volume name to space warning.

This commit is contained in:
Mitchell Livingston 2006-09-28 00:48:07 +00:00
parent 9881f7b6ef
commit 13b3da143e
1 changed files with 4 additions and 6 deletions

View File

@ -89,7 +89,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
NSString * paused; NSString * paused;
if (!(paused = [history objectForKey: @"Paused"]) || [paused isEqualToString: @"NO"]) if (!(paused = [history objectForKey: @"Paused"]) || [paused isEqualToString: @"NO"])
tr_torrentStart(fHandle); [self startTransfer];
} }
return self; return self;
} }
@ -423,16 +423,14 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
float remainingSpace = [[fsAttributes objectForKey: NSFileSystemFreeSize] floatValue], float remainingSpace = [[fsAttributes objectForKey: NSFileSystemFreeSize] floatValue],
torrentRemaining = (float)[self size] * (1.0 - [self progress]); torrentRemaining = (float)[self size] * (1.0 - [self progress]);
NSLog(@"Remaining disk space: %f", remainingSpace);
NSLog(@"Torrent remaining size: %f", torrentRemaining);
if (remainingSpace - torrentRemaining <= 10240.0) if (remainingSpace - torrentRemaining <= 10240.0)
{ {
NSAlert * alert = [[NSAlert alloc] init]; NSAlert * alert = [[NSAlert alloc] init];
[alert setMessageText: [NSString stringWithFormat: @"Not enough remaining disk space to download \"%@\" completely.", [alert setMessageText: [NSString stringWithFormat: @"Not enough remaining disk space to download \"%@\" completely.",
[self name]]]; [self name]]];
[alert setInformativeText: @"The transfer has been paused. Clear up space on your disk to continue."]; [alert setInformativeText: [NSString stringWithFormat:
@"The transfer has been paused. Clear up space on %@ to continue.",
[[[NSFileManager defaultManager] componentsToDisplayForPath: [self dataLocation]] objectAtIndex: 0]]];
[alert runModal]; [alert runModal];
return NO; return NO;