Changeset 710

Show
Ignore:
Timestamp:
12/08/08 21:07:09 (1 month ago)
Author:
gbooker
Message:

Seems that 2.3 likes to send multiple button pressed events. Keep the time of the last, so we don't cycle through filters too quickly.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/SapphireFrappliance/SapphireBrowser.m

    r705 r710  
    622622} 
    623623 
     624static NSDate *lastFilterChangeDate = nil; 
     625 
    624626- (BOOL)brEventAction:(BREvent *)event 
    625627{ 
     
    657659                case kBREventTapLeft: 
    658660                { 
    659                         NSString *oldName=nil; 
    660                         if(row < [_names count]) 
    661                                 oldName = [self titleForRow:row]; 
    662                         [self setNewPredicate:[SapphireApplianceController nextPredicate]]; 
    663                         /*Attempt to preserve the user's current highlighted selection*/ 
    664                         if(oldName) 
    665                         { 
    666                                 row=[self rowForTitle:oldName]; 
    667                                 if(row>=0) 
     661                        if(![SapphireFrontRowCompat usingTakeTwoDotThree] || lastFilterChangeDate == nil || [lastFilterChangeDate timeIntervalSinceNow] < -0.4f) 
     662                        { 
     663                                [lastFilterChangeDate release]; 
     664                                lastFilterChangeDate = [[NSDate date] retain]; 
     665                                NSString *oldName=nil; 
     666                                if(row < [_names count]) 
     667                                        oldName = [self titleForRow:row]; 
     668                                [self setNewPredicate:[SapphireApplianceController nextPredicate]]; 
     669                                /*Attempt to preserve the user's current highlighted selection*/ 
     670                                if(oldName) 
    668671                                { 
    669                                         [(BRListControl *)[self list] setSelection:row]; 
     672                                        row=[self rowForTitle:oldName]; 
     673                                        if(row>=0) 
     674                                        { 
     675                                                [(BRListControl *)[self list] setSelection:row]; 
     676                                        } 
     677                                        else 
     678                                        { 
     679                                                [(BRListControl *)[self list] setSelection:0]; 
     680                                                [self updatePreviewController]; 
     681                                        } 
    670682                                } 
    671                                 else 
    672                                 { 
    673                                         [(BRListControl *)[self list] setSelection:0]; 
    674                                         [self updatePreviewController]; 
    675                                 } 
    676                         } 
    677                         /*Force a reload on the mediaPreviewController*/ 
    678                         /* Not working in FrontRow */ 
    679                         [self wasPushed]; 
    680                         return YES; 
     683                                /*Force a reload on the mediaPreviewController*/ 
     684                                /* Not working in FrontRow */ 
     685                                [self wasPushed]; 
     686                                return YES;                              
     687                        } 
    681688                } 
    682689        }