From 1c39a8e290f83e136139039517a8e48bead77c35 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sat, 20 Jan 2007 03:32:35 +0000 Subject: [PATCH] don't allow selection/context menu for empty row when no torrent in selected --- macosx/FileOutlineView.m | 2 +- macosx/InfoWindowController.m | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/macosx/FileOutlineView.m b/macosx/FileOutlineView.m index ae08171b1..082167cdc 100644 --- a/macosx/FileOutlineView.m +++ b/macosx/FileOutlineView.m @@ -48,7 +48,7 @@ if (row >= 0) { - if (![self isRowSelected: row]) + if ([self itemAtRow: row] && ![self isRowSelected: row]) [self selectRowIndexes: [NSIndexSet indexSetWithIndex: row] byExtendingSelection: NO]; } else diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index 54df52531..59e75aaf0 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -791,6 +791,11 @@ return [outlineView rowHeight]; } +- (BOOL) outlineView: (NSOutlineView *) outlineView shouldSelectItem: (id) item +{ + return item != nil; +} + - (NSArray *) peerSortDescriptors { NSMutableArray * descriptors = [NSMutableArray array];