| 1 | // |
|---|
| 2 | // SapphireSettings.m |
|---|
| 3 | // Sapphire |
|---|
| 4 | // |
|---|
| 5 | // Created by pnmerrill on 6/23/07. |
|---|
| 6 | // Copyright 2007 www.nanopi.net. All rights reserved. |
|---|
| 7 | // |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | #import <BackRow/BackRow.h> |
|---|
| 11 | #import "SapphireApplianceController.h" |
|---|
| 12 | #import "SapphireSettings.h" |
|---|
| 13 | #import "SapphireTheme.h" |
|---|
| 14 | #import "SapphireFileDataImporter.h" |
|---|
| 15 | #import "SapphireTVShowImporter.h" |
|---|
| 16 | #import "SapphireMovieImporter.h" |
|---|
| 17 | #import "SapphirePosterChooser.h" |
|---|
| 18 | #import "SapphireCollectionSettings.h" |
|---|
| 19 | #import "SapphireFrontRowCompat.h" |
|---|
| 20 | |
|---|
| 21 | static SapphireSettings *sharedInstance = nil; |
|---|
| 22 | |
|---|
| 23 | @interface SapphireSettings(private) |
|---|
| 24 | - (void)processFiles:(NSArray *)files; |
|---|
| 25 | - (void)filesProcessed:(NSDictionary *)files; |
|---|
| 26 | @end |
|---|
| 27 | |
|---|
| 28 | @implementation SapphireSettings |
|---|
| 29 | |
|---|
| 30 | #define HIDE_FAVORITE_KEY @"HideFavorites" |
|---|
| 31 | #define HIDE_TOP_SHOWS_KEY @"HideTopShows" |
|---|
| 32 | #define HIDE_UNWATCHED_KEY @"HideUnwatched" |
|---|
| 33 | #define HIDE_SPOILERS_KEY @"HideSpoilers" |
|---|
| 34 | #define HIDE_UI_QUIT_KEY @"HideUIQuit" |
|---|
| 35 | #define ENABLE_FAST_SWITCHING_KEY @"EnableFastSwitching" |
|---|
| 36 | #define USE_AC3_PASSTHROUGH @"EnableAC3Passthrough" |
|---|
| 37 | #define DISABLE_ANON_KEY @"DisableAnonymousReporting" |
|---|
| 38 | #define LAST_PREDICATE @"LastPredicate" |
|---|
| 39 | |
|---|
| 40 | /*! |
|---|
| 41 | * @brief Get the shared settings object |
|---|
| 42 | * |
|---|
| 43 | * @return The settings object |
|---|
| 44 | */ |
|---|
| 45 | + (SapphireSettings *)sharedSettings |
|---|
| 46 | { |
|---|
| 47 | return sharedInstance; |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | /*! |
|---|
| 51 | * @brief Allow the shared settings object to be freed |
|---|
| 52 | */ |
|---|
| 53 | + (void)relinquishSettings |
|---|
| 54 | { |
|---|
| 55 | [sharedInstance release]; |
|---|
| 56 | sharedInstance = nil; |
|---|
| 57 | } |
|---|
| 58 | |
|---|
| 59 | /*! |
|---|
| 60 | * @brief Create a settings object |
|---|
| 61 | * |
|---|
| 62 | * @param scene The scene |
|---|
| 63 | * @param dictionaryPath The path of the saved setting |
|---|
| 64 | * @param meta The top level meta data |
|---|
| 65 | * @return The settings object |
|---|
| 66 | */ |
|---|
| 67 | - (id) initWithScene: (BRRenderScene *) scene settingsPath:(NSString *)dictionaryPath metaDataCollection:(SapphireMetaDataCollection *)collection |
|---|
| 68 | { |
|---|
| 69 | if(sharedInstance != nil) |
|---|
| 70 | return sharedInstance; |
|---|
| 71 | |
|---|
| 72 | self = [super initWithScene:scene]; |
|---|
| 73 | |
|---|
| 74 | /*Setup display*/ |
|---|
| 75 | metaCollection = [collection retain]; |
|---|
| 76 | names = [[NSArray alloc] initWithObjects: BRLocalizedString(@" Populate File Data", @"Populate File Data menu item"), |
|---|
| 77 | BRLocalizedString(@" Fetch TV Show Data", @"Fetch TV Show Data menu item"), |
|---|
| 78 | BRLocalizedString(@" Fetch Movie Data", @"Fetch Movie Data menu item"), |
|---|
| 79 | /* BRLocalizedString(@" Choose Movie Posters", @"Start Poster Chooser menu item"),*/ |
|---|
| 80 | BRLocalizedString(@" Hide Collections", @"Hide Collections menu item"), |
|---|
| 81 | BRLocalizedString(@" Don't Import Collections", @"Don't Import Collections menu item"), |
|---|
| 82 | BRLocalizedString(@" Skip \"Favorite Shows\" filter", @"Skip Favorite shows menu item"), |
|---|
| 83 | /* BRLocalizedString(@" Skip \"Top Shows\" filter", @"Skip Top shows menu item"),*/ |
|---|
| 84 | BRLocalizedString(@" Skip \"Unwatched Shows\" filter", @"Skip Unwatched shows menu item"), |
|---|
| 85 | BRLocalizedString(@" Hide Show Spoilers", @"Hide show summarys menu item"), |
|---|
| 86 | BRLocalizedString(@" Hide UI Quit", @"Hide the ui quitter menu item"), |
|---|
| 87 | BRLocalizedString(@" Fast Directory Switching", @"Don't rescan directories upon entry and used cached data"), |
|---|
| 88 | BRLocalizedString(@" Enable AC3 Passthrough", @"Enable AC3 Passthrough menu item"), |
|---|
| 89 | BRLocalizedString(@" Disable Anonymous Reporting", @"Disable the anonymous reporting for aid in future features"), nil]; |
|---|
| 90 | |
|---|
| 91 | keys = [[NSArray alloc] initWithObjects: @"", |
|---|
| 92 | @"", |
|---|
| 93 | @"", |
|---|
| 94 | /* @"",*/ |
|---|
| 95 | @"", |
|---|
| 96 | @"", |
|---|
| 97 | HIDE_FAVORITE_KEY, |
|---|
| 98 | /*HIDE_TOP_SHOWS_KEY, */ |
|---|
| 99 | HIDE_UNWATCHED_KEY, |
|---|
| 100 | HIDE_SPOILERS_KEY, |
|---|
| 101 | HIDE_UI_QUIT_KEY, |
|---|
| 102 | ENABLE_FAST_SWITCHING_KEY, |
|---|
| 103 | USE_AC3_PASSTHROUGH, |
|---|
| 104 | DISABLE_ANON_KEY, nil]; |
|---|
| 105 | SapphireTheme *theme = [SapphireTheme sharedTheme]; |
|---|
| 106 | gems = [[NSArray alloc] initWithObjects: [theme gem:IMPORT_GEM_KEY], |
|---|
| 107 | [theme gem:TVR_GEM_KEY], |
|---|
| 108 | [theme gem:IMDB_GEM_KEY], |
|---|
| 109 | /*[theme gem:GREEN_GEM_KEY],*/ |
|---|
| 110 | [theme gem:FILE_GEM_KEY], |
|---|
| 111 | [theme gem:FILE_GEM_KEY], |
|---|
| 112 | [theme gem:YELLOW_GEM_KEY], |
|---|
| 113 | /*[theme gem:GREEN_GEM_KEY],*/ |
|---|
| 114 | [theme gem:BLUE_GEM_KEY], |
|---|
| 115 | [theme gem:NOTE_GEM_KEY], |
|---|
| 116 | [theme gem:FRONTROW_GEM_KEY], |
|---|
| 117 | [theme gem:FAST_GEM_KEY], |
|---|
| 118 | [theme gem:AUDIO_GEM_KEY], |
|---|
| 119 | [theme gem:REPORT_GEM_KEY], nil]; |
|---|
| 120 | |
|---|
| 121 | path = [dictionaryPath retain]; |
|---|
| 122 | options = [[NSDictionary dictionaryWithContentsOfFile:dictionaryPath] mutableCopy]; |
|---|
| 123 | /*Set deaults*/ |
|---|
| 124 | defaults = [[NSDictionary alloc] initWithObjectsAndKeys: |
|---|
| 125 | [NSNumber numberWithBool:NO], HIDE_FAVORITE_KEY, |
|---|
| 126 | [NSNumber numberWithBool:YES], HIDE_TOP_SHOWS_KEY, |
|---|
| 127 | [NSNumber numberWithBool:NO], HIDE_UNWATCHED_KEY, |
|---|
| 128 | [NSNumber numberWithBool:NO], HIDE_SPOILERS_KEY, |
|---|
| 129 | [NSNumber numberWithBool:YES], HIDE_UI_QUIT_KEY, |
|---|
| 130 | [NSNumber numberWithBool:YES], ENABLE_FAST_SWITCHING_KEY, |
|---|
| 131 | [NSNumber numberWithBool:NO], USE_AC3_PASSTHROUGH, |
|---|
| 132 | [NSNumber numberWithBool:NO], DISABLE_ANON_KEY, |
|---|
| 133 | [NSNumber numberWithInt:NSNotFound], LAST_PREDICATE, |
|---|
| 134 | nil]; |
|---|
| 135 | if(options == nil) |
|---|
| 136 | options = [[NSMutableDictionary alloc] init]; |
|---|
| 137 | |
|---|
| 138 | /*display*/ |
|---|
| 139 | BRListControl *list = [self list]; |
|---|
| 140 | [list setDatasource:self]; |
|---|
| 141 | [SapphireFrontRowCompat addDividerAtIndex:5 toList:list]; |
|---|
| 142 | /*Save our instance*/ |
|---|
| 143 | sharedInstance = [self retain]; |
|---|
| 144 | |
|---|
| 145 | return self; |
|---|
| 146 | } |
|---|
| 147 | |
|---|
| 148 | /*! |
|---|
| 149 | * @brief Writes settings to disk |
|---|
| 150 | */ |
|---|
| 151 | - (void)writeSettings |
|---|
| 152 | { |
|---|
| 153 | [options writeToFile:path atomically:YES]; |
|---|
| 154 | } |
|---|
| 155 | |
|---|
| 156 | - (void)dealloc |
|---|
| 157 | { |
|---|
| 158 | [names release]; |
|---|
| 159 | [options release]; |
|---|
| 160 | [gems release]; |
|---|
| 161 | [path release]; |
|---|
| 162 | [defaults release]; |
|---|
| 163 | [metaCollection release]; |
|---|
| 164 | [super dealloc]; |
|---|
| 165 | } |
|---|
| 166 | |
|---|
| 167 | /*! |
|---|
| 168 | * @brief Get a setting |
|---|
| 169 | * |
|---|
| 170 | * @param key The setting to retrieve |
|---|
| 171 | * @return The setting in an NSNumber |
|---|
| 172 | */ |
|---|
| 173 | - (NSNumber *)numberForKey:(NSString *)key |
|---|
| 174 | { |
|---|
| 175 | /*Check the user's setting*/ |
|---|
| 176 | NSNumber *num = [options objectForKey:key]; |
|---|
| 177 | if(!num) |
|---|
| 178 | /*User hasn't set yet, use default then*/ |
|---|
| 179 | num = [defaults objectForKey:key]; |
|---|
| 180 | return num; |
|---|
| 181 | } |
|---|
| 182 | |
|---|
| 183 | /*! |
|---|
| 184 | * @brief Get a setting |
|---|
| 185 | * |
|---|
| 186 | * @param key The setting to retrieve |
|---|
| 187 | * @return YES if set, NO otherwise |
|---|
| 188 | */ |
|---|
| 189 | - (BOOL)boolForKey:(NSString *)key |
|---|
| 190 | { |
|---|
| 191 | /*Check the user's setting*/ |
|---|
| 192 | NSNumber *num = [options objectForKey:key]; |
|---|
| 193 | if(!num) |
|---|
| 194 | /*User hasn't set yet, use default then*/ |
|---|
| 195 | num = [defaults objectForKey:key]; |
|---|
| 196 | return [num boolValue]; |
|---|
| 197 | } |
|---|
| 198 | |
|---|
| 199 | /*! |
|---|
| 200 | * @brief Returns whether to display unwatched |
|---|
| 201 | * |
|---|
| 202 | * @return YES if set, NO otherwise |
|---|
| 203 | */ |
|---|
| 204 | - (BOOL)displayUnwatched |
|---|
| 205 | { |
|---|
| 206 | return ![self boolForKey:HIDE_UNWATCHED_KEY]; |
|---|
| 207 | } |
|---|
| 208 | |
|---|
| 209 | /*! |
|---|
| 210 | * @brief Returns whether to display favorites |
|---|
| 211 | * |
|---|
| 212 | * @return YES if set, NO otherwise |
|---|
| 213 | */ |
|---|
| 214 | - (BOOL)displayFavorites; |
|---|
| 215 | { |
|---|
| 216 | return ![self boolForKey:HIDE_FAVORITE_KEY]; |
|---|
| 217 | } |
|---|
| 218 | |
|---|
| 219 | /*! |
|---|
| 220 | * @brief Returns whether to display top shows |
|---|
| 221 | * |
|---|
| 222 | * @return YES if set, NO otherwise |
|---|
| 223 | */ |
|---|
| 224 | - (BOOL)displayTopShows; |
|---|
| 225 | { |
|---|
| 226 | return ![self boolForKey:HIDE_TOP_SHOWS_KEY]; |
|---|
| 227 | } |
|---|
| 228 | |
|---|
| 229 | /*! |
|---|
| 230 | * @brief Returns whether to display spoilers |
|---|
| 231 | * |
|---|
| 232 | * @return YES if set, NO otherwise |
|---|
| 233 | */ |
|---|
| 234 | - (BOOL)displaySpoilers; |
|---|
| 235 | { |
|---|
| 236 | return ![self boolForKey:HIDE_SPOILERS_KEY]; |
|---|
| 237 | } |
|---|
| 238 | |
|---|
| 239 | /*! |
|---|
| 240 | * @brief Returns whether to disable UI quit |
|---|
| 241 | * |
|---|
| 242 | * @return YES if set, NO otherwise |
|---|
| 243 | */ |
|---|
| 244 | - (BOOL)disableUIQuit |
|---|
| 245 | { |
|---|
| 246 | return [self boolForKey:HIDE_UI_QUIT_KEY]; |
|---|
| 247 | } |
|---|
| 248 | |
|---|
| 249 | /*! |
|---|
| 250 | * @brief Returns whether to disable anonymous reporting |
|---|
| 251 | * |
|---|
| 252 | * @return YES if set, NO otherwise |
|---|
| 253 | */ |
|---|
| 254 | - (BOOL)disableAnonymousReporting; |
|---|
| 255 | { |
|---|
| 256 | return [self boolForKey:DISABLE_ANON_KEY]; |
|---|
| 257 | } |
|---|
| 258 | |
|---|
| 259 | /*! |
|---|
| 260 | * @brief Returns whether to use AC3 passthrough |
|---|
| 261 | * |
|---|
| 262 | * @return YES if set, NO otherwise |
|---|
| 263 | */ |
|---|
| 264 | - (BOOL)useAC3Passthrough |
|---|
| 265 | { |
|---|
| 266 | return [self boolForKey:USE_AC3_PASSTHROUGH]; |
|---|
| 267 | } |
|---|
| 268 | |
|---|
| 269 | /*! |
|---|
| 270 | * @brief Returns whether to use fast directory switching |
|---|
| 271 | * |
|---|
| 272 | * @return YES if set, NO otherwise |
|---|
| 273 | */ |
|---|
| 274 | - (BOOL)fastSwitching |
|---|
| 275 | { |
|---|
| 276 | return [self boolForKey:ENABLE_FAST_SWITCHING_KEY]; |
|---|
| 277 | |
|---|
| 278 | } |
|---|
| 279 | |
|---|
| 280 | /*! |
|---|
| 281 | * @brief Returns the index of the last predicate used |
|---|
| 282 | * |
|---|
| 283 | * @return The index of the last predicate used |
|---|
| 284 | */ |
|---|
| 285 | - (int)indexOfLastPredicate |
|---|
| 286 | { |
|---|
| 287 | return [[self numberForKey:LAST_PREDICATE] intValue]; |
|---|
| 288 | } |
|---|
| 289 | |
|---|
| 290 | /*! |
|---|
| 291 | * @brief Sets the index of the last predicate |
|---|
| 292 | * |
|---|
| 293 | * @param index The index of the last predicate used |
|---|
| 294 | */ |
|---|
| 295 | - (void)setIndexOfLastPredicate:(int)index |
|---|
| 296 | { |
|---|
| 297 | [options setObject:[NSNumber numberWithInt:index] forKey:LAST_PREDICATE]; |
|---|
| 298 | /*Save our settings*/ |
|---|
| 299 | [self writeSettings]; |
|---|
| 300 | } |
|---|
| 301 | |
|---|
| 302 | - (void) willBePushed |
|---|
| 303 | { |
|---|
| 304 | // We're about to be placed on screen, but we're not yet there |
|---|
| 305 | |
|---|
| 306 | // always call super |
|---|
| 307 | [super willBePushed]; |
|---|
| 308 | } |
|---|
| 309 | |
|---|
| 310 | - (void) wasPushed |
|---|
| 311 | { |
|---|
| 312 | // We've just been put on screen, the user can see this controller's content now |
|---|
| 313 | |
|---|
| 314 | // always call super |
|---|
| 315 | [super wasPushed]; |
|---|
| 316 | } |
|---|
| 317 | |
|---|
| 318 | - (void) willBePopped |
|---|
| 319 | { |
|---|
| 320 | // The user pressed Menu, but we've not been removed from the screen yet |
|---|
| 321 | |
|---|
| 322 | // always call super |
|---|
| 323 | [super willBePopped]; |
|---|
| 324 | } |
|---|
| 325 | |
|---|
| 326 | - (void) wasPopped |
|---|
| 327 | { |
|---|
| 328 | // The user pressed Menu, removing us from the screen |
|---|
| 329 | |
|---|
| 330 | // always call super |
|---|
| 331 | [super wasPopped]; |
|---|
| 332 | } |
|---|
| 333 | |
|---|
| 334 | - (void) willBeBuried |
|---|
| 335 | { |
|---|
| 336 | // The user just chose an option, and we will be taken off the screen |
|---|
| 337 | |
|---|
| 338 | // always call super |
|---|
| 339 | [super willBeBuried]; |
|---|
| 340 | } |
|---|
| 341 | |
|---|
| 342 | - (void) wasBuriedByPushingController: (BRLayerController *) controller |
|---|
| 343 | { |
|---|
| 344 | // The user chose an option and this controller os no longer on screen |
|---|
| 345 | |
|---|
| 346 | // always call super |
|---|
| 347 | [super wasBuriedByPushingController: controller]; |
|---|
| 348 | } |
|---|
| 349 | |
|---|
| 350 | - (void) willBeExhumed |
|---|
| 351 | { |
|---|
| 352 | // the user pressed Menu, but we've not been revealed yet |
|---|
| 353 | |
|---|
| 354 | // always call super |
|---|
| 355 | [super willBeExhumed]; |
|---|
| 356 | } |
|---|
| 357 | |
|---|
| 358 | - (void) wasExhumedByPoppingController: (BRLayerController *) controller |
|---|
| 359 | { |
|---|
| 360 | // handle being revealed when the user presses Menu |
|---|
| 361 | |
|---|
| 362 | // always call super |
|---|
| 363 | [super wasExhumedByPoppingController: controller]; |
|---|
| 364 | } |
|---|
| 365 | |
|---|
| 366 | - (long) itemCount |
|---|
| 367 | { |
|---|
| 368 | // return the number of items in your menu list here |
|---|
| 369 | return ( [ names count]); |
|---|
| 370 | } |
|---|
| 371 | |
|---|
| 372 | - (id<BRMenuItemLayer>) itemForRow: (long) row |
|---|
| 373 | { |
|---|
| 374 | /* |
|---|
| 375 | // build a BRTextMenuItemLayer or a BRAdornedMenuItemLayer, etc. here |
|---|
| 376 | // return that object, it will be used to display the list item. |
|---|
| 377 | return ( nil ); |
|---|
| 378 | */ |
|---|
| 379 | if( row >= [names count] ) return ( nil ) ; |
|---|
| 380 | |
|---|
| 381 | BRAdornedMenuItemLayer * result = nil ; |
|---|
| 382 | NSString *name = [names objectAtIndex:row]; |
|---|
| 383 | result = [SapphireFrontRowCompat textMenuItemForScene:[self scene] folder:NO]; |
|---|
| 384 | |
|---|
| 385 | if( row > 4 && [self boolForKey:[keys objectAtIndex:row]]) |
|---|
| 386 | { |
|---|
| 387 | [SapphireFrontRowCompat setLeftIcon:[SapphireFrontRowCompat selectedSettingImageForScene:[self scene]] forMenu:result]; |
|---|
| 388 | } |
|---|
| 389 | [SapphireFrontRowCompat setRightIcon:[gems objectAtIndex:row] forMenu:result]; |
|---|
| 390 | |
|---|
| 391 | // add text |
|---|
| 392 | [SapphireFrontRowCompat setTitle:name forMenu:result]; |
|---|
| 393 | |
|---|
| 394 | return ( result ) ; |
|---|
| 395 | } |
|---|
| 396 | |
|---|
| 397 | - (NSString *) titleForRow: (long) row |
|---|
| 398 | { |
|---|
| 399 | |
|---|
| 400 | if ( row >= [ names count] ) return ( nil ); |
|---|
| 401 | |
|---|
| 402 | NSString *result = [ names objectAtIndex: row] ; |
|---|
| 403 | return ( result ) ; |
|---|
| 404 | /* |
|---|
| 405 | // return the title for the list item at the given index here |
|---|
| 406 | return ( @"Sapphire" ); |
|---|
| 407 | */ |
|---|
| 408 | } |
|---|
| 409 | |
|---|
| 410 | - (long) rowForTitle: (NSString *) title |
|---|
| 411 | { |
|---|
| 412 | long result = -1; |
|---|
| 413 | long i, count = [self itemCount]; |
|---|
| 414 | for ( i = 0; i < count; i++ ) |
|---|
| 415 | { |
|---|
| 416 | if ( [title isEqualToString: [self titleForRow: i]] ) |
|---|
| 417 | { |
|---|
| 418 | result = i; |
|---|
| 419 | break; |
|---|
| 420 | } |
|---|
| 421 | } |
|---|
| 422 | |
|---|
| 423 | return ( result ); |
|---|
| 424 | } |
|---|
| 425 | |
|---|
| 426 | - (void) itemSelected: (long) row |
|---|
| 427 | { |
|---|
| 428 | // This is called when the user changed a setting |
|---|
| 429 | |
|---|
| 430 | /*Check for populate show data*/ |
|---|
| 431 | if(row==0) |
|---|
| 432 | { |
|---|
| 433 | SapphireFileDataImporter *importer = [[SapphireFileDataImporter alloc] init]; |
|---|
| 434 | SapphireImporterDataMenu *menu = [[SapphireImporterDataMenu alloc] initWithScene:[self scene] metaDataCollection:metaCollection importer:importer]; |
|---|
| 435 | [[self stack] pushController:menu]; |
|---|
| 436 | [menu release]; |
|---|
| 437 | [importer release]; |
|---|
| 438 | } |
|---|
| 439 | /*Check for import of TV data*/ |
|---|
| 440 | else if(row == 1) |
|---|
| 441 | { |
|---|
| 442 | SapphireTVShowImporter *importer = [[SapphireTVShowImporter alloc] initWithSavedSetting:[[path stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"tvdata.plist"]]; |
|---|
| 443 | SapphireImporterDataMenu *menu = [[SapphireImporterDataMenu alloc] initWithScene:[self scene] metaDataCollection:metaCollection importer:importer]; |
|---|
| 444 | [[self stack] pushController:menu]; |
|---|
| 445 | [menu release]; |
|---|
| 446 | [importer release]; |
|---|
| 447 | } |
|---|
| 448 | /*Start Importing Movie Data*/ |
|---|
| 449 | else if(row == 2) |
|---|
| 450 | { |
|---|
| 451 | SapphireMovieImporter *importer = [[SapphireMovieImporter alloc] initWithSavedSetting:[[path stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"movieData.plist"]]; |
|---|
| 452 | SapphireImporterDataMenu *menu = [[SapphireImporterDataMenu alloc] initWithScene:[self scene] metaDataCollection:metaCollection importer:importer]; |
|---|
| 453 | [[self stack] pushController:menu]; |
|---|
| 454 | [menu release]; |
|---|
| 455 | [importer release]; |
|---|
| 456 | } |
|---|
| 457 | /* |
|---|
| 458 | Start Movie Poster Chooser |
|---|
| 459 | else if(row == 3) |
|---|
| 460 | { |
|---|
| 461 | // SapphirePosterBrowse *chooser = [[SapphirePosterChooser alloc] initWithScene:[self scene] metaDataPath:[[path stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"movieData.plist"]]; |
|---|
| 462 | // [[self stack] pushController:chooser]; |
|---|
| 463 | // [chooser release]; |
|---|
| 464 | } |
|---|
| 465 | */ |
|---|
| 466 | else if(row == 3) |
|---|
| 467 | { |
|---|
| 468 | SapphireCollectionSettings *colSettings = [[SapphireCollectionSettings alloc] initWithScene:[self scene] collection:metaCollection]; |
|---|
| 469 | [colSettings setGettingSelector:@selector(hideCollection:)]; |
|---|
| 470 | [colSettings setSettingSelector:@selector(setHide:forCollection:)]; |
|---|
| 471 | [colSettings setListTitle:BRLocalizedString(@"Hide Collections", @"Hide Collections Menu Title")] ; |
|---|
| 472 | [[self stack] pushController:colSettings]; |
|---|
| 473 | [colSettings release]; |
|---|
| 474 | } |
|---|
| 475 | else if(row == 4) |
|---|
| 476 | { |
|---|
| 477 | SapphireCollectionSettings *colSettings = [[SapphireCollectionSettings alloc] initWithScene:[self scene] collection:metaCollection]; |
|---|
| 478 | [colSettings setGettingSelector:@selector(skipCollection:)]; |
|---|
| 479 | [colSettings setSettingSelector:@selector(setSkip:forCollection:)]; |
|---|
| 480 | [colSettings setListTitle:BRLocalizedString(@"Skip Collections", @"Skip Collections Menu Title")] ; |
|---|
| 481 | [[self stack] pushController:colSettings]; |
|---|
| 482 | [colSettings release]; |
|---|
| 483 | } |
|---|
| 484 | /*Change setting*/ |
|---|
| 485 | else |
|---|
| 486 | { |
|---|
| 487 | NSString *key = [keys objectAtIndex:row]; |
|---|
| 488 | BOOL setting = [self boolForKey:key]; |
|---|
| 489 | [options setObject:[NSNumber numberWithBool:!setting] forKey:key]; |
|---|
| 490 | } |
|---|
| 491 | |
|---|
| 492 | /*Save our settings*/ |
|---|
| 493 | [self writeSettings]; |
|---|
| 494 | |
|---|
| 495 | /*Redraw*/ |
|---|
| 496 | [[self list] reload] ; |
|---|
| 497 | [SapphireFrontRowCompat renderScene:[self scene]]; |
|---|
| 498 | |
|---|
| 499 | } |
|---|
| 500 | |
|---|
| 501 | - (id<BRMediaPreviewController>) previewControllerForItem: (long) item |
|---|
| 502 | { |
|---|
| 503 | // If subclassing BRMediaMenuController, this function is called when the selection cursor |
|---|
| 504 | // passes over an item. |
|---|
| 505 | return ( nil ); |
|---|
| 506 | } |
|---|
| 507 | |
|---|
| 508 | @end |
|---|
| 509 | |
|---|