Changeset 3180


Ignore:
Timestamp:
Sep 26, 2007, 3:27:00 AM (15 years ago)
Author:
livings124
Message:

getting mac version working with the changes from [3178], and specify total have and verified have in inspector

Location:
trunk
Files:
7 edited

Legend:

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

    r3177 r3180  
    357357                4DFBC2DE09C0970D00D5C571 /* Torrent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Torrent.m; path = macosx/Torrent.m; sourceTree = "<group>"; };
    358358                8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; name = Info.plist; path = macosx/Info.plist; sourceTree = "<group>"; };
    359                 8D1107320486CEB800E47090 /* Transmission.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = Transmission.app; sourceTree = BUILT_PRODUCTS_DIR; };
     359                8D1107320486CEB800E47090 /* Transmission.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Transmission.app; sourceTree = BUILT_PRODUCTS_DIR; };
    360360                A200B8390A2263BA007BBB1E /* InfoWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InfoWindowController.h; path = macosx/InfoWindowController.h; sourceTree = "<group>"; };
    361361                A200B83A0A2263BA007BBB1E /* InfoWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = InfoWindowController.m; path = macosx/InfoWindowController.m; sourceTree = "<group>"; };
  • trunk/macosx/InfoWindowController.h

    r3083 r3180  
    4545                        * fCreatorField, * fDateCreatedField,
    4646                        * fStateField, * fProgressField,
    47                         * fDownloadedValidField, * fDownloadedTotalField, * fUploadedTotalField,
     47                        * fHaveField, * fDownloadedTotalField, * fUploadedTotalField,
    4848                        * fRatioField, * fSwarmSpeedField;
    4949    IBOutlet NSTextView * fCommentView;
  • trunk/macosx/InfoWindowController.m

    r3124 r3180  
    155155            [fSizeField setStringValue: @""];
    156156   
    157             [fDownloadedValidField setStringValue: @""];
     157            [fHaveField setStringValue: @""];
    158158            [fDownloadedTotalField setStringValue: @""];
    159159            [fUploadedTotalField setStringValue: @""];
     
    375375        return;
    376376   
    377     uint64_t  downloadedValid = 0, downloadedTotal = 0, uploadedTotal = 0;
     377    uint64_t have = 0, haveVerified = 0, downloadedTotal = 0, uploadedTotal = 0;
    378378    Torrent * torrent;
    379379    NSEnumerator * enumerator = [fTorrents objectEnumerator];
    380380    while ((torrent = [enumerator nextObject]))
    381381    {
    382         downloadedValid += [torrent downloadedValid];
     382        have += [torrent haveTotal];
     383        haveVerified += [torrent haveVerified];
    383384        downloadedTotal += [torrent downloadedTotal];
    384385        uploadedTotal += [torrent uploadedTotal];
    385386    }
    386 
    387     [fDownloadedValidField setStringValue: [NSString stringForFileSize: downloadedValid]];
     387   
     388    if (have == 0)
     389        [fHaveField setStringValue: [NSString stringForFileSize: 0]];
     390    else if (have == haveVerified)
     391        [fHaveField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%@ verified", "Inspector -> Activity tab -> have"),
     392                                    [NSString stringForFileSize: haveVerified]]];
     393    else
     394        [fHaveField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%@ (%@ verified)", "Inspector -> Activity tab -> have"),
     395                                    [NSString stringForFileSize: have], [NSString stringForFileSize: haveVerified]]];
     396   
    388397    [fDownloadedTotalField setStringValue: [NSString stringForFileSize: downloadedTotal]];
    389398    [fUploadedTotalField setStringValue: [NSString stringForFileSize: uploadedTotal]];
  • trunk/macosx/Torrent.h

    r3136 r3180  
    189189- (float) downloadRate;
    190190- (float) uploadRate;
    191 - (uint64_t) downloadedValid;
     191- (uint64_t) haveVerified;
     192- (uint64_t) haveTotal;
    192193- (uint64_t) downloadedTotal;
    193194- (uint64_t) uploadedTotal;
  • trunk/macosx/Torrent.m

    r3150 r3180  
    282282        if ([fDefaults boolForKey: @"DisplayStatusProgressSelected"])
    283283        {
    284             uint64_t downloadedValid = [self downloadedValid];
     284            uint64_t have = [self haveTotal];
    285285            [progressString appendFormat: NSLocalizedString(@"%@ of %@ selected (%.2f%%)", "Torrent -> progress string"),
    286                             [NSString stringForFileSize: downloadedValid],
    287                             [NSString stringForFileSize: downloadedValid + fStat->left], 100.0 * [self progressDone]];
     286                            [NSString stringForFileSize: have], [NSString stringForFileSize: have + fStat->leftUntilDone],
     287                            100.0 * [self progressDone]];
    288288        }
    289289        else
    290290            [progressString appendFormat: NSLocalizedString(@"%@ of %@ (%.2f%%)", "Torrent -> progress string"),
    291                             [NSString stringForFileSize: [self downloadedValid]],
     291                            [NSString stringForFileSize: [self haveTotal]],
    292292                            [NSString stringForFileSize: [self size]], 100.0 * [self progress]];
    293293    }
     
    296296        if ([fDefaults boolForKey: @"DisplayStatusProgressSelected"])
    297297            [progressString appendFormat: NSLocalizedString(@"%@ selected, uploaded %@ (Ratio: %@)",
    298                 "Torrent -> progress string"), [NSString stringForFileSize: [self downloadedValid]],
     298                "Torrent -> progress string"), [NSString stringForFileSize: [self haveTotal]],
    299299                [NSString stringForFileSize: [self uploadedTotal]], [NSString stringForRatio: [self ratio]]];
    300300        else
    301301            [progressString appendFormat: NSLocalizedString(@"%@ of %@ (%.2f%%), uploaded %@ (Ratio: %@)",
    302                 "Torrent -> progress string"), [NSString stringForFileSize: [self downloadedValid]],
     302                "Torrent -> progress string"), [NSString stringForFileSize: [self haveTotal]],
    303303                [NSString stringForFileSize: [self size]], 100.0 * [self progress],
    304304                [NSString stringForFileSize: [self uploadedTotal]], [NSString stringForRatio: [self ratio]]];
     
    972972- (float) progressLeft
    973973{
    974     return (float)fStat->left/[self size];
     974    return (float)fStat->leftUntilDone/[self size];
    975975}
    976976
     
    11511151}
    11521152
    1153 - (uint64_t) downloadedValid
    1154 {
    1155     return fStat->downloadedValid;
     1153- (uint64_t) haveVerified
     1154{
     1155    return fStat->haveValid;
     1156}
     1157
     1158- (uint64_t) haveTotal
     1159{
     1160    return [self haveVerified] + fStat->haveUnchecked;
    11561161}
    11571162
    11581163- (uint64_t) downloadedTotal
    11591164{
    1160     return fStat->downloaded;
     1165    return fStat->downloadedEver;
    11611166}
    11621167
    11631168- (uint64_t) uploadedTotal
    11641169{
    1165     return fStat->uploaded;
     1170    return fStat->uploadedEver;
    11661171}
    11671172
  • trunk/macosx/en.lproj/InfoWindow.nib/classes.nib

    r3047 r3180  
    3434                fDownloadLimitPopUp = NSPopUpButton;
    3535                fDownloadedTotalField = NSTextField;
    36                 fDownloadedValidField = NSTextField;
    3736                fDownloadingFromField = NSTextField;
    3837                fErrorMessageView = NSTextView;
     
    4544                fFileUncheckItem = NSMenuItem;
    4645                fHashField = NSTextField;
     46                fHaveField = NSTextField;
    4747                fImageView = NSImageView;
    4848                fLeechersField = NSTextField;
Note: See TracChangeset for help on using the changeset viewer.