Changeset 1169

Show
Ignore:
Timestamp:
02/24/2010 05:43:12 PM (2 years ago)
Author:
gbooker
Message:

Added ability to show initial errors and warnings.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/PlayerFramework/SapphireFrappliance/FRAppliance/SapphireAppliance.m

    r1164 r1169  
    3030#import <SapphireCompatClasses/BackRowUtils.h> 
    3131#ifdef DEBUG 
    32 #define FrameworkLoadDebug 
     32//#define FrameworkLoadDebug 
    3333#define FrameworkAlwaysCopy 
    3434#endif 
     
    6666@end 
    6767 
     68static NSString *initialError = nil; 
    6869 
    6970@implementation SapphireAppliance 
     71 
     72BOOL usingCategories = NO; 
    7073 
    7174+ (void) initialize 
     
    7477        NSString *frameworkPath = [myBundlePath stringByAppendingPathComponent:@"Contents/Frameworks"]; 
    7578        SapphireLoadFramework(frameworkPath); 
    76         loadCMPFramework(myBundlePath); 
     79        if(!loadCMPFramework(myBundlePath)) 
     80                initialError = BRLocalizedString(@"Error loading common player framework.  Continuing is not recomended", @"Error string for loading common player framework"); 
     81        else if([CMPPlayerManager version] != CMPVersion) 
     82                initialError = BRLocalizedString(@"Common player framework is newer than expected.  You may wish to check if a newer version of Sapphire is available.  You may attempt to continue if you like.", @"Warning string for common player framework being newer than Sapphire"); 
    7783        Class cls = NSClassFromString( @"BRFeatureManager" ); 
    7884        if ( cls == Nil ) 
     
    162168- (id) applianceControllerWithScene: (id) scene 
    163169{ 
     170        if(initialError && !usingCategories) 
     171        { 
     172                BRAlertController *controller = [SapphireFrontRowCompat alertOfType:0 titled:@"Error" primaryText:@"Framework Error" secondaryText:initialError withScene:nil]; 
     173                initialError = nil; 
     174                return controller; 
     175        } 
    164176        // this function is called when your item is selected on the main menu 
    165177        @try { 
     
    186198        NSMutableArray *categories = [NSMutableArray array]; 
    187199         
     200        usingCategories = YES; 
    188201        if([SapphireApplianceController upgradeNeeded]) 
    189202        { 
     
    235248-(id)controllerForIdentifier:(id)ident 
    236249{ 
     250        if(initialError) 
     251        { 
     252                BRAlertController *controller = [SapphireFrontRowCompat alertOfType:0 titled:@"Error" primaryText:@"Framework Error" secondaryText:initialError withScene:nil]; 
     253                initialError = nil; 
     254                return controller; 
     255        } 
    237256        NSString *identifier = (NSString *)ident; 
    238257        if([identifier isEqualToString:UPGRADE_IDENTIFIER])