Changeset 2383


Ignore:
Timestamp:
Jul 18, 2007, 12:59:08 AM (15 years ago)
Author:
livings124
Message:

images for priorities, courtesy of BigBossman?

Location:
trunk
Files:
5 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/AUTHORS

    r2262 r2383  
    7272 + Finnish GTK+ translation
    7373
     74
    7475Thanks to:
    7576
     
    105106 + Various images
    106107
     108George Tsotsos
     109 + Various images
     110
    107111Nick Pucius
    108112 + Mac OS X Help documentation
  • trunk/Transmission.xcodeproj/project.pbxproj

    r2322 r2383  
    5353                A200B9B60A22893D007BBB1E /* InfoWindow.nib in Resources */ = {isa = PBXBuildFile; fileRef = A200B9620A227FD0007BBB1E /* InfoWindow.nib */; };
    5454                A20AB97B0A5C622A004F81FA /* SmallTurtle.png in Resources */ = {isa = PBXBuildFile; fileRef = A20AB97A0A5C622A004F81FA /* SmallTurtle.png */; };
     55                A20B6F6B0C4D842B0034AB1D /* PriorityLow.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6F6A0C4D842B0034AB1D /* PriorityLow.png */; };
     56                A20B6F830C4D8A610034AB1D /* PriorityHigh.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6F820C4D8A610034AB1D /* PriorityHigh.png */; };
     57                A20B6F8C0C4D90980034AB1D /* PriorityMixed.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6F8B0C4D90980034AB1D /* PriorityMixed.png */; };
     58                A20B6FA50C4D97840034AB1D /* PriorityNone.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6FA40C4D97840034AB1D /* PriorityNone.png */; };
     59                A20B6FAE0C4D9B040034AB1D /* PriorityNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6FAD0C4D9B040034AB1D /* PriorityNormal.png */; };
    5560                A21567ED0A9A5034004DECD6 /* MessageWindow.nib in Resources */ = {isa = PBXBuildFile; fileRef = A21567EB0A9A5034004DECD6 /* MessageWindow.nib */; };
    5661                A215760B0C0D449A0057A26A /* BezierPathAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = A21576090C0D449A0057A26A /* BezierPathAdditions.m */; };
     
    330335                A200B9630A227FD0007BBB1E /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = macosx/English.lproj/InfoWindow.nib; sourceTree = "<group>"; };
    331336                A20AB97A0A5C622A004F81FA /* SmallTurtle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = SmallTurtle.png; path = macosx/Images/SmallTurtle.png; sourceTree = "<group>"; };
     337                A20B6F6A0C4D842B0034AB1D /* PriorityLow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityLow.png; path = macosx/Images/PriorityLow.png; sourceTree = "<group>"; };
     338                A20B6F820C4D8A610034AB1D /* PriorityHigh.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityHigh.png; path = macosx/Images/PriorityHigh.png; sourceTree = "<group>"; };
     339                A20B6F8B0C4D90980034AB1D /* PriorityMixed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityMixed.png; path = macosx/Images/PriorityMixed.png; sourceTree = "<group>"; };
     340                A20B6FA40C4D97840034AB1D /* PriorityNone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityNone.png; path = macosx/Images/PriorityNone.png; sourceTree = "<group>"; };
     341                A20B6FAD0C4D9B040034AB1D /* PriorityNormal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityNormal.png; path = macosx/Images/PriorityNormal.png; sourceTree = "<group>"; };
    332342                A21567EC0A9A5034004DECD6 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = macosx/English.lproj/MessageWindow.nib; sourceTree = "<group>"; };
    333343                A21576090C0D449A0057A26A /* BezierPathAdditions.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = BezierPathAdditions.m; path = macosx/BezierPathAdditions.m; sourceTree = "<group>"; };
     
    667677                                A259316A0A73B2CC002F4FE7 /* Transmission Help */,
    668678                                A2F8951E0A2D4BA500ED2127 /* Credits.rtf */,
     679                                A20B6FA40C4D97840034AB1D /* PriorityNone.png */,
     680                                A20B6F8B0C4D90980034AB1D /* PriorityMixed.png */,
     681                                A20B6FAD0C4D9B040034AB1D /* PriorityNormal.png */,
     682                                A20B6F6A0C4D842B0034AB1D /* PriorityLow.png */,
     683                                A20B6F820C4D8A610034AB1D /* PriorityHigh.png */,
    669684                                A2FB06950BFF484A0095564D /* Globe.png */,
    670685                                A260C9AB0AA3B8D700FDC1B7 /* Error.tiff */,
     
    11901205                                A2E9AA760C249AF400085DCF /* Create.png in Resources */,
    11911206                                A2F011990C27418800576FC0 /* CreateLarge.png in Resources */,
     1207                                A20B6F6B0C4D842B0034AB1D /* PriorityLow.png in Resources */,
     1208                                A20B6F830C4D8A610034AB1D /* PriorityHigh.png in Resources */,
     1209                                A20B6F8C0C4D90980034AB1D /* PriorityMixed.png in Resources */,
     1210                                A20B6FA50C4D97840034AB1D /* PriorityNone.png in Resources */,
     1211                                A20B6FAE0C4D9B040034AB1D /* PriorityNormal.png in Resources */,
    11921212                        );
    11931213                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/libtransmission/clients.c

    r2378 r2383  
    3333    if( character >= 'A' && character <= 'Z' )
    3434        value = 10 + character - 'A';
     35    else if( character >= 'a' && character <= 'z')
     36        value = 36 + character - 'a';
    3537    else
    3638        value = character - '0';
  • trunk/macosx/FileOutlineView.m

    r2367 r2383  
    135135}
    136136
    137 - (void) drawRect: (NSRect) r
    138 {
    139     [super drawRect: r];
    140    
    141     NSDictionary * item;
    142     NSIndexSet * indexSet;
    143     int i, count, priority;
    144     Torrent * torrent = [(InfoWindowController *)[[self window] windowController] selectedTorrent];
    145     for (i = 0; i < [self numberOfRows]; i++)
    146     {
    147         if ([self isRowSelected: i])
    148         {
    149             item = [self itemAtRow: i];
    150             if ([[item objectForKey: @"IsFolder"] boolValue])
    151                 continue;
    152            
    153             NSSet * priorities = [torrent filePrioritiesForIndexes: [item objectForKey: @"Indexes"]];
    154             if ([priorities count] != 1)
    155                 continue;
    156            
    157             priority = [[priorities anyObject] intValue];
    158             if (priority == TR_PRI_LOW)
    159                 [fLowPriorityColor set];
    160             else if (priority == TR_PRI_HIGH)
    161                 [fHighPriorityColor set];
    162             else
    163                 continue;
    164        
    165             NSRect rect = [self rectOfRow: i];
    166             float width = 14.0;
    167             rect.origin.y += (rect.size.height - width) * 0.5;
    168             rect.origin.x += 3.0;
    169             rect.size.width = width;
    170             rect.size.height = width;
    171            
    172             [[NSBezierPath bezierPathWithOvalInRect: rect] fill];
    173         }
    174     }
    175 }
    176 
    177137@end
  • trunk/macosx/FilePriorityCell.h

    r2193 r2383  
    77{
    88    NSMutableDictionary * fItem;
     9   
     10    NSImage * fLowImage, * fHighImage, * fNormalImage, * fMixedImage, * fNoneImage;
    911}
    1012
  • trunk/macosx/FilePriorityCell.m

    r2368 r2383  
    5454   
    5555    int count = [priorities count];
    56     if (count == 0)
    57         return;
    58    
    59     BOOL low = [priorities containsObject: [NSNumber numberWithInt: TR_PRI_LOW]],
    60         normal = [priorities containsObject: [NSNumber numberWithInt: TR_PRI_NORMAL]],
    61         high = [priorities containsObject: [NSNumber numberWithInt: TR_PRI_HIGH]];
    6256   
    6357    FileOutlineView * view = (FileOutlineView *)[self controlView];
    6458    int row = [view hoverRow];
    65     if (row != -1 && [view itemAtRow: row] == fItem)
     59    if (count > 0 && row != -1 && [view itemAtRow: row] == fItem)
    6660    {
    67         [super setSelected: low forSegment: 0];
    68         [super setSelected: normal forSegment: 1];
    69         [super setSelected: high forSegment: 2];
     61        [super setSelected: [priorities containsObject: [NSNumber numberWithInt: TR_PRI_LOW]] forSegment: 0];
     62        [super setSelected: [priorities containsObject: [NSNumber numberWithInt: TR_PRI_NORMAL]] forSegment: 1];
     63        [super setSelected: [priorities containsObject: [NSNumber numberWithInt: TR_PRI_HIGH]] forSegment: 2];
    7064       
    7165        [super drawWithFrame: cellFrame inView: controlView];
     
    7367    else
    7468    {
    75         if (high || low)
     69        NSImage * image;
     70        if (count == 0)
    7671        {
    77             BOOL highlighted = [self isHighlighted] && [[self highlightColorWithFrame: cellFrame inView: controlView]
    78                                         isEqual: [NSColor alternateSelectedControlColor]];
    79             NSDictionary * attributes = [[NSDictionary alloc] initWithObjectsAndKeys:
    80                             highlighted ? [NSColor whiteColor] : [NSColor controlTextColor], NSForegroundColorAttributeName,
    81                             [NSFont messageFontOfSize: 18.0], NSFontAttributeName, nil];
    82            
    83             NSString * text;
    84             if (count > 1)
    85                 text = @"*";
    86             else if (low)
    87                 text = @"-";
    88             else
    89                 text = @"+";
    90            
    91             NSSize textSize = [text sizeWithAttributes: attributes];
    92             NSRect textRect = NSMakeRect(cellFrame.origin.x + (cellFrame.size.width - textSize.width) * 0.5,
    93                                     cellFrame.origin.y + (cellFrame.size.height - textSize.height) * 0.5,
    94                                     textSize.width, textSize.height);
    95            
    96             [text drawInRect: textRect withAttributes: attributes];
     72            if (!fNoneImage)
     73                fNoneImage = [NSImage imageNamed: @"PriorityNone.png"];
     74            image = fNoneImage;
    9775        }
     76        else if (count > 1)
     77        {
     78            if (!fMixedImage)
     79                fMixedImage = [NSImage imageNamed: @"PriorityMixed.png"];
     80            image = fMixedImage;
     81        }
     82       
     83        else if ([priorities containsObject: [NSNumber numberWithInt: TR_PRI_NORMAL]])
     84        {
     85            if (!fNormalImage)
     86                fNormalImage = [NSImage imageNamed: @"PriorityNormal.png"];
     87            image = fNormalImage;
     88        }
     89        else if ([priorities containsObject: [NSNumber numberWithInt: TR_PRI_LOW]])
     90        {
     91            if (!fLowImage)
     92                fLowImage = [NSImage imageNamed: @"PriorityLow.png"];
     93            image = fLowImage;
     94        }
     95        else
     96        {
     97            if (!fHighImage)
     98                fHighImage = [NSImage imageNamed: @"PriorityHigh.png"];
     99            image = fHighImage;
     100        }
     101       
     102        NSSize imageSize = [image size];
     103        [image compositeToPoint: NSMakePoint(cellFrame.origin.x + (cellFrame.size.width - imageSize.width) * 0.5,
     104                cellFrame.origin.y + (cellFrame.size.height + imageSize.height) * 0.5) operation: NSCompositeSourceOver];
    98105    }
    99106}
  • trunk/macosx/Torrent.m

    r2370 r2383  
    278278                                    toPath: [fDownloadFolder stringByAppendingPathComponent: [self name]] handler: nil])
    279279                [self updateDownloadFolder];
     280            else
     281                canMove = NO;
    280282           
    281283            [self updateSpeedSetting];
Note: See TracChangeset for help on using the changeset viewer.