Changeset 2123


Ignore:
Timestamp:
Jun 17, 2007, 6:17:43 AM (15 years ago)
Author:
livings124
Message:

fix a crash when canceling the creation

Location:
branches/file_selection/macosx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/file_selection/macosx/CreatorWindowController.m

    r2120 r2123  
    3232+ (NSString *) chooseFile;
    3333- (void) locationSheetClosed: (NSSavePanel *) openPanel returnCode: (int) code contextInfo: (void *) info;
    34 - (void) checkProgress: (NSTimer *) timer;
     34- (void) checkProgress;
    3535- (void) failureSheetClosed: (NSAlert *) alert returnCode: (int) code contextInfo: (void *) info;
    3636
     
    176176                    [fPrivateCheck state] == NSOnState);
    177177   
    178     fTimer = [NSTimer scheduledTimerWithTimeInterval: 0.1 target: self selector: @selector(checkProgress:)
     178    fTimer = [NSTimer scheduledTimerWithTimeInterval: 0.1 target: self selector: @selector(checkProgress)
    179179                        userInfo: nil repeats: YES];
    180180    [fTimer fire];
     
    230230}
    231231
    232 - (void) checkProgress: (NSTimer *) timer
     232- (void) checkProgress
    233233{
    234234    if (fInfo->isDone)
    235235    {
    236         [timer invalidate];
    237         timer = nil;
     236        [fTimer invalidate];
     237        fTimer = nil;
    238238       
    239239        if ([[self window] attachedSheet])
     
    243243        }
    244244       
    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         }
    259        
    260         #warning add to T
     245        if (fInfo->failed)
     246        {
     247            if (!fInfo->abortFlag)
     248            {
     249                NSAlert * alert = [[[NSAlert alloc] init] autorelease];
     250                [alert addButtonWithTitle: NSLocalizedString(@"OK", "Create torrent -> failed -> button")];
     251                [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"Creation of \"%@\" failed.",
     252                                                "Create torrent -> failed -> title"), [fLocation lastPathComponent]]];
     253                [alert setInformativeText: NSLocalizedString(@"There was an error parsing the data file. "
     254                                            "The torrent file was not created.", "Create torrent -> failed -> warning")];
     255                [alert setAlertStyle: NSWarningAlertStyle];
     256               
     257                [alert beginSheetModalForWindow: [self window] modalDelegate: self
     258                        didEndSelector: @selector(failureSheetClosed:returnCode:contextInfo:) contextInfo: nil];
     259                return;
     260            }
     261        }
     262        else
     263        {
     264            #warning add to T
     265        }
    261266       
    262267        [[self window] close];
  • branches/file_selection/macosx/English.lproj/Creator.nib/info.nib

    r2108 r2123  
    99        <key>IBOpenObjects</key>
    1010        <array>
     11                <integer>5</integer>
    1112                <integer>45</integer>
    12                 <integer>5</integer>
    1313        </array>
    1414        <key>IBSystem Version</key>
  • branches/file_selection/macosx/StringAdditions.m

    r1863 r2123  
    4848        return [NSString stringWithFormat: NSLocalizedString(@"%lld bytes", "File size"), size];
    4949
    50     float convertedSize = (float) size;
     50    float convertedSize = (float)size;
    5151    NSString * unit;
    5252    if (size < 1048576)
Note: See TracChangeset for help on using the changeset viewer.