hide peer progress bar for unconnected peers

This commit is contained in:
Mitchell Livingston 2007-05-10 00:43:51 +00:00
parent 5fe9d0fcea
commit abedda5dc4
6 changed files with 101 additions and 1 deletions

View File

@ -149,6 +149,8 @@
A29B0C270BD15FEF0006F230 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = A2F8951E0A2D4BA500ED2127 /* Credits.rtf */; };
A29C8B330ACC6E93000ED9F9 /* YellowDot.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A29C8B320ACC6E93000ED9F9 /* YellowDot.tiff */; };
A29C8B370ACC6EB3000ED9F9 /* PortChecker.m in Sources */ = {isa = PBXBuildFile; fileRef = A29C8B350ACC6EB3000ED9F9 /* PortChecker.m */; };
A2A1CB790BF29D5500AE959F /* PeerProgressIndicatorCell.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = A2A1CB770BF29D5500AE959F /* PeerProgressIndicatorCell.h */; };
A2A1CB7A0BF29D5500AE959F /* PeerProgressIndicatorCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A1CB780BF29D5500AE959F /* PeerProgressIndicatorCell.m */; };
A2A3065C0AAD24A80049E2AC /* UKFileWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306540AAD24A80049E2AC /* UKFileWatcher.m */; };
A2A3065E0AAD24A80049E2AC /* UKFNSubscribeFileWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306560AAD24A80049E2AC /* UKFNSubscribeFileWatcher.m */; };
A2A306600AAD24A80049E2AC /* UKKQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306580AAD24A80049E2AC /* UKKQueue.m */; };
@ -192,6 +194,7 @@
A261F1E40A69A1B10002815A /* Growl.framework in CopyFiles */,
A24F19210A3A796800C9C145 /* Sparkle.framework in CopyFiles */,
A251EAB80BE1A2370023D908 /* Controller.h in CopyFiles */,
A2A1CB790BF29D5500AE959F /* PeerProgressIndicatorCell.h in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -388,6 +391,8 @@
A29C8B320ACC6E93000ED9F9 /* YellowDot.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = YellowDot.tiff; path = macosx/Images/YellowDot.tiff; sourceTree = "<group>"; };
A29C8B340ACC6EB3000ED9F9 /* PortChecker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PortChecker.h; path = macosx/PortChecker.h; sourceTree = "<group>"; };
A29C8B350ACC6EB3000ED9F9 /* PortChecker.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PortChecker.m; path = macosx/PortChecker.m; sourceTree = "<group>"; };
A2A1CB770BF29D5500AE959F /* PeerProgressIndicatorCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PeerProgressIndicatorCell.h; path = macosx/PeerProgressIndicatorCell.h; sourceTree = "<group>"; };
A2A1CB780BF29D5500AE959F /* PeerProgressIndicatorCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PeerProgressIndicatorCell.m; path = macosx/PeerProgressIndicatorCell.m; sourceTree = "<group>"; };
A2A306530AAD24A80049E2AC /* UKFileWatcher.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = UKFileWatcher.h; path = macosx/UKKQueue/UKFileWatcher.h; sourceTree = "<group>"; };
A2A306540AAD24A80049E2AC /* UKFileWatcher.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = UKFileWatcher.m; path = macosx/UKKQueue/UKFileWatcher.m; sourceTree = "<group>"; };
A2A306550AAD24A80049E2AC /* UKFNSubscribeFileWatcher.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = UKFNSubscribeFileWatcher.h; path = macosx/UKKQueue/UKFNSubscribeFileWatcher.h; sourceTree = "<group>"; };
@ -503,6 +508,8 @@
A2AA579B0ADFCAB400CA59F6 /* PiecesImageView.m */,
A24999200B49F1B5001EADA3 /* ActionPopUpButton.h */,
A24999210B49F1B5001EADA3 /* ActionPopUpButton.m */,
A2A1CB770BF29D5500AE959F /* PeerProgressIndicatorCell.h */,
A2A1CB780BF29D5500AE959F /* PeerProgressIndicatorCell.m */,
);
name = Sources;
sourceTree = "<group>";
@ -985,6 +992,7 @@
A2BF07910B066E0800757C92 /* SpeedLimitToTurtleIconTransformer.m in Sources */,
A24999230B49F1B5001EADA3 /* ActionPopUpButton.m in Sources */,
A2265F420B5EF5F40093DDA5 /* FileBrowserCell.m in Sources */,
A2A1CB7A0BF29D5500AE959F /* PeerProgressIndicatorCell.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@ -61,7 +61,13 @@
};
SUPERCLASS = NSWindowController;
},
{CLASS = NSLevelIndicatorCell; LANGUAGE = ObjC; SUPERCLASS = NSActionCell; },
{CLASS = NSSegmentedControl; LANGUAGE = ObjC; SUPERCLASS = NSControl; },
{
CLASS = PeerProgressIndicatorCell;
LANGUAGE = ObjC;
SUPERCLASS = NSLevelIndicatorCell;
},
{
CLASS = PiecesImageView;
LANGUAGE = ObjC;

View File

@ -684,7 +684,7 @@
else if ([ident isEqualToString: @"Progress"])
{
NSNumber * progress;
return (progress = [peer objectForKey: @"Progress"]) ? progress : [NSNumber numberWithInt: 0];
return (progress = [peer objectForKey: @"Progress"]) ? progress : nil;
}
else if ([ident isEqualToString: @"UL To"])
{
@ -702,6 +702,16 @@
return nil;
}
- (void) tableView: (NSTableView *) tableView willDisplayCell: (id) cell
forTableColumn: (NSTableColumn *) tableColumn row: (int) row
{
if (tableView == fPeerTable)
{
if ([[tableColumn identifier] isEqualToString: @"Progress"])
[cell setHidden: ![[[fPeers objectAtIndex: row] objectForKey: @"Connected"] boolValue]];
}
}
- (void) tableView: (NSTableView *) tableView didClickTableColumn: (NSTableColumn *) tableColumn
{
if (tableView == fPeerTable)

View File

@ -0,0 +1,31 @@
/******************************************************************************
* $Id$
*
* Copyright (c) 2007 Transmission authors and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*****************************************************************************/
#import <Cocoa/Cocoa.h>
@interface PeerProgressIndicatorCell : NSLevelIndicatorCell
{
BOOL isHidden;
}
@end

View File

@ -0,0 +1,45 @@
/******************************************************************************
* $Id$
*
* Copyright (c) 2007 Transmission authors and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*****************************************************************************/
#import "PeerProgressIndicatorCell.h"
@implementation PeerProgressIndicatorCell
- (BOOL) hidden
{
return isHidden;
}
- (void) setHidden: (BOOL) hidden
{
isHidden = hidden;
}
- (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView
{
if (!isHidden)
[super drawWithFrame: cellFrame inView: controlView];
}
@end