Changeset 18540 in webkit


Ignore:
Timestamp:
Jan 2, 2007 5:05:09 PM (17 years ago)
Author:
sullivan
Message:

Reviewed by Kevin Decker

  • fixed <rdar://problem/4892525> Cannot open PDF in Preview if you attempted to open it in Preview while PDF was loading
  • WebView/WebPDFView.mm: (-[WebPDFView menuForEvent:]): added comment (-[WebPDFView validateUserInterfaceItem:]): disable this menu item when there's no document yet (-[WebPDFView _openWithFinder:]): If this is invoked when there is no document yet (e.g. via the PDFKit delegate method), just beep and return. I should make a nice error message here, but I'll do that separately.
Location:
trunk/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/ChangeLog

    r18536 r18540  
     12007-01-02  John Sullivan  <sullivan@apple.com>
     2
     3        Reviewed by Kevin Decker
     4
     5        - fixed <rdar://problem/4892525> Cannot open PDF in Preview if you attempted to
     6          open it in Preview while PDF was loading
     7
     8        * WebView/WebPDFView.mm:
     9        (-[WebPDFView menuForEvent:]):
     10        added comment
     11        (-[WebPDFView validateUserInterfaceItem:]):
     12        disable this menu item when there's no document yet
     13        (-[WebPDFView _openWithFinder:]):
     14        If this is invoked when there is no document yet (e.g. via the PDFKit delegate method),
     15        just beep and return. I should make a nice error message here, but I'll do that separately.
     16
    1172007-01-03  Nikolas Zimmermann  <zimmermann@kde.org>
    218
  • trunk/WebKit/WebView/WebPDFView.mm

    r17597 r18540  
    336336        appName = UI_STRING("Finder", "Default application name for Open With context menu");
    337337   
     338    // To match the PDFKit style, we'll add Open with Preview even when there's no document yet to view, and
     339    // disable it using validateUserInterfaceItem.
    338340    NSString *title = [NSString stringWithFormat:UI_STRING("Open with %@", "context menu item for PDF"), appName];
    339341    NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:title action:@selector(_openWithFinder:) keyEquivalent:@""];
     
    445447    if (action == @selector(takeFindStringFromSelection:) || action == @selector(centerSelectionInVisibleArea:) || action == @selector(jumpToSelection:))
    446448        return [PDFSubview currentSelection] != nil;
     449   
     450    if (action == @selector(_openWithFinder:))
     451        return [PDFSubview document] != nil;
    447452
    448453    return YES;
     
    10011006- (void)_openWithFinder:(id)sender
    10021007{
     1008    // We don't want to write the file until we have a document to write (see 4892525).
     1009    if (![PDFSubview document]) {
     1010        NSBeep();
     1011        return;
     1012    }
     1013   
    10031014    NSString *opath = [self _path];
    10041015   
Note: See TracChangeset for help on using the changeset viewer.