Ignore:
Timestamp:
Aug 27, 2011, 11:54:10 PM (10 years ago)
Author:
livings124
Message:

add an RPC session callback for when queue order changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r12768 r12772  
    41444144            break;
    41454145       
     4146        case TR_RPC_SESSION_QUEUE_POSITIONS_CHANGED:
     4147            [self performSelectorOnMainThread: @selector(rpcUpdateQueue) withObject: nil waitUntilDone: NO];
     4148            break;
     4149       
    41464150        case TR_RPC_SESSION_CHANGED:
    41474151            [fPrefsController performSelectorOnMainThread: @selector(rpcUpdatePrefs) withObject: nil waitUntilDone: NO];
     
    42254229}
    42264230
     4231- (void) rpcUpdateQueue
     4232{
     4233    NSLog(@"rpcUpdateQueue");
     4234   
     4235    for (Torrent * torrent in fTorrents)
     4236        [torrent update];
     4237   
     4238    NSSortDescriptor * descriptor = [[NSSortDescriptor alloc] initWithKey: @"queuePosition" ascending: YES];
     4239    NSArray * descriptors = [NSArray arrayWithObject: descriptor];
     4240    [descriptor release];
     4241   
     4242    [fTorrents sortUsingDescriptors: descriptors];
     4243   
     4244    [self fullUpdateUI];
     4245}
     4246
    42274247@end
Note: See TracChangeset for help on using the changeset viewer.