No need to make peer table make the window key, which also eliminates the need for a subclass.

This commit is contained in:
Mitchell Livingston
2006-08-14 03:13:34 +00:00
parent 402e827a87
commit 2eabbc90b5
8 changed files with 9 additions and 78 deletions
-6
View File
@@ -81,7 +81,6 @@
A21610FC0A050B1700E8E4C1 /* MenuButton.m in Sources */ = {isa = PBXBuildFile; fileRef = A21610FB0A050B1700E8E4C1 /* MenuButton.m */; };
A2173E1C0A33C1B300B0D8AB /* ActionButtonPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = A2173E1B0A33C1B300B0D8AB /* ActionButtonPressed.png */; };
A21DFF100A292B2B007C5F76 /* Transfers.png in Resources */ = {isa = PBXBuildFile; fileRef = A21DFF0F0A292B2B007C5F76 /* Transfers.png */; };
A221DA8A0A8F7E7E0011E98E /* InfoTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = A221DA880A8F7E7E0011E98E /* InfoTableView.m */; };
A2305A800A3DC9E400AB2D77 /* ProgressBarWhite.png in Resources */ = {isa = PBXBuildFile; fileRef = A2305A7C0A3DC9E400AB2D77 /* ProgressBarWhite.png */; };
A2305A810A3DC9E400AB2D77 /* ProgressBarBlue.png in Resources */ = {isa = PBXBuildFile; fileRef = A2305A7D0A3DC9E400AB2D77 /* ProgressBarBlue.png */; };
A2305A820A3DC9E400AB2D77 /* ProgressBarGray.png in Resources */ = {isa = PBXBuildFile; fileRef = A2305A7E0A3DC9E400AB2D77 /* ProgressBarGray.png */; };
@@ -285,8 +284,6 @@
A21610FB0A050B1700E8E4C1 /* MenuButton.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = MenuButton.m; path = macosx/MenuButton.m; sourceTree = "<group>"; };
A2173E1B0A33C1B300B0D8AB /* ActionButtonPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ActionButtonPressed.png; path = macosx/Images/ActionButtonPressed.png; sourceTree = "<group>"; };
A21DFF0F0A292B2B007C5F76 /* Transfers.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Transfers.png; path = macosx/Images/Transfers.png; sourceTree = "<group>"; };
A221DA870A8F7E7E0011E98E /* InfoTableView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = InfoTableView.h; path = macosx/InfoTableView.h; sourceTree = "<group>"; };
A221DA880A8F7E7E0011E98E /* InfoTableView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = InfoTableView.m; path = macosx/InfoTableView.m; sourceTree = "<group>"; };
A2305A7C0A3DC9E400AB2D77 /* ProgressBarWhite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarWhite.png; path = macosx/Images/ProgressBarWhite.png; sourceTree = "<group>"; };
A2305A7D0A3DC9E400AB2D77 /* ProgressBarBlue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarBlue.png; path = macosx/Images/ProgressBarBlue.png; sourceTree = "<group>"; };
A2305A7E0A3DC9E400AB2D77 /* ProgressBarGray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarGray.png; path = macosx/Images/ProgressBarGray.png; sourceTree = "<group>"; };
@@ -401,8 +398,6 @@
A27ABC220A6ADE410020EC71 /* ImageBackgroundView.m */,
A2710E740A86796000CE4F7D /* PrefsWindow.h */,
A2710E750A86796000CE4F7D /* PrefsWindow.m */,
A221DA870A8F7E7E0011E98E /* InfoTableView.h */,
A221DA880A8F7E7E0011E98E /* InfoTableView.m */,
);
name = Sources;
sourceTree = "<group>";
@@ -817,7 +812,6 @@
A27431DB0A68538400FA780A /* BarButton.m in Sources */,
A27ABC240A6ADE410020EC71 /* ImageBackgroundView.m in Sources */,
A2710E770A86796000CE4F7D /* PrefsWindow.m in Sources */,
A221DA8A0A8F7E7E0011E98E /* InfoTableView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
+1 -2
View File
@@ -4,10 +4,9 @@
CLASS = FileTableView;
LANGUAGE = ObjC;
OUTLETS = {fContextMenu = NSMenu; };
SUPERCLASS = InfoTableView;
SUPERCLASS = NSTableView;
},
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = InfoTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; },
{
ACTIONS = {
revealFile = id;
Binary file not shown.
+1 -2
View File
@@ -23,9 +23,8 @@
*****************************************************************************/
#import <Cocoa/Cocoa.h>
#import "InfoTableView.h"
@interface FileTableView : InfoTableView
@interface FileTableView : NSTableView
{
IBOutlet NSMenu * fContextMenu;
}
+6
View File
@@ -26,6 +26,12 @@
@implementation FileTableView
- (void) mouseDown: (NSEvent *) event
{
[[self window] makeKeyWindow];
[super mouseDown: event];
}
- (NSMenu *) menuForEvent: (NSEvent *) e
{
int row = [self rowAtPoint: [self convertPoint: [e locationInWindow] fromView: nil]];
-30
View File
@@ -1,30 +0,0 @@
/******************************************************************************
* $Id$
*
* Copyright (c) 2005-2006 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 InfoTableView : NSTableView
{
}
@end
-35
View File
@@ -1,35 +0,0 @@
/******************************************************************************
* $Id$
*
* Copyright (c) 2005-2006 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 "InfoTableView.h"
@implementation InfoTableView
- (void) mouseDown: (NSEvent *) event
{
[[self window] makeKeyWindow];
[super mouseDown: event];
}
@end
+1 -3
View File
@@ -518,11 +518,10 @@
- (NSArray *) peers
{
int totalPeers, i;
tr_peer_stat_t * peers = tr_torrentPeers(fHandle, & totalPeers);
tr_peer_stat_t peer;
NSMutableArray * peerDics = [NSMutableArray arrayWithCapacity: totalPeers];
tr_peer_stat_t peer;
NSString * client;
for (i = 0; i < totalPeers; i++)
{
@@ -538,7 +537,6 @@
[NSNumber numberWithBool: peer.isDownloading], @"UL To",
[NSNumber numberWithBool: peer.isUploading], @"DL From", nil]];
}
//NSLog(@"%d", tr_peerId(peer));
tr_torrentPeersFree(peers, totalPeers);