Changeset 450


Ignore:
Timestamp:
Jun 23, 2006, 6:08:55 PM (16 years ago)
Author:
livings124
Message:

Update the inspector when necessary through notifications, which will help once the wait check is added to the inspector.

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.h

    r446 r450  
    132132- (void) setQuickRatioGlobal: (id) sender;
    133133- (void) ratioGlobalChange: (NSNotification *) notification;
    134 - (void) ratioSingleChange: (NSNotification *) notification;
    135134
    136135- (void) checkWaitingForFinished: (NSNotification *) notification;
     136- (void) startSettingChange: (NSNotification *) notification;
     137
     138- (void) reloadInspector: (NSNotification *) notification;
    137139
    138140- (void) sleepCallBack: (natural_t) messageType argument:
  • trunk/macosx/Controller.m

    r449 r450  
    204204    fUpdateInProgress = NO;
    205205   
    206     [nc addObserver: self selector: @selector(ratioSingleChange:)
    207                     name: @"TorrentRatioChanged" object: nil];
    208    
    209206    [nc addObserver: self selector: @selector(limitGlobalChange:)
    210207                    name: @"LimitGlobalChange" object: nil];
     
    218215    [nc addObserver: self selector: @selector(startSettingChange:)
    219216                    name: @"StartSettingChange" object: nil];
     217   
     218    [nc addObserver: self selector: @selector(reloadInspector:)
     219                    name: @"TorrentSettingChange" object: nil];
    220220
    221221    //timer to update the interface
     
    234234    [fWindow makeKeyAndOrderFront: nil];
    235235
    236     [fInfoController updateInfoForTorrents: [self torrentsAtIndexes: [fTableView selectedRowIndexes]]];
     236    [self reloadInspector: nil];
    237237    if ([fDefaults boolForKey: @"InfoVisible"])
    238238        [self showInfo: nil];
     
    937937
    938938    [dict release];
    939 }
    940 
    941 - (void) ratioSingleChange: (NSNotification *) notification
    942 {
    943     //update info for changed ratio setting
    944     NSArray * torrents = [self torrentsAtIndexes: [fTableView selectedRowIndexes]];
    945     if ([torrents containsObject: [notification object]])
    946         [fInfoController updateInfoForTorrents: torrents];
    947939}
    948940
     
    10261018       
    10271019        int waitingCount = [waitingTorrents count];
    1028        
    10291020        if (amountToStart > 0 && waitingCount > 0)
    10301021        {
     
    10531044   
    10541045    [self updateUI: nil];
    1055     #warning reload inspector
     1046   
     1047    //update info for changed start setting
     1048    [self reloadInspector: nil];
     1049}
     1050
     1051- (void) reloadInspector: (NSNotification *) notification
     1052{
     1053    [fInfoController updateInfoForTorrents: [self torrentsAtIndexes: [fTableView selectedRowIndexes]]];
    10561054}
    10571055
     
    10931091- (void) tableViewSelectionDidChange: (NSNotification *) notification
    10941092{
    1095     [fInfoController updateInfoForTorrents: [self torrentsAtIndexes:
    1096                                     [fTableView selectedRowIndexes]]];
     1093    [self reloadInspector: nil];
    10971094}
    10981095
  • trunk/macosx/Torrent.m

    r446 r450  
    146146        fStat = tr_torrentStat(fHandle);
    147147       
    148         [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentRatioChanged" object: self];
     148        [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentSettingChange" object: self];
    149149    }
    150150
     
    232232        fFinishedSeeding = NO;
    233233        fWaitToStart = NO;
     234       
     235        [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentSettingChange" object: self];
    234236    }
    235237}
Note: See TracChangeset for help on using the changeset viewer.