From 4a6c14bc01ddbf41d06340639c9b582ebe16b9af Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Fri, 11 Jan 2008 05:04:40 +0000 Subject: [PATCH] update NEWS and add a little efficiency for the last commit --- NEWS | 1 + macosx/TorrentTableView.m | 43 +++++++++++++++++++++++---------------- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/NEWS b/NEWS index 83485e49a..594614c98 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ NEWS file for Transmission 1.10 (2008/xx/yy) - OS X: + Window when adding torrents to select files and other settings + + Leopard: Fix to allow double-clicking the icon to reveal in Finder, double-clicking the progress string to toggle between selected and total progress, and double-clicking anywhere else to toggle the inspector 1.01 (2008/xx/yy) - All Platforms: diff --git a/macosx/TorrentTableView.m b/macosx/TorrentTableView.m index 384e96928..26e532234 100644 --- a/macosx/TorrentTableView.m +++ b/macosx/TorrentTableView.m @@ -100,7 +100,6 @@ - (void) mouseDown: (NSEvent *) event { - NSLog(@"down"); fClickPoint = [self convertPoint: [event locationInWindow] fromView: nil]; if ([self pointInActionRect: fClickPoint]) @@ -148,34 +147,44 @@ - (void) mouseUp: (NSEvent *) event { - NSPoint point = [self convertPoint: [event locationInWindow] fromView: nil]; - int row = [self rowAtPoint: point], oldRow = [self rowAtPoint: fClickPoint]; - - if (row == oldRow && [self pointInPauseRect: point] && [self pointInPauseRect: fClickPoint]) + int oldRow; + if (fClickIn) { - Torrent * torrent = [fTorrents objectAtIndex: row]; + NSPoint point = [self convertPoint: [event locationInWindow] fromView: nil]; + int row = [self rowAtPoint: point]; + oldRow = [self rowAtPoint: fClickPoint]; - if ([torrent isActive]) - [fController stopTorrents: [NSArray arrayWithObject: torrent]]; - else + if (row == oldRow && [self pointInPauseRect: point] && [self pointInPauseRect: fClickPoint]) { - if ([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask) - [fController resumeTorrentsNoWait: [NSArray arrayWithObject: torrent]]; - else if ([torrent waitingToStart]) + Torrent * torrent = [fTorrents objectAtIndex: row]; + + if ([torrent isActive]) [fController stopTorrents: [NSArray arrayWithObject: torrent]]; else - [fController resumeTorrents: [NSArray arrayWithObject: torrent]]; + { + if ([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask) + [fController resumeTorrentsNoWait: [NSArray arrayWithObject: torrent]]; + else if ([torrent waitingToStart]) + [fController stopTorrents: [NSArray arrayWithObject: torrent]]; + else + [fController resumeTorrents: [NSArray arrayWithObject: torrent]]; + } } + else if (row == oldRow && [self pointInRevealRect: point] && [self pointInRevealRect: fClickPoint]) + [[fTorrents objectAtIndex: row] revealData]; + else; } - else if (row == oldRow && [self pointInRevealRect: point] && [self pointInRevealRect: fClickPoint]) - [[fTorrents objectAtIndex: row] revealData]; - else; [super mouseUp: event]; fClickPoint = NSZeroPoint; + + #warning need fClickIn? + BOOL wasClickIn = fClickIn; fClickIn = NO; - [self setNeedsDisplayInRect: [self rectOfRow: oldRow]]; + + if (wasClickIn) + [self setNeedsDisplayInRect: [self rectOfRow: oldRow]]; } - (void) mouseDragged: (NSEvent *) event