Changeset 9299


Ignore:
Timestamp:
Oct 11, 2009, 11:27:53 PM (13 years ago)
Author:
livings124
Message:

better consideration of which item to Quick Look based on which windows are open

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r9298 r9299  
    31243124}
    31253125
     3126#warning refresh QL is either window is closed
    31263127- (void) beginPreviewPanelControl: (id) panel
    31273128{
     
    31373138}
    31383139
     3140- (NSArray *) quickLookableTorrents
     3141{
     3142    NSArray * selectedTorrents = [fTableView selectedTorrents];
     3143    NSMutableArray * qlArray = [NSMutableArray arrayWithCapacity: [selectedTorrents count]];
     3144   
     3145    for (Torrent * torrent in selectedTorrents)
     3146        if (([torrent isFolder] || [torrent isComplete]) && [[NSFileManager defaultManager] fileExistsAtPath: [torrent dataLocation]])
     3147            [qlArray addObject: torrent];
     3148   
     3149    return qlArray;
     3150}
     3151
    31393152- (NSInteger) numberOfPreviewItemsInPreviewPanel: (id) panel
    31403153{
    31413154    if ([fInfoController canQuickLook])
    31423155        return [[fInfoController quickLookURLs] count];
     3156    else if ([fWindow isVisible])
     3157        return [[self quickLookableTorrents] count];
    31433158    else
    3144         return [[self quickLookableTorrents] count];
     3159        return 0;
    31453160}
    31463161
     
    31803195        return frame;
    31813196    }
    3182 }
    3183 
    3184 - (NSArray *) quickLookableTorrents
    3185 {
    3186     NSArray * selectedTorrents = [fTableView selectedTorrents];
    3187     NSMutableArray * qlArray = [NSMutableArray arrayWithCapacity: [selectedTorrents count]];
    3188    
    3189     for (Torrent * torrent in selectedTorrents)
    3190         if (([torrent isFolder] || [torrent isComplete]) && [[NSFileManager defaultManager] fileExistsAtPath: [torrent dataLocation]])
    3191             [qlArray addObject: torrent];
    3192    
    3193     return qlArray;
    31943197}
    31953198
  • trunk/macosx/InfoWindowController.m

    r9298 r9299  
    11401140- (BOOL) canQuickLook
    11411141{
    1142     if (fCurrentTabTag != TAB_FILES_TAG || ![NSApp isOnSnowLeopardOrBetter])
     1142    if (fCurrentTabTag != TAB_FILES_TAG || ![[self window] isVisible] || ![NSApp isOnSnowLeopardOrBetter])
    11431143        return NO;
    11441144   
Note: See TracChangeset for help on using the changeset viewer.