зеркало из https://github.com/mozilla/pjs.git
Fixing bug 298446, cmd-period does not cancel downloads, camino only. r=mento, sr=pinkerton
This commit is contained in:
Родитель
c338703b3d
Коммит
6e10c7ba25
|
@ -126,7 +126,9 @@ static id gSharedProgressController = nil;
|
|||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(DLInstanceOpened:)
|
||||
name:kDownloadInstanceOpenedNotificationName
|
||||
object:nil];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(cancel:)
|
||||
name:kDownloadInstanceCancelledNotificationName
|
||||
object:nil];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
|
||||
extern NSString* const kDownloadInstanceSelectedNotificationName;
|
||||
extern NSString* const kDownloadInstanceOpenedNotificationName;
|
||||
extern NSString* const kDownloadInstanceCancelledNotificationName;
|
||||
|
||||
//
|
||||
// interface ProgressView
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
|
||||
NSString* const kDownloadInstanceSelectedNotificationName = @"DownloadInstanceSelected";
|
||||
NSString* const kDownloadInstanceOpenedNotificationName = @"DownloadInstanceOpened";
|
||||
NSString* const kDownloadInstanceCancelledNotificationName = @"DownloadInstanceCancelled";
|
||||
|
||||
@interface ProgressView(Private)
|
||||
|
||||
|
@ -147,6 +148,20 @@ NSString* const kDownloadInstanceOpenedNotificationName = @"DownloadInstanceOp
|
|||
return [[self getController] contextualMenu];
|
||||
}
|
||||
|
||||
-(BOOL)performKeyEquivalent:(NSEvent*)theEvent
|
||||
{
|
||||
// Catch a command-period key down event and send the cancel request
|
||||
if (([theEvent type] == NSKeyDown &&
|
||||
([theEvent modifierFlags] & NSCommandKeyMask) != 0) &&
|
||||
[[theEvent characters] isEqualToString:@"."])
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kDownloadInstanceCancelledNotificationName object:self];
|
||||
return YES;
|
||||
}
|
||||
|
||||
return [super performKeyEquivalent:theEvent];
|
||||
}
|
||||
|
||||
-(NSView*)hitTest:(NSPoint)aPoint
|
||||
{
|
||||
if (NSMouseInRect(aPoint, [self frame], YES)) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче