dbl-click item in d/l manager to open it

This commit is contained in:
pinkerton%aol.net 2005-04-24 18:28:24 +00:00
Родитель 932e8d19cc
Коммит fb5a647e17
2 изменённых файлов: 20 добавлений и 0 удалений

Просмотреть файл

@ -84,6 +84,8 @@ static id gSharedProgressController = nil;
mSelectionPivotIndex = -1;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(DLInstanceSelected:)
name:@"DownloadInstanceSelected" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(DLInstanceOpened:)
name:@"DownloadInstanceOpened" object:nil];
}
return self;
}
@ -193,6 +195,17 @@ static id gSharedProgressController = nil;
mSelectionPivotIndex = -1;
}
//
// -DLInstanceOpened:
//
// Called when one of the ProgressView's should be opened (dbl clicked, for example). Open all of the
// selected instances with the Finder.
//
-(void)DLInstanceOpened:(NSNotification*)notification
{
[self open:self];
}
// calculate what buttons should be enabled/disabled because the user changed the selection state
-(void)DLInstanceSelected:(NSNotification*)notification
{

Просмотреть файл

@ -81,6 +81,13 @@
}
[self setSelected:shouldSelect];
[[NSNotificationCenter defaultCenter] postNotificationName:@"DownloadInstanceSelected" object:self];
// after we've processed selection and modifiers, see if it's a double-click. If so,
// send a notification off to the controller which will handle it accordingly. Doing it after
// processing the modifiers allows someone to shift-dblClick and open all selected items
// in the list in one action.
if ([theEvent type] == NSLeftMouseDown && [theEvent clickCount] == 2)
[[NSNotificationCenter defaultCenter] postNotificationName:@"DownloadInstanceOpened" object:self];
}
-(BOOL)isSelected