Changeset 2189


Ignore:
Timestamp:
Jun 23, 2007, 10:00:09 PM (15 years ago)
Author:
livings124
Message:

only show the priority chooser when moused over (the text is a placeholder and the window has to currently be made active for it to appear)

Location:
trunk
Files:
4 added
12 edited

Legend:

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

    r2171 r2189  
    1111                35B038130AC5B6EB00A10FDF /* ResumeNoWaitOn.png in Resources */ = {isa = PBXBuildFile; fileRef = 35B037F90AC5B53800A10FDF /* ResumeNoWaitOn.png */; };
    1212                35B038140AC5B6EC00A10FDF /* ResumeNoWaitOff.png in Resources */ = {isa = PBXBuildFile; fileRef = 35B037FA0AC5B53800A10FDF /* ResumeNoWaitOff.png */; };
     13                35F372140C2D780600DAA8F2 /* InfoWindow.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 35F372120C2D780500DAA8F2 /* InfoWindow.h */; };
     14                35F372150C2D780600DAA8F2 /* InfoWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 35F372130C2D780600DAA8F2 /* InfoWindow.m */; };
     15                35F373020C2DA88F00DAA8F2 /* FilePriorityCell.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 35F373000C2DA88F00DAA8F2 /* FilePriorityCell.h */; };
     16                35F373030C2DA89000DAA8F2 /* FilePriorityCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 35F373010C2DA88F00DAA8F2 /* FilePriorityCell.m */; };
    1317                4D043A7F090AE979009FEDA8 /* TransmissionDocument.icns in Resources */ = {isa = PBXBuildFile; fileRef = 4D043A7E090AE979009FEDA8 /* TransmissionDocument.icns */; };
    1418                4D118E1A08CB46B20033958F /* PrefsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D118E1908CB46B20033958F /* PrefsController.m */; };
     
    251255                                A24F19210A3A796800C9C145 /* Sparkle.framework in CopyFiles */,
    252256                                A2DF37060C220D03006523C1 /* CreatorWindowController.h in CopyFiles */,
     257                                35F372140C2D780600DAA8F2 /* InfoWindow.h in CopyFiles */,
     258                                35F373020C2DA88F00DAA8F2 /* FilePriorityCell.h in CopyFiles */,
    253259                        );
    254260                        runOnlyForDeploymentPostprocessing = 0;
     
    268274                35B037F90AC5B53800A10FDF /* ResumeNoWaitOn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ResumeNoWaitOn.png; path = macosx/Images/ResumeNoWaitOn.png; sourceTree = "<group>"; };
    269275                35B037FA0AC5B53800A10FDF /* ResumeNoWaitOff.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ResumeNoWaitOff.png; path = macosx/Images/ResumeNoWaitOff.png; sourceTree = "<group>"; };
     276                35F372120C2D780500DAA8F2 /* InfoWindow.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = InfoWindow.h; path = macosx/InfoWindow.h; sourceTree = "<group>"; };
     277                35F372130C2D780600DAA8F2 /* InfoWindow.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = InfoWindow.m; path = macosx/InfoWindow.m; sourceTree = "<group>"; };
     278                35F373000C2DA88F00DAA8F2 /* FilePriorityCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = FilePriorityCell.h; path = macosx/FilePriorityCell.h; sourceTree = "<group>"; };
     279                35F373010C2DA88F00DAA8F2 /* FilePriorityCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = FilePriorityCell.m; path = macosx/FilePriorityCell.m; sourceTree = "<group>"; };
    270280                4C9F8F060BC5B68A002E5433 /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = French; path = macosx/French.lproj/InfoPlist.strings; sourceTree = "<group>"; };
    271281                4C9F8F070BC5B68A002E5433 /* French */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = French; path = macosx/French.lproj/InfoWindow.nib; sourceTree = "<group>"; };
     
    613623                                E138A9720C04D88F00C5426C /* CTGradient */,
    614624                                E1B6FBEB0C0D70AC0015FE4D /* UKKQueue */,
     625                                35F372120C2D780500DAA8F2 /* InfoWindow.h */,
     626                                35F372130C2D780600DAA8F2 /* InfoWindow.m */,
     627                                35F373000C2DA88F00DAA8F2 /* FilePriorityCell.h */,
     628                                35F373010C2DA88F00DAA8F2 /* FilePriorityCell.m */,
    615629                        );
    616630                        name = Sources;
     
    12791293                                A215760B0C0D449A0057A26A /* BezierPathAdditions.m in Sources */,
    12801294                                A2DF37070C220D03006523C1 /* CreatorWindowController.m in Sources */,
     1295                                35F372150C2D780600DAA8F2 /* InfoWindow.m in Sources */,
     1296                                35F373030C2DA89000DAA8F2 /* FilePriorityCell.m in Sources */,
    12811297                        );
    12821298                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/macosx/English.lproj/InfoWindow.nib/classes.nib

    r2178 r2189  
    33        {CLASS = FileOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
    44        {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
     5        {CLASS = InfoWindow; LANGUAGE = ObjC; SUPERCLASS = NSPanel; },
    56        {
    67            ACTIONS = {
  • trunk/macosx/English.lproj/InfoWindow.nib/info.nib

    r2179 r2189  
    44<dict>
    55        <key>IBDocumentLocation</key>
    6         <string>35 67 356 240 0 0 1152 842 </string>
     6        <string>29 56 356 240 0 0 1024 746 </string>
    77        <key>IBEditorPositions</key>
    88        <dict>
  • trunk/macosx/FileBrowserCell.m

    r2149 r2189  
    5252- (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView
    5353{
    54     NSMutableDictionary * item;
    55     if (!(item = [self objectValue]))
    56         return;
     54    NSMutableDictionary * item = [self objectValue];
    5755   
    5856    //image
  • trunk/macosx/FileOutlineView.h

    r2149 r2189  
    2828{
    2929    NSColor * fNormalColor, * fHighPriorityColor, * fLowPriorityColor;
     30   
     31    int fHoverRow;
    3032}
    3133
     34- (void) setHoverRowForEvent: (NSEvent *) event;
     35- (int) hoverRow;
     36
    3237@end
  • trunk/macosx/FileOutlineView.m

    r2188 r2189  
    4040    fHighPriorityColor = [[NSColor colorWithCalibratedRed: 0.678 green: 0.937 blue: 0.451 alpha: 1.0] retain];
    4141    fLowPriorityColor = [[NSColor colorWithCalibratedRed: 0.984 green: 0.878 blue: 0.431 alpha: 1.0] retain];
     42   
     43    fHoverRow = -1;
    4244}
    4345
     
    6971   
    7072    return [self menu];
     73}
     74
     75- (void) setHoverRowForEvent: (NSEvent *) event
     76{
     77    int row = -1;
     78    if (event)
     79    {
     80        NSPoint point = [self convertPoint: [event locationInWindow] fromView: nil];
     81        if (NSPointInRect(point, [self frame]))
     82            row = [self rowAtPoint: point];
     83    }
     84   
     85    if (row != fHoverRow)
     86    {
     87        if (fHoverRow != -1)
     88            [self reloadItem: [self itemAtRow: fHoverRow]];
     89        fHoverRow = row;
     90        if (fHoverRow != -1)
     91            [self reloadItem: [self itemAtRow: fHoverRow]];
     92    }
     93}
     94
     95- (int) hoverRow
     96{
     97    return fHoverRow;
    7198}
    7299
  • trunk/macosx/InfoWindowController.h

    r2179 r2189  
    2525#import <Cocoa/Cocoa.h>
    2626#import "Torrent.h"
     27#import "FileOutlineView.h"
    2728#import "PiecesView.h"
    2829#import <transmission.h>
     
    5455    IBOutlet NSSegmentedControl * fPiecesControl;
    5556   
    56     IBOutlet NSOutlineView * fFileOutline;
     57    IBOutlet FileOutlineView * fFileOutline;
    5758    IBOutlet NSTextField * fFileTableStatusField;
    5859    IBOutlet NSMenuItem * fFileCheckItem, * fFileUncheckItem,
     
    6263    IBOutlet NSTextField * fUploadLimitField, * fDownloadLimitField, * fRatioLimitField,
    6364                        * fUploadLimitLabel, * fDownloadLimitLabel;
    64         IBOutlet NSButton * fPexCheck;
     65    IBOutlet NSButton * fPexCheck;
    6566}
    6667
     
    7273- (void) setNextTab;
    7374- (void) setPreviousTab;
     75
     76- (void) setFileOutlineHoverRowForEvent: (NSEvent *) event;
    7477
    7578- (void) setPiecesView: (id) sender;
  • trunk/macosx/InfoWindowController.m

    r2183 r2189  
    2525#import "InfoWindowController.h"
    2626#import "FileBrowserCell.h"
     27#import "FilePriorityCell.h"
    2728#import "StringAdditions.h"
    2829
     
    8889    NSPanel * window = (NSPanel *)[self window];
    8990   
    90     [window setBecomesKeyOnlyIfNeeded: YES];
    91    
    9291    [window setFrameAutosaveName: @"InspectorWindowFrame"];
    9392    [window setFrameUsingName: @"InspectorWindowFrame"];
     
    110109   
    111110    //set file outline
    112     NSSegmentedCell * priorityCell = [[fFileOutline tableColumnWithIdentifier: @"Priority"] dataCell];
    113     int i;
    114     for (i = 0; i < [priorityCell segmentCount]; i++)
    115     {
    116         [priorityCell setLabel: @"" forSegment: i];
    117         [priorityCell setWidth: 6.0 forSegment: i];
    118     }
     111    FilePriorityCell * priorityCell = [[[FilePriorityCell alloc] initForParentView: fFileOutline] autorelease];
     112    [[fFileOutline tableColumnWithIdentifier: @"Priority"] setDataCell: priorityCell];
    119113   
    120114    //set blank inspector
     
    885879        [cell setEnabled: [[fTorrents objectAtIndex: 0] canChangeDownloadCheckForFiles: [item objectForKey: @"Indexes"]]];
    886880    else if ([identifier isEqualToString: @"Priority"])
    887     {
    888         Torrent * torrent = [fTorrents objectAtIndex: 0];
    889         NSIndexSet * indexeSet = [item objectForKey: @"Indexes"];
    890         [(NSSegmentedCell *)cell setSelected: [torrent hasFilePriority: PRIORITY_LOW forIndexes: indexeSet] forSegment: 0];
    891         [(NSSegmentedCell *)cell setSelected: [torrent hasFilePriority: PRIORITY_NORMAL forIndexes: indexeSet] forSegment: 1];
    892         [(NSSegmentedCell *)cell setSelected: [torrent hasFilePriority: PRIORITY_HIGH forIndexes: indexeSet] forSegment: 2];
    893        
    894         [cell setEnabled: [[fTorrents objectAtIndex: 0] canChangeDownloadCheckForFiles: [item objectForKey: @"Indexes"]]];
    895     }
     881        [(FilePriorityCell *)cell setItem: item];
    896882    else;
    897883}
     
    908894        [fFileOutline reloadData];
    909895    }
    910     else if ([identifier isEqualToString: @"Priority"])
    911     {
    912         if (![[fTorrents objectAtIndex: 0] canChangeDownloadCheckForFiles: [item objectForKey: @"Indexes"]])
    913             return;
    914        
    915         int priority = [object intValue], actualPriority;
    916         if (priority == 0)
    917             actualPriority = PRIORITY_LOW;
    918         else if (priority == 2)
    919             actualPriority = PRIORITY_HIGH;
    920         else
    921             actualPriority = PRIORITY_NORMAL;
    922        
    923         [[fTorrents objectAtIndex: 0] setFilePriority: actualPriority forIndexes: [item objectForKey: @"Indexes"]];
    924         [fFileOutline reloadData];
    925     }
    926896    else;
    927897}
     
    945915    else if ([ident isEqualToString: @"Priority"])
    946916    {
     917        #warning consider hidden
    947918        Torrent * torrent = [fTorrents objectAtIndex: 0];
    948919        NSIndexSet * indexSet = [item objectForKey: @"Indexes"];
     
    970941    else
    971942        return [outlineView rowHeight];
     943}
     944
     945#warning need?
     946- (void) setFileOutlineHoverRowForEvent: (NSEvent *) event
     947{
     948    [fFileOutline setHoverRowForEvent: [[[fTabView selectedTabViewItem] identifier] isEqualToString: TAB_FILES_IDENT] ? event : nil];
    972949}
    973950
  • trunk/macosx/PeerProgressIndicatorCell.h

    r1862 r2189  
    2727@interface PeerProgressIndicatorCell : NSLevelIndicatorCell
    2828{
    29     BOOL    isHidden;
     29    BOOL fIsHidden;
    3030}
    3131@end
  • trunk/macosx/PeerProgressIndicatorCell.m

    r1862 r2189  
    2929- (BOOL) hidden
    3030{
    31     return isHidden;
     31    return fIsHidden;
    3232}
    3333
    34 - (void) setHidden: (BOOL) hidden
     34- (void) setHidden: (BOOL) isHidden
    3535{
    36     isHidden = hidden;
     36    fIsHidden = isHidden;
    3737}
    3838
    3939- (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView
    4040{
    41     if (!isHidden)
     41    if (!fIsHidden)
    4242        [super drawWithFrame: cellFrame inView: controlView];
    4343}
  • trunk/macosx/Torrent.m

    r2188 r2189  
    16751675        [siblings addObject: dict];
    16761676       
     1677        [dict setObject: self forKey: @"Torrent"];
    16771678        if (isFolder)
    16781679        {
     
    16861687            [dict setObject: [[NSWorkspace sharedWorkspace] iconForFileType: [name pathExtension]] forKey: @"Icon"];
    16871688            [dict setObject: [NSNumber numberWithInt: priority] forKey: @"Priority"];
    1688             [dict setObject: self forKey: @"Torrent"];
    16891689           
    16901690            [flatList addObject: dict];
Note: See TracChangeset for help on using the changeset viewer.