Changeset 2117
- Timestamp:
- Jun 17, 2007, 4:57:58 AM (15 years ago)
- Location:
- branches/file_selection/macosx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/file_selection/macosx/CreatorWindowController.m
r2113 r2117 33 33 - (void) locationSheetClosed: (NSSavePanel *) openPanel returnCode: (int) code contextInfo: (void *) info; 34 34 - (void) checkProgress: (NSTimer *) timer; 35 - (void) failureSheetClosed: (NSAlert *) alert returnCode: (int) code contextInfo: (void *) info; 35 36 36 37 @end … … 103 104 [fStatusField setStringValue: statusString]; 104 105 105 [fPiecesField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d pieces, %@ each", "Create torrent -> info"), 106 fInfo->pieceCount, [NSString stringForFileSize: fInfo->pieceSize]]]; 106 NSString * piecesCountString; 107 int piecesCount = fInfo->pieceCount; 108 if (piecesCount == 1) 109 piecesCountString = NSLocalizedString(@"1 piece", "Create torrent -> info"); 110 else 111 piecesCountString = [NSString stringWithFormat: NSLocalizedString(@"%d pieces", "Create torrent -> info"), 112 piecesCount]; 113 [fPiecesField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%@, %@ each", "Create torrent -> info"), 114 piecesCountString, [NSString stringForFileSize: fInfo->pieceSize]]]; 107 115 108 116 fLocation = [[[DEFAULT_SAVE_LOCATION stringByAppendingPathComponent: [name stringByAppendingPathExtension: @"torrent"]] … … 229 237 timer = nil; 230 238 231 #warning check failed or not232 233 239 if ([[self window] attachedSheet]) 240 { 234 241 [NSApp endSheet: fProgressWindow]; 235 [fProgressWindow orderOut: nil]; 242 [fProgressWindow orderOut: nil]; 243 } 244 245 if (fInfo->failed /*&& !fInfo->abortFlag*/) 246 { 247 NSAlert * alert = [[[NSAlert alloc] init] autorelease]; 248 [alert addButtonWithTitle: NSLocalizedString(@"OK", "Create torrent -> failed -> button")]; 249 [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"Creation of \"%@\" failed.", 250 "Create torrent -> failed -> title"), [fLocation lastPathComponent]]]; 251 [alert setInformativeText: NSLocalizedString(@"There was an error parsing the data file. " 252 "The torrent file was not created.", "Create torrent -> failed -> warning")]; 253 [alert setAlertStyle: NSWarningAlertStyle]; 254 255 [alert beginSheetModalForWindow: [self window] modalDelegate: self 256 didEndSelector: @selector(failureSheetClosed:returnCode:contextInfo:) contextInfo: nil]; 257 return; 258 } 236 259 237 260 #warning add to T … … 248 271 } 249 272 273 - (void) failureSheetClosed: (NSAlert *) alert returnCode: (int) code contextInfo: (void *) info 274 { 275 [[alert window] orderOut: nil]; 276 [[self window] close: nil]; 277 } 278 250 279 @end
Note: See TracChangeset
for help on using the changeset viewer.