Changeset 2284


Ignore:
Timestamp:
Jul 4, 2007, 6:14:58 PM (15 years ago)
Author:
livings124
Message:

make sure the windows are closed before removing torrents...avoids a crash-on-quit

Location:
trunk/macosx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r2281 r2284  
    548548    }
    549549   
     550    //remember window states and close all windows
     551    [fDefaults setBool: [[fInfoController window] isVisible] forKey: @"InfoVisible"];
     552    [[NSApp windows] makeObjectsPerformSelector: @selector(close)];
     553    [self showStatusBar: NO animate: NO];
     554    [self showFilterBar: NO animate: NO];
     555   
    550556    //save history
    551557    [self updateTorrentHistory];
     
    562568    //disable NAT traversal
    563569    tr_natTraversalEnable(fLib, 0);
    564    
    565     //remember window states and close all windows
    566     [fDefaults setBool: [[fInfoController window] isVisible] forKey: @"InfoVisible"];
    567     [[NSApp windows] makeObjectsPerformSelector: @selector(close)];
    568     [self showStatusBar: NO animate: NO];
    569     [self showFilterBar: NO animate: NO];
    570570   
    571571    //clear badge
  • trunk/macosx/Torrent.m

    r2277 r2284  
    521521    NSMutableDictionary * info = [NSMutableDictionary dictionaryWithObjectsAndKeys:
    522522                                    [self name], @"Name",
    523                                     [NSNumber numberWithBool: [self isSeeding]], @"Seeding",
    524523                                    [NSNumber numberWithFloat: [self progress]], @"Progress",
    525524                                    [NSNumber numberWithFloat: (float)fStat->left/[self size]], @"Left",
    526525                                    [NSNumber numberWithBool: [self isActive]], @"Active",
     526                                    [NSNumber numberWithBool: [self isSeeding]], @"Seeding",
    527527                                    [NSNumber numberWithBool: [self isChecking]], @"Checking",
    528528                                    [NSNumber numberWithBool: [self isError]], @"Error", nil];
  • trunk/macosx/TorrentCell.h

    r2277 r2284  
    3232{
    3333    NSImage * fErrorImage;
    34     CTGradient * fWhiteGradient, * fGrayGradient, * fLightGrayGradient, * fLightGreenGradient,
    35                 * fGreenGradient, * fYellowGradient, * fBlueGradient, * fTransparentGradient;
     34    CTGradient * fWhiteGradient, * fGrayGradient, * fLightGrayGradient, * fBlueGradient, * fDarkBlueGradient,
     35                * fGreenGradient, * fLightGreenGradient, * fDarkGreenGradient, * fYellowGradient, * fTransparentGradient;
    3636    NSUserDefaults * fDefaults;
    3737}
  • trunk/macosx/TorrentCell.m

    r2277 r2284  
    5151        fLightGrayGradient = [[CTGradient progressLightGrayGradient] retain];
    5252        fBlueGradient = [[CTGradient progressBlueGradient] retain];
     53        //fDarkBlueGradient = [[CTGradient progressDarkBlueGradient] retain];
    5354        fGreenGradient = [[CTGradient progressGreenGradient] retain];
    5455        fLightGreenGradient = [[CTGradient progressLightGreenGradient] retain];
     56        //fDarkGreenGradient = [[CTGradient progressDarkGreenGradient] retain];
    5557        fYellowGradient = [[CTGradient progressYellowGradient] retain];
    5658        fTransparentGradient = [[CTGradient progressTransparentGradient] retain];
     
    102104    }
    103105   
    104     if ([[info objectForKey: @"Checking"] boolValue])
    105         [fYellowGradient fillRect: completeBounds angle: -90];
    106     else if ([[info objectForKey: @"Seeding"] boolValue])
    107     {
    108         NSRect ratioBounds = completeBounds;
    109         ratioBounds.size.width *= [[info objectForKey: @"ProgressStopRatio"] floatValue];
    110        
    111         if (ratioBounds.size.width < completeBounds.size.width)
    112             [fLightGreenGradient fillRect: completeBounds angle: -90];
    113         [fGreenGradient fillRect: ratioBounds angle: -90];
    114     }
    115     else if ([[info objectForKey: @"Active"] boolValue])
    116         [fBlueGradient fillRect: completeBounds angle: -90];
     106    if ([[info objectForKey: @"Active"] boolValue])
     107    {
     108        if ([[info objectForKey: @"Checking"] boolValue])
     109            [fYellowGradient fillRect: completeBounds angle: -90];
     110        else if ([[info objectForKey: @"Seeding"] boolValue])
     111        {
     112            NSRect ratioBounds = completeBounds;
     113            ratioBounds.size.width *= [[info objectForKey: @"ProgressStopRatio"] floatValue];
     114           
     115            if (ratioBounds.size.width < completeBounds.size.width)
     116                [fLightGreenGradient fillRect: completeBounds angle: -90];
     117        }
     118        else
     119            [fBlueGradient fillRect: completeBounds angle: -90];
     120    }
    117121    else
    118122        [fGrayGradient fillRect: completeBounds angle: -90];
Note: See TracChangeset for help on using the changeset viewer.