only remove a torrent from the queue for a local error, not tracker error; miscellaneous trivial adjustments

This commit is contained in:
Mitchell Livingston 2009-10-17 17:15:37 +00:00
parent 45839606db
commit 94627c81f3
7 changed files with 14 additions and 14 deletions

View File

@ -47,7 +47,7 @@
{ {
[fButton setTitle: NSLocalizedString(@"Cancel", "Blocklist -> cancel button")]; [fButton setTitle: NSLocalizedString(@"Cancel", "Blocklist -> cancel button")];
CGFloat oldWidth = [fButton frame].size.width; const CGFloat oldWidth = [fButton frame].size.width;
[fButton sizeToFit]; [fButton sizeToFit];
NSRect buttonFrame = [fButton frame]; NSRect buttonFrame = [fButton frame];
buttonFrame.size.width += 12.0f; //sizeToFit sizes a bit too small buttonFrame.size.width += 12.0f; //sizeToFit sizes a bit too small

View File

@ -893,7 +893,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
//ensure torrent doesn't already exist //ensure torrent doesn't already exist
tr_ctor * ctor = tr_ctorNew(fLib); tr_ctor * ctor = tr_ctorNew(fLib);
tr_ctorSetMetainfoFromFile(ctor, [torrentPath UTF8String]); tr_ctorSetMetainfoFromFile(ctor, [torrentPath UTF8String]);
int result = tr_torrentParse(ctor, &info); tr_parse_result result = tr_torrentParse(ctor, &info);
if (result != TR_PARSE_OK) if (result != TR_PARSE_OK)
{ {
if (result == TR_PARSE_DUPLICATE) if (result == TR_PARSE_DUPLICATE)
@ -903,8 +903,8 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
if (type != ADD_AUTO) if (type != ADD_AUTO)
[self invalidOpenAlert: [torrentPath lastPathComponent]]; [self invalidOpenAlert: [torrentPath lastPathComponent]];
} }
else //this shouldn't happen else
NSLog(@"Unknown error code (%d) when attempting to open \"%@\"", result, torrentPath); NSAssert2(NO, @"Unknown error code (%d) when attempting to open \"%@\"", result, torrentPath);
tr_ctorFree(ctor); tr_ctorFree(ctor);
tr_metainfoFree(&info); tr_metainfoFree(&info);
@ -3983,7 +3983,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
if (seeding > 0 || downloading > 0) if (seeding > 0 || downloading > 0)
{ {
if (!hasSeparator) if (!hasSeparator)
[fDockMenu insertItem: [NSMenuItem separatorItem] atIndex: seeding > 0 && downloading > 0 ? 2 : 1]; [fDockMenu insertItem: [NSMenuItem separatorItem] atIndex: (seeding > 0 && downloading > 0) ? 2 : 1];
} }
else else
{ {

View File

@ -72,7 +72,7 @@ tr_session * fLib;
stringByAppendingString: @":"]]; stringByAppendingString: @":"]];
//size all elements //size all elements
CGFloat oldWidth = [fUploadedLabelField frame].size.width; const CGFloat oldWidth = [fUploadedLabelField frame].size.width;
[fUploadedLabelField sizeToFit]; [fUploadedLabelField sizeToFit];
[fDownloadedLabelField sizeToFit]; [fDownloadedLabelField sizeToFit];
@ -111,7 +111,7 @@ tr_session * fLib;
[[self window] setFrame: windowRect display: YES]; [[self window] setFrame: windowRect display: YES];
//resize reset button //resize reset button
CGFloat oldButtonWidth = [fResetButton frame].size.width; const CGFloat oldButtonWidth = [fResetButton frame].size.width;
[fResetButton setTitle: NSLocalizedString(@"Reset", "Stats window -> reset button")]; [fResetButton setTitle: NSLocalizedString(@"Reset", "Stats window -> reset button")];
[fResetButton sizeToFit]; [fResetButton sizeToFit];

View File

@ -161,7 +161,7 @@
- (BOOL) allDownloaded; - (BOOL) allDownloaded;
- (BOOL) isComplete; - (BOOL) isComplete;
- (BOOL) isError; - (BOOL) isError;
- (BOOL) isErrorOrWarning; - (BOOL) isAnyErrorOrWarning;
- (NSString *) errorMessage; - (NSString *) errorMessage;
- (NSArray *) peers; - (NSArray *) peers;

View File

@ -851,17 +851,17 @@ int trashDataFile(const char * filename)
- (BOOL) isError - (BOOL) isError
{ {
return fStat->error == TR_STAT_LOCAL_ERROR || fStat->error == TR_STAT_TRACKER_ERROR; return fStat->error == TR_STAT_LOCAL_ERROR;
} }
- (BOOL) isErrorOrWarning - (BOOL) isAnyErrorOrWarning
{ {
return fStat->error != TR_STAT_OK; return fStat->error != TR_STAT_OK;
} }
- (NSString *) errorMessage - (NSString *) errorMessage
{ {
if (![self isErrorOrWarning]) if (![self isAnyErrorOrWarning])
return @""; return @"";
NSString * error; NSString * error;
@ -994,7 +994,7 @@ int trashDataFile(const char * filename)
{ {
NSString * string; NSString * string;
if ([self isErrorOrWarning]) if ([self isAnyErrorOrWarning])
{ {
switch (fStat->error) switch (fStat->error)
{ {

View File

@ -429,7 +429,7 @@
[gradient release]; [gradient release];
} }
const BOOL error = [torrent isErrorOrWarning]; const BOOL error = [torrent isAnyErrorOrWarning];
//icon //icon
if (!minimal || !(!fTracking && fHoverAction)) //don't show in minimal mode when hovered over if (!minimal || !(!fTracking && fHoverAction)) //don't show in minimal mode when hovered over

View File

@ -139,7 +139,7 @@
- (NSCell *) outlineView: (NSOutlineView *) outlineView dataCellForTableColumn: (NSTableColumn *) tableColumn item: (id) item - (NSCell *) outlineView: (NSOutlineView *) outlineView dataCellForTableColumn: (NSTableColumn *) tableColumn item: (id) item
{ {
BOOL group = ![item isKindOfClass: [Torrent class]]; const BOOL group = ![item isKindOfClass: [Torrent class]];
if (!tableColumn) if (!tableColumn)
return !group ? fTorrentCell : nil; return !group ? fTorrentCell : nil;
else else