diff --git a/macosx/StringAdditions.h b/macosx/StringAdditions.h index cb4ed5d13..421626bb3 100644 --- a/macosx/StringAdditions.h +++ b/macosx/StringAdditions.h @@ -37,5 +37,6 @@ + (NSString *) stringForRatio: (float) ratio; - (NSComparisonResult) compareIP: (NSString *) string; +- (NSComparisonResult) clientCompare: (NSString *) string; @end diff --git a/macosx/Torrent.m b/macosx/Torrent.m index dc0de9a9e..642118ea5 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -740,21 +740,36 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 tr_setDownloadLimit(fHandle, 0); tr_setUploadLimit(fHandle, 0); - [[NSFileManager defaultManager] movePath: [oldFolder stringByAppendingPathComponent: [self name]] - toPath: [folder stringByAppendingPathComponent: [self name]] handler: nil]; - - //get rid of both incomplete folder and old download folder, even if move failed - fUseIncompleteFolder = NO; - if (fIncompleteFolder) + if ([[NSFileManager defaultManager] movePath: [oldFolder stringByAppendingPathComponent: [self name]] + toPath: [folder stringByAppendingPathComponent: [self name]] handler: nil]) { - [fIncompleteFolder release]; - fIncompleteFolder = nil; + //get rid of both incomplete folder and old download folder, even if move failed + fUseIncompleteFolder = NO; + if (fIncompleteFolder) + { + [fIncompleteFolder release]; + fIncompleteFolder = nil; + } + [self setDownloadFolder: folder]; + + [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateInfoSettings" object: nil]; + + [self updateSpeedSetting]; } - [self setDownloadFolder: folder]; + else + { + [self updateSpeedSetting]; //restart before showing the alert - [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateInfoSettings" object: nil]; - - [self updateSpeedSetting]; + NSAlert * alert = [[NSAlert alloc] init]; + [alert setMessageText: NSLocalizedString(@"There was an error moving the data file.", "Move error alert -> title")]; + [alert setInformativeText: [NSString stringWithFormat: + NSLocalizedString(@"The move operation of \"%@\" cannot be done.", + " Move error alert -> message"), [self name]]]; + [alert addButtonWithTitle: NSLocalizedString(@"OK", "Move error alert -> button")]; + + [alert runModal]; + [alert release]; + } } }