Changeset 3063


Ignore:
Timestamp:
Sep 14, 2007, 1:49:37 PM (15 years ago)
Author:
livings124
Message:

get inspector ready for encryption

Location:
trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Transmission.xcodeproj/project.pbxproj

    r3047 r3063  
    5252                A200B9200A22798F007BBB1E /* InfoWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = A200B83A0A2263BA007BBB1E /* InfoWindowController.m */; };
    5353                A200B9B60A22893D007BBB1E /* InfoWindow.nib in Resources */ = {isa = PBXBuildFile; fileRef = A200B9620A227FD0007BBB1E /* InfoWindow.nib */; };
     54                A2041D530C9AC523000ACFFB /* Lock.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A2041D520C9AC523000ACFFB /* Lock.tiff */; };
    5455                A2085DDC0C53BC74000BC3B7 /* AboutWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = A2085DDA0C53BC74000BC3B7 /* AboutWindowController.m */; };
    5556                A2085E020C53C16F000BC3B7 /* AboutWindow.nib in Resources */ = {isa = PBXBuildFile; fileRef = A2085E000C53C16F000BC3B7 /* AboutWindow.nib */; };
     
    343344                A200B83A0A2263BA007BBB1E /* InfoWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = InfoWindowController.m; path = macosx/InfoWindowController.m; sourceTree = "<group>"; };
    344345                A200B9630A227FD0007BBB1E /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = macosx/English.lproj/InfoWindow.nib; sourceTree = "<group>"; };
     346                A2041D520C9AC523000ACFFB /* Lock.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = Lock.tiff; path = macosx/Images/Lock.tiff; sourceTree = "<group>"; };
    345347                A204310F0C5EAF490081E5CC /* Russian */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Russian; path = macosx/Russian.lproj/AboutWindow.nib; sourceTree = "<group>"; };
    346348                A20431100C5EAF490081E5CC /* Russian */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = Russian; path = macosx/Russian.lproj/InfoPlist.strings; sourceTree = "<group>"; };
     
    759761                                A20B6F6A0C4D842B0034AB1D /* PriorityLow.png */,
    760762                                A20B6F820C4D8A610034AB1D /* PriorityHigh.png */,
     763                                A2041D520C9AC523000ACFFB /* Lock.tiff */,
    761764                                A2FB06950BFF484A0095564D /* Globe.png */,
    762765                                A261A8250C6A0D68003BAFDA /* Error.png */,
     
    13371340                                A261A8260C6A0D68003BAFDA /* Error.png in Resources */,
    13381341                                A2EF7DEC0C96297400FA9811 /* PurpleDot.png in Resources */,
     1342                                A2041D530C9AC523000ACFFB /* Lock.tiff in Resources */,
    13391343                        );
    13401344                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/macosx/Controller.m

    r3023 r3063  
    9393#define DONATE_URL   @"http://transmission.m0k.org/donate.php"
    9494
    95 static void sleepCallBack(void * controller, io_service_t y, natural_t messageType, void * messageArgument)
    96 {
    97     Controller * c = controller;
    98     [c sleepCallBack: messageType argument: messageArgument];
     95void sleepCallBack(void * controller, io_service_t y, natural_t messageType, void * messageArgument)
     96{
     97    [(Controller *)controller sleepCallBack: messageType argument: messageArgument];
    9998}
    10099
     
    303302    IONotificationPortRef notify;
    304303    io_object_t iterator;
    305     if (fRootPort = IORegisterForSystemPower(self, & notify, sleepCallBack, & iterator))
     304    if ((fRootPort = IORegisterForSystemPower(self, & notify, sleepCallBack, & iterator)) != 0)
    306305        CFRunLoopAddSource(CFRunLoopGetCurrent(), IONotificationPortGetRunLoopSource(notify), kCFRunLoopCommonModes);
    307306    else
    308307        NSLog(@"Could not IORegisterForSystemPower");
    309 
     308   
    310309    //load previous transfers
    311310    NSArray * history = [[NSArray alloc] initWithContentsOfFile: [[self applicationSupportFolder]
     
    30843083
    30853084        case kIOMessageCanSystemSleep:
    3086            
    30873085            allowSleep = YES;
    30883086            if ([fDefaults boolForKey: @"SleepPrevent"])
  • trunk/macosx/InfoWindowController.h

    r3047 r3063  
    3232{
    3333    NSArray * fTorrents, * fPeers, * fFiles;
    34     NSImage * fAppIcon, * fDotGreen, * fDotRed;
     34    NSImage * fAppIcon, * fDotGreen, * fDotRed, * fLockImage;
    3535   
    3636    BOOL fCanResizeVertical;
  • trunk/macosx/InfoWindowController.m

    r3053 r3063  
    809809        if ([ident isEqualToString: @"Connected"])
    810810            return [[peer objectForKey: @"Connected"] boolValue] ? fDotGreen : fDotRed;
     811        else if ([ident isEqualToString: @"Encryption"])
     812        {
     813            /*if ([[peer objectForKey: @"Encryption"] boolValue])
     814            {
     815                if (!fLockImage)
     816                    fLockImage = [NSImage imageNamed: @"Lock.tiff"];
     817                return fLockImage;
     818            }
     819            else*/
     820                return nil;
     821        }
    811822        else if ([ident isEqualToString: @"Client"])
    812823            return [peer objectForKey: @"Client"];
     
    863874    {
    864875        NSDictionary * peer = [fPeers objectAtIndex: row];
    865        
    866         NSMutableArray * components = [NSMutableArray arrayWithCapacity: 3];
    867        
    868         if ([[peer objectForKey: @"Connected"] boolValue])
     876        BOOL connected = [[peer objectForKey: @"Connected"] boolValue];
     877       
     878        NSMutableArray * components = [NSMutableArray arrayWithCapacity: connected ? 4 : 2];
     879       
     880        if (connected)
    869881            [components addObject: [NSString stringWithFormat:
    870882                                    NSLocalizedString(@"Progress: %.1f%%", "Inspector -> Peers tab -> table row tooltip"),
     
    888900            [components addObject: NSLocalizedString(@"From: tracker", "Inspector -> Peers tab -> table row tooltip")];
    889901       
     902        /*if (connected && [[peer objectForKey: @"Encryption"] boolValue])
     903            [components addObject: @"Encrypted Connection"];*/
     904       
    890905        return [components componentsJoinedByString: @"\n"];
    891906    }
    892907    return nil;
     908}
     909
     910- (NSArray *) peerSortDescriptors
     911{
     912    NSMutableArray * descriptors = [NSMutableArray array];
     913   
     914    NSArray * oldDescriptors = [fPeerTable sortDescriptors];
     915    BOOL useSecond = YES, asc = YES;
     916    if ([oldDescriptors count] > 0)
     917    {
     918        NSSortDescriptor * descriptor = [oldDescriptors objectAtIndex: 0];
     919        [descriptors addObject: descriptor];
     920       
     921        if ((useSecond = ![[descriptor key] isEqualToString: @"IP"]))
     922            asc = [descriptor ascending];
     923    }
     924   
     925    //sort by IP after primary sort
     926    if (useSecond)
     927    {
     928        NSSortDescriptor * secondDescriptor = [[NSSortDescriptor alloc] initWithKey: @"IP" ascending: asc
     929                                                                        selector: @selector(compareIP:)];
     930        [descriptors addObject: secondDescriptor];
     931        [secondDescriptor release];
     932    }
     933   
     934    return descriptors;
    893935}
    894936
     
    10011043    [fFileOutline setHoverRowForEvent: [[[fTabView selectedTabViewItem] identifier] isEqualToString: TAB_FILES_IDENT]
    10021044                                        ? event : nil];
    1003 }
    1004 
    1005 - (NSArray *) peerSortDescriptors
    1006 {
    1007     NSMutableArray * descriptors = [NSMutableArray array];
    1008    
    1009     NSArray * oldDescriptors = [fPeerTable sortDescriptors];
    1010     BOOL useSecond = YES, asc = YES;
    1011     if ([oldDescriptors count] > 0)
    1012     {
    1013         NSSortDescriptor * descriptor = [oldDescriptors objectAtIndex: 0];
    1014         [descriptors addObject: descriptor];
    1015        
    1016         if ((useSecond = ![[descriptor key] isEqualToString: @"IP"]))
    1017             asc = [descriptor ascending];
    1018     }
    1019    
    1020     //sort by IP after primary sort
    1021     if (useSecond)
    1022     {
    1023         NSSortDescriptor * secondDescriptor = [[NSSortDescriptor alloc] initWithKey: @"IP" ascending: asc
    1024                                                                         selector: @selector(compareIP:)];
    1025         [descriptors addObject: secondDescriptor];
    1026         [secondDescriptor release];
    1027     }
    1028    
    1029     return descriptors;
    10301045}
    10311046
  • trunk/macosx/Torrent.m

    r2996 r3063  
    10401040                [dic setObject: [NSNumber numberWithFloat: peer->downloadFromRate] forKey: @"DL From Rate"];
    10411041           
     1042            //[dic setObject: [NSNumber numberWithBool: peer->isEncrypted] forKey: @"Encryption"];
     1043           
    10421044            [dic setObject: [NSString stringWithCString: (char *) peer->client encoding: NSUTF8StringEncoding] forKey: @"Client"];
    10431045        }
Note: See TracChangeset for help on using the changeset viewer.