Changeset 696

Show
Ignore:
Timestamp:
12/03/08 15:14:08 (1 month ago)
Author:
gbooker
Message:

Putting back the stuff that was lost on server

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/CoreData/SapphireFrappliance/Browser/SapphireBrowser.m

    r652 r696  
    195195} 
    196196 
    197 - (void) willBePushed 
    198 
    199     // We're about to be placed on screen, but we're not yet there 
    200      
    201     // always call super 
    202     [super willBePushed]; 
     197- (void) wasPushed 
     198
     199    // We've just been put on screen, the user can see this controller's content now 
    203200        /*Reload upon display*/ 
    204201        @try { 
     
    208205        @catch (NSException * e) { 
    209206                [SapphireApplianceController logException:e]; 
    210         } 
    211 
    212  
    213 - (void) wasPushed 
    214 
    215     // We've just been put on screen, the user can see this controller's content now 
    216      
     207        }        
    217208    // always call super 
    218209    [super wasPushed]; 
     
    221212} 
    222213 
    223 - (void) willBePopped 
    224 
    225     // The user pressed Menu, but we've not been removed from the screen yet 
    226      
     214- (void) wasPopped 
     215
     216    // The user pressed Menu, removing us from the screen 
    227217    // always call super 
    228     [super willBePopped]; 
     218 
     219    [super wasPopped]; 
    229220        /*Cancel everything we were doing*/ 
    230221        [metaData cancelImport]; 
     
    233224} 
    234225 
    235 - (void) wasPopped 
    236 
    237     // The user pressed Menu, removing us from the screen 
    238     // always call super 
    239     [super wasPopped]; 
    240 
    241  
    242 - (void) willBeBuried 
    243 
    244     // The user just chose an option, and we will be taken off the screen 
    245      
     226- (void) wasBuriedByPushingController: (BRLayerController *) controller 
     227
     228    // The user chose an option and this controller is no longer on screen 
     229 
    246230        /*Cancel everything we were doing*/ 
    247231        [metaData cancelImport]; 
    248232        cancelScan = YES; 
    249233        [metaData setDelegate:nil]; 
    250         // always call super 
    251     [super willBeBuried]; 
    252 
    253  
    254 - (void) wasBuriedByPushingController: (BRLayerController *) controller 
    255 
    256     // The user chose an option and this controller is no longer on screen 
    257      
     234 
    258235    // always call super 
    259236    [super wasBuriedByPushingController: controller]; 
    260237} 
    261238 
    262 - (void) willBeExhumed 
    263 { 
    264     // the user pressed Menu, but we've not been revealed yet 
    265      
     239- (void) wasExhumedByPoppingController: (BRLayerController *) controller 
     240{ 
     241    // handle being revealed when the user presses Menu 
     242 
    266243        /*Reload our display*/ 
    267244        [metaData setDelegate:self]; 
    268245        [self setNewPredicate:[SapphireApplianceController predicate]]; 
    269     // always call super 
    270     [super willBeExhumed]; 
    271 
    272  
    273 - (void) wasExhumedByPoppingController: (BRLayerController *) controller 
    274 
    275     // handle being revealed when the user presses Menu 
    276      
     246 
    277247    // always call super 
    278248    [super wasExhumedByPoppingController: controller]; 
     
    613583                         
    614584                        /*and go*/ 
    615                         SapphireVideoPlayerController *controller = [[SapphireVideoPlayerController alloc] initWithScene:[self scene]]; 
     585                        SapphireVideoPlayerController *controller = [[SapphireVideoPlayerController alloc] initWithScene:[self scene] player:player]; 
    616586                        [controller setPlayFile:currentPlayFile]; 
    617587                        [controller setAllowsResume:YES]; 
    618                         [controller setVideoPlayer:player]; 
    619588                        [[self stack] pushController:controller]; 
    620589 
     
    704673- (BOOL)brEventAction:(BREvent *)event 
    705674{ 
    706         BREventPageUsageHash hashVal = [event pageUsageHash]
     675        BREventPageUsageHash hashVal = (uint32_t)([event page] << 16 | [event usage])
    707676        if ([(BRControllerStack *)[self stack] peekController] != self) 
    708677                hashVal = 0; 
  • branches/CoreData/SapphireFrappliance/Browser/SapphireMarkMenu.m

    r670 r696  
    284284} 
    285285 
    286 - (void) willBePushed 
    287 { 
    288     // We're about to be placed on screen, but we're not yet there 
    289      
    290     // always call super 
    291     [super willBePushed]; 
    292 } 
    293  
    294286- (void) wasPushed 
    295287{ 
     
    300292} 
    301293 
    302 - (void) willBePopped 
    303 { 
    304     // The user pressed Menu, but we've not been removed from the screen yet 
    305      
    306     // always call super 
    307     [super willBePopped]; 
    308 } 
    309  
    310294- (void) wasPopped 
    311295{ 
     
    316300} 
    317301 
    318 - (void) willBeBuried 
    319 { 
    320     // The user just chose an option, and we will be taken off the screen 
    321      
    322     // always call super 
    323     [super willBeBuried]; 
    324 } 
    325  
    326302- (void) wasBuriedByPushingController: (BRLayerController *) controller 
    327303{ 
     
    330306    // always call super 
    331307    [super wasBuriedByPushingController: controller]; 
    332 } 
    333  
    334 - (void) willBeExhumed 
    335 { 
    336     // the user pressed Menu, but we've not been revealed yet 
    337      
    338     // always call super 
    339     [super willBeExhumed]; 
    340308} 
    341309 
  • branches/CoreData/SapphireFrappliance/Browser/SapphireMediaPreview.h

    r592 r696  
    3838 */ 
    3939@interface SapphireMediaPreview : BRMetadataPreviewController{ 
    40         int             padding[16];  /*!< @brief The classes are of different sizes.  This padding prevents a class compiled with one size to overlap when used with a class of a different size*/    
     40        int             padding[32];  /*!< @brief The classes are of different sizes.  This padding prevents a class compiled with one size to overlap when used with a class of a different size*/    
    4141        id <SapphireMetaDataProtocol>   meta;                   /*!< @brief The metadata to display in the preview*/ 
    4242        id <SapphireDirectory>                  dirMeta;                /*!< @brief The directory containing the metadata*/ 
  • branches/CoreData/SapphireFrappliance/FRAppliance/SapphireAppliance.m

    r597 r696  
    6060                return; 
    6161        [[cls sharedInstance] enableFeatureNamed: [[NSBundle bundleForClass: self] bundleIdentifier]]; 
     62        [[SapphireFrontRowCompat sharedFrontRowPreferences] setBool:YES forKey:@"AllowAllVideoToPlay"];  //Workaround 2.2. 
    6263} 
    6364 
  • branches/CoreData/SapphireFrappliance/FRAppliance/SapphireApplianceController.h

    r608 r696  
    2020 
    2121#import <SapphireCompatClasses/SapphireMediaMenuController.h> 
     22 
     23#define RESCAN_DIRECTORY_NOTIFICATION @"Rescan Directory Notification" 
    2224 
    2325@class SapphireSettings, SapphireTheme, SapphireLeopardOnly, SapphireImporterDataMenu, SapphireBrowser; 
  • branches/CoreData/SapphireFrappliance/FRAppliance/SapphireApplianceController.m

    r668 r696  
    228228                        [ret appendFormat:@"\n0x%X\t%@", [key pointerValue], [mapping objectForKey:key]]; 
    229229        } 
    230         NSLog(@"%@", ret);     
     230        SapphireLog(SAPPHIRE_LOG_GENERAL, SAPPHIRE_LOG_LEVEL_ERROR, @"%@", ret);       
    231231} 
    232232 
     
    288288        mountsOnly = NO; 
    289289         
     290        SapphireSetLogLevel(SAPPHIRE_LOG_ALL, SAPPHIRE_LOG_LEVEL_ERROR); 
     291        SapphireSetLogLevel(SAPPHIRE_LOG_METADATA_STORE, SAPPHIRE_LOG_LEVEL_DEBUG); 
     292         
     293        [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(distributedRescanDir:) name:RESCAN_DIRECTORY_NOTIFICATION object:nil]; 
     294         
    290295        return self; 
    291296} 
     
    302307        [settings release]; 
    303308        [SapphireImportHelper relinquishHelper]; 
     309        [[NSDistributedNotificationCenter defaultCenter] removeObserver:self]; 
    304310        [super dealloc]; 
    305311} 
     
    467473} 
    468474 
    469 - (void) willBePushed 
    470 
    471     // We're about to be placed on screen, but we're not yet there 
     475- (void)distributedRescanDir:(NSNotification *)note 
     476
     477        id info = [note userInfo]; 
     478        if(![info isKindOfClass:[NSString class]]) 
     479                return; 
     480        NSString *dirPath = (NSString *)info; 
     481        if(![[NSFileManager defaultManager] isDirectory:dirPath]) 
     482                return; 
     483         
     484        SapphireDirectoryMetaData *dir = [SapphireDirectoryMetaData directoryWithPath:dirPath inContext:moc]; 
     485        [dir reloadDirectoryContents]; 
     486        [dir resumeImport]; 
     487
     488 
     489- (void) wasPushed 
     490
     491    // We've just been put on screen, the user can see this controller's content now 
    472492    [self recreateMenu]; 
    473493        [[self list] reload]; 
    474494    // always call super 
    475     [super willBePushed]; 
    476 } 
    477  
    478 - (void) wasPushed 
    479 { 
    480     // We've just been put on screen, the user can see this controller's content now 
    481      
    482     // always call super 
    483495    [super wasPushed]; 
    484 } 
    485  
    486 - (void) willBePopped 
    487 { 
    488     // The user pressed Menu, but we've not been removed from the screen yet 
    489      
    490     // always call super 
    491     [super willBePopped]; 
    492496} 
    493497 
     
    500504} 
    501505 
    502 - (void) willBeBuried 
    503 { 
    504     // The user just chose an option, and we will be taken off the screen 
    505      
    506     // always call super 
    507     [super willBeBuried]; 
    508 } 
    509  
    510506- (void) wasBuriedByPushingController: (BRLayerController *) controller 
    511507{ 
     
    516512} 
    517513 
    518 - (void) willBeExhumed 
    519 { 
    520     // the user pressed Menu, but we've not been revealed yet 
     514- (void) wasExhumedByPoppingController: (BRLayerController *) controller 
     515{ 
     516    // handle being revealed when the user presses Menu 
    521517     
    522     // always call super 
    523     [super willBeExhumed]; 
    524518        [self setMenuFromSettings]; 
    525519        [[self list] reload]; 
    526520        [SapphireFrontRowCompat renderScene:[self scene]]; 
    527 
    528  
    529 - (void) wasExhumedByPoppingController: (BRLayerController *) controller 
    530 
    531     // handle being revealed when the user presses Menu 
    532      
     521 
    533522    // always call super 
    534523    [super wasExhumedByPoppingController: controller]; 
  • branches/CoreData/SapphireFrappliance/FRAppliance/SapphireImportHelper.m

    r692 r696  
    152152        while((file = [server nextFile]) != nil) 
    153153        { 
     154                if(![moc hasChanges]) 
     155                        [moc reset]; 
    154156                NSAutoreleasePool *singleImportPool = [[NSAutoreleasePool alloc] init]; 
    155157                ImportType type = [file importType]; 
     
    162164                else 
    163165                        ret = ([allImporter importMetaData:file] == IMPORT_STATE_UPDATED); 
    164                 keepRunning &= [SapphireMetaDataSupport save:moc]
     166                keepRunning &= ([SapphireMetaDataSupport save:moc] || [SapphireMetaDataSupport wasLocked])
    165167                [server importComplete:ret]; 
    166168                [singleImportPool release]; 
     
    183185        [serverConnection setRootObject:self]; 
    184186        if([serverConnection registerName:CONNECTION_NAME] == NO) 
    185                 NSLog(@"Register failed"); 
     187                SapphireLog(SAPPHIRE_LOG_GENERAL, SAPPHIRE_LOG_LEVEL_ERROR, @"Register failed"); 
    186188         
    187189        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(connectionDidDie:) name:NSConnectionDidDieNotification object:nil]; 
     
    275277                } 
    276278                @catch (NSException * e) { 
    277                         NSLog(@"Could not launch helper because of exception %@ launching %@.  Make this file executable", e, path); 
     279                        SapphireLog(SAPPHIRE_LOG_GENERAL, SAPPHIRE_LOG_LEVEL_ERROR, @"Could not launch helper because of exception %@ launching %@.  Make this file executable", e, path); 
    278280                }                
    279281        } 
    280282        else 
    281                 NSLog(@"Could not correct helper permissions on %@.  Make this file executable!", path); 
     283                SapphireLog(SAPPHIRE_LOG_GENERAL, SAPPHIRE_LOG_LEVEL_ERROR, @"Could not correct helper permissions on %@.  Make this file executable!", path); 
    282284} 
    283285 
  • branches/CoreData/SapphireFrappliance/FRAppliance/SapphireMetaDataUpgrading.h

    r572 r696  
    2020 
    2121#import <SapphireCompatClasses/SapphireCenteredMenuController.h> 
     22#import <SapphireCompatClasses/SapphireLayoutManager.h> 
    2223 
    23 @interface SapphireMetaDataUpgrading : SapphireCenteredMenuController
     24@interface SapphireMetaDataUpgrading : SapphireCenteredMenuController <SapphireLayoutDelegate>
    2425        BRWaitSpinnerControl    *spinner;                       /*!< @brief The spinner*/ 
    2526        BRTextControl                   *status;                        /*!< @brief Status message*/ 
  • branches/CoreData/SapphireFrappliance/FRAppliance/SapphireMetaDataUpgrading.m

    r578 r696  
    2222#import <SapphireCompatClasses/SapphireFrontRowCompat.h> 
    2323#import "SapphireMetaDataSupport.h" 
    24  
    25 @interface SapphireMetaDataUpgrading (private) 
    26 - (void)layoutFrame; 
    27 @end 
    2824 
    2925@implementation SapphireMetaDataUpgrading 
     
    6359        } 
    6460         
    65         [self layoutFrame]; 
     61        [self doMyLayout]; 
    6662         
    6763        [self addControl:status]; 
     
    7066        else 
    7167                [self addControl:spinner]; 
     68         
     69        [SapphireLayoutManager setCustomLayoutOnControl:self]; 
    7270 
    7371        return self; 
     
    7573} 
    7674 
    77 - (void)layoutFrame 
     75- (void)doMyLayout 
    7876{ 
    7977        NSRect frame = [SapphireFrontRowCompat frameOfController:self]; 
  • branches/CoreData/SapphireFrappliance/FRAppliance/main_helper.m

    r558 r696  
    5050        NSManagedObjectContext *moc = [[NSManagedObjectContext alloc] init]; 
    5151        [moc setUndoManager:nil]; 
     52        [moc setMergePolicy:NSMergeByPropertyStoreTrumpMergePolicy]; 
    5253        NSString *mopath = [bundle pathForResource:@"Sapphire" ofType:@"mom"]; 
    5354        NSURL *mourl = [NSURL fileURLWithPath:mopath]; 
  • branches/CoreData/SapphireFrappliance/MetaData/SapphireMObjects/SapphireDirectoryMetaData.m

    r683 r696  
    204204                return ret; 
    205205        } 
    206         NSLog(@"Somehow couldn't get cache for %@ in %@", directory, self.path); 
     206        SapphireLog(SAPPHIRE_LOG_GENERAL, SAPPHIRE_LOG_LEVEL_ERROR, @"Somehow couldn't get cache for %@ in %@", directory, self.path); 
    207207        NSString *path = [self.path stringByAppendingPathComponent:directory]; 
    208208        NSPredicate *pred = [NSPredicate predicateWithFormat:@"path == %@", path]; 
  • branches/CoreData/SapphireFrappliance/MetaData/SapphireMObjects/SapphireFileMetaData.m

    r670 r696  
    99#import "SapphireMediaPreview.h" 
    1010#import "SapphireFileSymLink.h" 
     11#import "SapphireSettings.h" 
    1112 
    1213#import "SapphireTVShow.h" 
     
    475476                { 
    476477                        if([lowerFileName hasPrefix:tran.name]) 
     478                        { 
     479                                SapphireLog(SAPPHIRE_LOG_METADATA_STORE, SAPPHIRE_LOG_LEVEL_DETAIL, @"Deleting TV import translation for %@", tran.name); 
    477480                                [moc deleteObject:tran]; 
     481                        } 
    478482                } 
    479483        } 
    480         SapphireMovieTranslation *movieTran = [SapphireMovieTranslation movieTranslationWithName:lowerFileName inContext:moc]; 
     484        NSString *lookupName; 
     485        if([[SapphireSettings sharedSettings] dirLookup]) 
     486                lookupName = [[[self.path stringByDeletingLastPathComponent] lastPathComponent] lowercaseString]; 
     487        else 
     488                lookupName = lowerFileName; 
     489        SapphireMovieTranslation *movieTran = [SapphireMovieTranslation movieTranslationWithName:[lookupName stringByDeletingPathExtension] inContext:moc]; 
    481490        if(movieTran != nil) 
     491        { 
     492                SapphireLog(SAPPHIRE_LOG_METADATA_STORE, SAPPHIRE_LOG_LEVEL_DETAIL, @"Deleting Movie import translation for %@", movieTran.name); 
    482493                [moc deleteObject:movieTran]; 
     494        } 
    483495         
    484496        [self setToReimportFromMask:IMPORT_TYPE_ALL_MASK]; 
  • branches/CoreData/SapphireFrappliance/MetaData/Support/SapphireMetaDataSupport.h

    r689 r696  
    3131        NSTimer                 *writeTimer;            /*!< @brief The timer to agregate writes*/ 
    3232        NSTimeInterval  interval;                       /*!< @brief The write interval*/ 
     33        BOOL                    locked;                         /*!< @brief Was the DB locked during the last save*/ 
    3334} 
    3435 
     
    4041 */ 
    4142+ (BOOL)save:(NSManagedObjectContext *)context; 
     43 
     44/*! 
     45 * @brief Was the DB locked in last save? 
     46 * 
     47 * @return YES if it was locked, NO otherwise 
     48 */ 
     49+ (BOOL)wasLocked; 
    4250 
    4351/*! 
  • branches/CoreData/SapphireFrappliance/MetaData/Support/SapphireMetaDataSupport.m

    r689 r696  
    108108                context = [timer userInfo]; 
    109109 
     110        if(writeTimer != nil) 
     111                SapphireLog(SAPPHIRE_LOG_METADATA_STORE, SAPPHIRE_LOG_LEVEL_DETAIL, @"Rescheduled write"); 
    110112        [writeTimer invalidate]; 
    111113        writeTimer = nil; 
    112114        NSError *error = nil; 
     115        locked = NO; 
    113116        BOOL success = NO; 
    114117        @try { 
     
    116119        } 
    117120        @catch (NSException * e) { 
    118                 NSLog(@"Could not save due to exception \"%@\" with reason\"%@\"", [e name], [e reason]); 
     121                SapphireLog(SAPPHIRE_LOG_METADATA_STORE, SAPPHIRE_LOG_LEVEL_DETAIL, @"Could not save due to exception \"%@\" with reason \"%@\"", [e name], [e reason]); 
    119122        } 
    120123        if(error != nil) 
    121                 NSLog(@"Save error \"%@\"", error); 
     124        { 
     125                SapphireLog(SAPPHIRE_LOG_METADATA_STORE, SAPPHIRE_LOG_LEVEL_DETAIL, @"Save error \"%@\"", error); 
     126                NSException *underlying = [[error userInfo] objectForKey:@"NSUnderlyingException"]; 
     127                SapphireLog(SAPPHIRE_LOG_METADATA_STORE, SAPPHIRE_LOG_LEVEL_DEBUG, @"Underlying is %@ %@ %@ %@", underlying, [underlying name], [underlying reason], [underlying userInfo]); 
     128                if([[underlying reason] isEqualToString:@"database is locked"]) 
     129                { 
     130                        SapphireLog(SAPPHIRE_LOG_METADATA_STORE, SAPPHIRE_LOG_LEVEL_DEBUG, @"Detected locked"); 
     131                        locked = YES; 
     132                } 
     133        } 
    122134        if(success == NO) 
    123135        { 
     136                SapphireLog(SAPPHIRE_LOG_METADATA_STORE, SAPPHIRE_LOG_LEVEL_DEBUG, @"Inserted objects is %@", [context insertedObjects]); 
     137                SapphireLog(SAPPHIRE_LOG_METADATA_STORE, SAPPHIRE_LOG_LEVEL_DEBUG, @"Updated objects is %@", [context updatedObjects]); 
     138                SapphireLog(SAPPHIRE_LOG_METADATA_STORE, SAPPHIRE_LOG_LEVEL_DEBUG, @"Deleted objects is %@", [context deletedObjects]); 
    124139                interval *= 2; 
    125140                [writeTimer invalidate]; 
     141                SapphireLog(SAPPHIRE_LOG_METADATA_STORE, SAPPHIRE_LOG_LEVEL_DETAIL, @"Rescheduling write to occurr in %f seconds", interval); 
    126142                writeTimer = [NSTimer scheduledTimerWithTimeInterval:interval target:self selector:@selector(realWriteMetaData:) userInfo:context repeats:NO]; 
    127143        } 
     
    133149        { 
    134150                interval = 1; 
    135                 [self realWriteMetaData:(NSTimer *)context]; 
     151                [self performSelectorOnMainThread:@selector(realWriteMetaData:) withObject:context waitUntilDone:YES]; 
    136152                return (writeTimer == nil); 
    137153        } 
     
    146162         
    147163        return [[SapphireMetaDataSupport sharedInstance] save:context]; 
     164} 
     165 
     166- (BOOL)wasLocked 
     167{ 
     168        return locked; 
     169} 
     170 
     171+ (BOOL)wasLocked 
     172{ 
     173        return [[SapphireMetaDataSupport sharedInstance] wasLocked]; 
    148174} 
    149175 
     
    268294        { 
    269295                if(![obj validateForUpdate:&error]) 
    270                         NSLog(@"%@", error); 
     296                        SapphireLog(SAPPHIRE_LOG_METADATA_STORE, SAPPHIRE_LOG_LEVEL_INFO, @"%@", error); 
    271297        } 
    272298        [display setCurrentFile:BRLocalizedString(@"Upgrading Complete; Press Menu to Go Back", @"")]; 
  • branches/CoreData/SapphireFrappliance/MetaDataImporting/SapphireImporterDataMenu.h

    r683 r696  
    2121#import "SapphireDirectory.h" 
    2222#import <SapphireCompatClasses/SapphireCenteredMenuController.h> 
     23#import <SapphireCompatClasses/SapphireLayoutManager.h> 
    2324 
    2425@class SapphireImporterDataMenu, SapphireFileMetaData; 
     
    108109 * This class creates the importer UI.  It handles all the user interaction and passes commands on to its subordinates. 
    109110 */ 
    110 @interface SapphireImporterDataMenu : SapphireCenteredMenuController <SapphireMetaDataScannerDelegate, SapphireImporterBackgroundProtocol
     111@interface SapphireImporterDataMenu : SapphireCenteredMenuController <SapphireMetaDataScannerDelegate, SapphireImporterBackgroundProtocol, SapphireLayoutDelegate
    111112{ 
    112113        BRTextControl                                   *text;                                  /*!< @brief The informative text*/ 
     
    132133        SEL                                                             action;                                 /*!< @brief The action selector when the button is hit*/ 
    133134        NSString                                                *buttonTitle;                   /*!< @brief The fake button title*/ 
     135        BOOL                                                    layoutDone;                             /*!< @brief YES if layout already done, NO otherwise*/ 
    134136} 
    135137/*! 
  • branches/CoreData/SapphireFrappliance/MetaDataImporting/SapphireImporterDataMenu.m

    r687 r696  
    7272        [self addControl: currentFile] ; 
    7373        [SapphireFrontRowCompat addSublayer:bar toControl:self]; 
    74  
     74         
     75        [SapphireLayoutManager setCustomLayoutOnControl:self]; 
     76         
    7577    return ( self ); 
    7678} 
     
    237239                return; 
    238240        } 
     241        [SapphireMetaDataSupport save:moc]; 
    239242        [allItems release]; 
    240243        allItems = [importItems copy]; 
     
    284287                        case IMPORT_STATE_UPDATED: 
    285288                                ret = YES; 
     289                                SapphireLog(SAPPHIRE_LOG_IMPORT, SAPPHIRE_LOG_LEVEL_DETAIL, @"Updated %@", [file path]); 
    286290                                break; 
    287291                        case IMPORT_STATE_NEEDS_SUSPEND: 
     
    294298                                break; 
    295299                } 
    296                 [SapphireMetaDataSupport save:moc]; 
     300                if(ret) 
     301                        [SapphireMetaDataSupport save:moc]; 
    297302        } 
    298303        @catch (NSException * e) { 
     
    461466} 
    462467 
     468- (void)doMyLayout 
     469{ 
     470        if(!layoutDone) 
     471        { 
     472                [self layoutFrame]; 
     473                [self resetUIElements]; 
     474                layoutDone = YES; 
     475        } 
     476} 
     477 
    463478- (void)wasPushed 
    464479{ 
     
    482497 
    483498- (BOOL)brEventAction:(BREvent *)event{ 
    484         BREventPageUsageHash hashVal = [event pageUsageHash]
     499        BREventPageUsageHash hashVal = (uint32_t)([event page] << 16 | [event usage])
    485500         
    486501        if([(BRControllerStack *)[self stack] peekController] != self || action == NULL) 
  • branches/CoreData/SapphireFrappliance/MetaDataImporting/SapphireMovieChooser.h

    r541 r696  
    2020 
    2121#import <SapphireCompatClasses/SapphireCenteredMenuController.h> 
     22#import <SapphireCompatClasses/SapphireLayoutManager.h> 
    2223 
    2324#define MOVIE_CHOOSE_CANCEL             -2 
     
    2930 * This class presents the user with a list of possible movies to match a file and asks the user to choose its name. 
    3031 */ 
    31 @interface SapphireMovieChooser : SapphireCenteredMenuController
     32@interface SapphireMovieChooser : SapphireCenteredMenuController <SapphireLayoutDelegate>
    3233        NSArray                 *movies;                /*!< @brief The list of possible movies*/ 
    3334        NSString                *fileName;              /*!< @brief The filename of the current file*/ 
  • branches/CoreData/SapphireFrappliance/MetaDataImporting/SapphireMovieChooser.m

    r541 r696  
    4343        [self addControl: fileNameText];         
    4444        [[self list] setDatasource:self]; 
     45         
     46        [SapphireLayoutManager setCustomLayoutOnControl:self]; 
    4547         
    4648        return self; 
     
    8991} 
    9092 
    91 - (void)willBePushed 
    92 { 
    93         [super willBePushed]; 
    94         [(BRListControl *)[self list] setSelection:1]; 
    95 } 
    96  
    9793- (void)wasPushed 
    9894{ 
     95        [(BRListControl *)[self list] setSelection:1]; 
    9996        [self doMyLayout]; 
    10097        [super wasPushed]; 
  • branches/CoreData/SapphireFrappliance/MetaDataImporting/SapphireMovieImporter.h

    r557 r696  
    3232        NSManagedObjectContext          *moc;                                   /*!< @brief The context of translations*/ 
    3333        SapphirePosterChooser           *posterChooser;                 /*!< @brief The poster chooser (if exists) (not retained)*/ 
     34        BRLayerController                       *childController;               /*!< @brief The controller we push on top of us*/ 
    3435} 
    3536 
  • branches/CoreData/SapphireFrappliance/MetaDataImporting/SapphireMovieImporter.m

    r669 r696  
    166166{ 
    167167        [moc release]; 
     168        [childController release]; 
    168169        [super dealloc]; 
    169170} 
     
    710711                [chooser setListTitle:BRLocalizedString(@"Select Movie Title", @"Prompt the user for title of movie")]; 
    711712                /*And display prompt*/ 
     713                childController = [chooser retain]; 
    712714                [[dataMenu stack] pushController:chooser]; 
    713715                [chooser release]; 
     
    763765                                [posterChooser setFile:(SapphireFileMetaData *)metaData]; 
    764766                                [posterChooser setListTitle:BRLocalizedString(@"Select Movie Poster", @"Prompt the user for poster selection")]; 
     767                                childController = [posterChooser retain]; 
    765768                                [[dataMenu stack] pushController:posterChooser]; 
    766769                                [posterChooser release]; 
     
    875878{ 
    876879        /*See if it was a movie chooser*/ 
    877         if([controller isKindOfClass:[SapphireMovieChooser class]]) 
     880        if([childController isKindOfClass:[SapphireMovieChooser class]]) 
    878881        { 
    879882                /*Get the user's selection*/ 
    880                 SapphireMovieChooser *chooser = (SapphireMovieChooser *)controller; 
     883                SapphireMovieChooser *chooser = (SapphireMovieChooser *)childController; 
    881884                int selection = [chooser selection]; 
    882885                if(selection == MOVIE_CHOOSE_CANCEL) 
     
    905908                [dataMenu resume]; 
    906909        } 
    907         else if([controller isKindOfClass:[SapphirePosterChooser class]]) 
     910        else if([childController isKindOfClass:[SapphirePosterChooser class]]) 
    908911        { 
    909912                int selectedPoster = [posterChooser selectedPoster]; 
     
    924927        else 
    925928                return; 
     929         
     930        [childController release]; 
     931        childController = nil; 
    926932} 
    927933 
  • branches/CoreData/SapphireFrappliance/MetaDataImporting/SapphirePosterChooser.h

    r541 r696  
    2020 
    2121#import <SapphireCompatClasses/SapphireMediaMenuController.h> 
     22#import <SapphireCompatClasses/SapphireLayoutManager.h> 
    2223 
    2324#define POSTER_CHOOSE_CANCEL            -1 
     
    3132 * This class provides a menu and maching icons to display posters for the user to choose. 
    3233 */ 
    33 @interface SapphirePosterChooser : SapphireMediaMenuController <BRIconSourceProtocol, BRMenuListItemProvider> { 
     34@interface SapphirePosterChooser : SapphireMediaMenuController <BRIconSourceProtocol, BRMenuListItemProvider, SapphireLayoutDelegate> { 
    3435        NSArray                                 *posters;               /*!< @brief The array of poster paths*/ 
    3536        NSMutableArray                  *posterLayers;  /*!< @brief The image layers of posters*/ 
  • branches/CoreData/SapphireFrappliance/MetaDataImporting/SapphirePosterChooser.m

    r554 r696  
    7272        /* Setup posterMarch controls */ 
    7373        posterMarch = [SapphireFrontRowCompat newMarchingIconLayerWithScene:scene]; 
     74        [SapphireLayoutManager setCustomLayoutOnControl:self]; 
    7475         
    7576        return self; 
     
    101102{ 
    102103    // We're about to be placed on screen, but we're not yet there 
    103     // add the icon march layer to the scene 
    104     [self showIconMarch]; 
    105104     
    106105    // always call super 
  • branches/CoreData/SapphireFrappliance/MetaDataImporting/SapphireShowChooser.h

    r541 r696  
    2020 
    2121#import <SapphireCompatClasses/SapphireCenteredMenuController.h> 
     22#import <SapphireCompatClasses/SapphireLayoutManager.h> 
    2223