Changeset 906


Ignore:
Timestamp:
Sep 24, 2006, 11:02:08 PM (17 years ago)
Author:
livings124
Message:

Use the main gui's timer to update the pieces view rather than its own.

Location:
branches/nat-traversal
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/nat-traversal/PiecesWindowController.h

    r903 r906  
    2424
    2525- (void) setTorrent: (Torrent *) torrent;
    26 
    27 //- (void) viewFirst;
    28 - (void) updateView: (NSTimer *) timer;
     26- (void) updateView: (BOOL) first;
    2927
    3028@end
  • branches/nat-traversal/PiecesWindowController.m

    r904 r906  
    3737       
    3838        fExistingImage = [fBack copy];
    39        
    40         fTimer = [NSTimer scheduledTimerWithTimeInterval: 2.0 target: self
    41                     selector: @selector(updateView:) userInfo: nil repeats: YES];
    4239    }
    4340   
     
    7168- (void) setTorrent: (Torrent *) torrent
    7269{
     70    BOOL first = YES;
     71   
    7372    if (fTorrent)
    7473    {
     
    8079            [fImageView setImage: fBack];
    8180        }
     81        else
     82            first = NO;
    8283    }
    8384   
     
    8586    {
    8687        fTorrent = [torrent retain];
    87         [self updateView: nil];
     88        [self updateView: first];
    8889    }
    8990}
    9091
    91 - (void) updateView: (NSTimer *) timer
     92- (void) updateView: (BOOL) first
    9293{
    9394    if (!fTorrent)
     
    165166   
    166167    //reload the image regardless if it wasn't called by the timer
    167     if (change || !timer)
     168    if (change || first)
    168169    {
    169170        [fImageView setImage: nil];
  • branches/nat-traversal/macosx/Controller.m

    r904 r906  
    977977    if ([[fInfoController window] isVisible])
    978978        [fInfoController updateInfoStats];
     979   
     980    //update pieces viewer
     981    [fPiecesWindowController updateView: NO];
    979982
    980983    //badge dock
Note: See TracChangeset for help on using the changeset viewer.