Changeset 218
- Timestamp:
- 09/10/07 22:21:54 (1 year ago)
- Files:
-
- trunk/Sapphire.xcodeproj/project.pbxproj (modified) (7 diffs)
- trunk/SapphireApplianceController.m (modified) (4 diffs)
- trunk/SapphireMetaData.h (modified) (3 diffs)
- trunk/SapphireMetaData.m (modified) (3 diffs)
- trunk/SapphireMovieImporter.h (added)
- trunk/SapphireMovieImporter.m (added)
- trunk/SapphireSettings.m (modified) (8 diffs)
- trunk/SapphireShowChooser.h (modified) (1 diff)
- trunk/SapphireShowChooser.m (modified) (3 diffs)
- trunk/SapphireTVShowImporter.m (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Sapphire.xcodeproj/project.pbxproj
r203 r218 56 56 FE423A9F0C333DF40035A717 /* Cone.png in Resources */ = {isa = PBXBuildFile; fileRef = FE423A9E0C333DF40035A717 /* Cone.png */; }; 57 57 FE423ABE0C3341D70035A717 /* Eye.png in Resources */ = {isa = PBXBuildFile; fileRef = FE423ABD0C3341D70035A717 /* Eye.png */; }; 58 FE5AAF9E0C5A96EF00932075 /* SapphireMovieChooser.m in Sources */ = {isa = PBXBuildFile; fileRef = FE5AAF9D0C5A96EF00932075 /* SapphireMovieChooser.m */; }; 58 59 FE5BD4670C3090CD009F2B2E /* ApplianceIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = FE5BD4660C3090CD009F2B2E /* ApplianceIcon.png */; }; 59 60 FE88FD100C2F564700C55E3F /* SapphireFileDataImporter.m in Sources */ = {isa = PBXBuildFile; fileRef = FE88FD0F0C2F564700C55E3F /* SapphireFileDataImporter.m */; }; 60 61 FE8D57D40C2DE4AF00BC1768 /* SapphireSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = FE8D57D30C2DE4AF00BC1768 /* SapphireSettings.m */; }; 62 FEB9DE9F0C96095A00E7788A /* SapphireMovieImporter.m in Sources */ = {isa = PBXBuildFile; fileRef = FEB9DE9D0C96095A00E7788A /* SapphireMovieImporter.m */; }; 61 63 /* End PBXBuildFile section */ 62 64 … … 132 134 FE423A9E0C333DF40035A717 /* Cone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Cone.png; sourceTree = "<group>"; }; 133 135 FE423ABD0C3341D70035A717 /* Eye.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Eye.png; sourceTree = "<group>"; }; 136 FE5AAF9C0C5A96EF00932075 /* SapphireMovieChooser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SapphireMovieChooser.h; sourceTree = "<group>"; }; 137 FE5AAF9D0C5A96EF00932075 /* SapphireMovieChooser.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SapphireMovieChooser.m; sourceTree = "<group>"; }; 134 138 FE5BD4660C3090CD009F2B2E /* ApplianceIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ApplianceIcon.png; sourceTree = "<group>"; }; 135 139 FE88FD0E0C2F564700C55E3F /* SapphireFileDataImporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SapphireFileDataImporter.h; sourceTree = "<group>"; }; … … 137 141 FE8D57D20C2DE4AF00BC1768 /* SapphireSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SapphireSettings.h; sourceTree = "<group>"; }; 138 142 FE8D57D30C2DE4AF00BC1768 /* SapphireSettings.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SapphireSettings.m; sourceTree = "<group>"; }; 143 FEB9DE9D0C96095A00E7788A /* SapphireMovieImporter.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SapphireMovieImporter.m; sourceTree = "<group>"; }; 144 FEB9DE9E0C96095A00E7788A /* SapphireMovieImporter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SapphireMovieImporter.h; sourceTree = "<group>"; }; 139 145 /* End PBXFileReference section */ 140 146 … … 241 247 isa = PBXGroup; 242 248 children = ( 249 FE5AAF9C0C5A96EF00932075 /* SapphireMovieChooser.h */, 250 FE5AAF9D0C5A96EF00932075 /* SapphireMovieChooser.m */, 243 251 F5EA8FCC0C30459400B1EC7D /* SapphireMarkMenu.h */, 244 252 F5EA8FCD0C30459400B1EC7D /* SapphireMarkMenu.m */, … … 308 316 isa = PBXGroup; 309 317 children = ( 318 FEB9DE9D0C96095A00E7788A /* SapphireMovieImporter.m */, 319 FEB9DE9E0C96095A00E7788A /* SapphireMovieImporter.h */, 310 320 FE88FD0E0C2F564700C55E3F /* SapphireFileDataImporter.h */, 311 321 FE88FD0F0C2F564700C55E3F /* SapphireFileDataImporter.m */, … … 420 430 F56B765E0C3837CE00E934AA /* SapphireShowChooser.m in Sources */, 421 431 F5E849C70C3F008100913832 /* SapphireMetaDataScanner.m in Sources */, 432 FE5AAF9E0C5A96EF00932075 /* SapphireMovieChooser.m in Sources */, 422 433 F565A1FD0C5BE81F00AE7110 /* SapphireAudioPlayer.m in Sources */, 423 434 F565A34A0C5BF69D00AE7110 /* SapphireAudioMedia.m in Sources */, … … 426 437 F51BFEFF0C8CB85D00709A5E /* SapphireCollectionSettings.m in Sources */, 427 438 F5B8DEE90C8F85BB00489829 /* SapphireTVDirectory.m in Sources */, 439 FEB9DE9F0C96095A00E7788A /* SapphireMovieImporter.m in Sources */, 428 440 ); 429 441 runOnlyForDeploymentPostprocessing = 0; trunk/SapphireApplianceController.m
r210 r218 19 19 #import "SapphireFileDataImporter.h" 20 20 #import "SapphireTVShowImporter.h" 21 #import "SapphireMovieImporter.h" 21 22 #import "SapphireAllImporter.h" 22 23 … … 109 110 } 110 111 111 // 112 112 113 - (id) initWithScene: (BRRenderScene *) scene 113 114 { … … 144 145 { 145 146 SapphireImporterDataMenu *allImporter = [self allImporterForCollection:metaCollection]; 146 147 147 NSMutableArray *mutableMasterNames = [[NSMutableArray alloc] init]; 148 148 NSMutableArray *mutableMasterControllers = [[NSMutableArray alloc] init]; … … 289 289 SapphireTheme *theme = [SapphireTheme sharedTheme]; 290 290 if([name isEqual: ALL_IMPORT_MENU_ITEM]) [result setLeftIcon:[theme gem:GEAR_GEM_KEY]]; 291 // else if([name isEqual: AGENT_IMPORT_MENU_ITEM]) [result setLeftIcon:[theme gem:GEAR_GEM_KEY]]; 291 292 else if([name isEqual: SETTINGS_MENU_ITEM]) [result setLeftIcon:[theme gem:GEAR_GEM_KEY]]; 292 293 else if([name isEqual: RESET_MENU_ITEM]) [result setLeftIcon:[theme gem:CONE_GEM_KEY]]; trunk/SapphireMetaData.h
r212 r218 11 11 12 12 #define META_TVRAGE_IMPORT_KEY @"TVRage Source" 13 #define META_IMDB_IMPORT_KEY @"IMDB Source" 13 14 #define META_XML_IMPORT_KEY @"XML Source" 14 15 … … 34 35 35 36 //IMDB Type Info 37 #define META_MOVIE_TITLE @"Title" 36 38 37 39 //Special Display Only Info … … 178 180 - (NSString *)episodeTitle; 179 181 - (NSString *)showID; 180 - (NSString *)showName; 182 - (NSString *)showName ; 183 - (void)setMediaType: (unsigned int) type ; 184 - (int)mediaType ; 181 185 - (NSString *)sizeString; 182 186 trunk/SapphireMetaData.m
r216 r218 37 37 #define AUDIO_FORMAT_KEY @"Audio Format" 38 38 #define FILE_CLASS_KEY @"File Class" 39 #define MEDIA_TYPE_KEY @"Media Type" 40 /* Media Types: 41 * 0= Unknown Media Type (init) 42 * 1= TV Show 43 * 2= Movie 44 * 3= Audio 45 * 4= Image 46 * 5= Other (User Selected) 47 */ 39 48 40 49 @implementation NSString (episodeSorting) … … 1445 1454 [fileMeta setObject:[NSNumber numberWithInt:modTime] forKey:MODIFIED_KEY]; 1446 1455 [fileMeta setObject:[props objectForKey:NSFileSize] forKey:SIZE_KEY]; 1456 [fileMeta setObject:[NSNumber numberWithUnsignedInt:0] forKey:MEDIA_TYPE_KEY] ; 1447 1457 [fileMeta setObject:[NSNumber numberWithInt:META_FILE_VERSION] forKey:META_VERSION_KEY]; 1448 1458 … … 1785 1795 } 1786 1796 1797 /*! 1798 * @brief Sets the media type of the file 1799 * 1800 * @param mediaType The media type of the file 1801 */ 1802 - (void)setMediaType: (unsigned int) type 1803 { 1804 [metaData setObject:[NSNumber numberWithUnsignedInt:type] forKey:MEDIA_TYPE_KEY]; 1805 } 1806 1807 /*! 1808 * @brief Returns the media type of the file 1809 * 1810 * @return The media type of the file 1811 */ 1812 - (int)mediaType 1813 { 1814 [self constructCombinedData] ; 1815 return [[combinedInfo objectForKey:MEDIA_TYPE_KEY] intValue] ; 1816 } 1817 1787 1818 /*Makes a pretty size string for the file*/ 1788 1819 - (NSString *)sizeString trunk/SapphireSettings.m
r201 r218 14 14 #import "SapphireFileDataImporter.h" 15 15 #import "SapphireTVShowImporter.h" 16 #import "SapphireMovieImporter.h" 16 17 #import "SapphireCollectionSettings.h" 17 18 … … 73 74 names = [[NSArray alloc] initWithObjects: BRLocalizedString(@" Populate File Data", @"Populate File Data menu item"), 74 75 BRLocalizedString(@" Fetch Internet Data", @"Fetch Internet Data menu item"), 76 BRLocalizedString(@" Start Movie Import", @"Start Movie Import menu item"), 75 77 BRLocalizedString(@" Hide Collections", @"Hide Collections menu item"), 76 78 BRLocalizedString(@" Don't Import Collections", @"Don't Import Collections menu item"), … … 85 87 86 88 keys = [[NSArray alloc] initWithObjects: @"", 89 @"", 87 90 @"", 88 91 @"", … … 99 102 gems = [[NSArray alloc] initWithObjects: [theme gem:EYE_GEM_KEY], 100 103 [theme gem:EYE_GEM_KEY], 104 [theme gem:CONE_GEM_KEY], 101 105 [theme gem:EYE_GEM_KEY], 102 106 [theme gem:EYE_GEM_KEY], … … 129 133 /*display*/ 130 134 [[self list] setDatasource:self]; 131 [[self list] addDividerAtIndex: 4];135 [[self list] addDividerAtIndex:5]; 132 136 /*Save our instance*/ 133 137 sharedInstance = [self retain]; … … 373 377 result = [BRAdornedMenuItemLayer adornedMenuItemWithScene: [self scene]] ; 374 378 375 if( row > 3&& [self boolForKey:[keys objectAtIndex:row]])379 if( row > 4 && [self boolForKey:[keys objectAtIndex:row]]) 376 380 { 377 381 [result setLeftIcon:[[BRThemeInfo sharedTheme] selectedSettingImageForScene:[self scene]]]; … … 436 440 [importer release]; 437 441 } 442 /*Start Importing Movie Data*/ 438 443 else if(row == 2) 444 { 445 SapphireMovieImporter *importer = [[SapphireMovieImporter alloc] initWithSavedSetting:[[path stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"tvdata.plist"]]; 446 SapphireImporterDataMenu *menu = [[SapphireImporterDataMenu alloc] initWithScene:[self scene] metaDataCollection:metaCollection importer:importer]; 447 [[self stack] pushController:menu]; 448 [menu release]; 449 [importer release]; 450 } 451 else if(row == 3) 439 452 { 440 453 SapphireCollectionSettings *colSettings = [[SapphireCollectionSettings alloc] initWithScene:[self scene] collection:metaCollection]; … … 445 458 [colSettings release]; 446 459 } 447 else if(row == 3)460 else if(row == 4) 448 461 { 449 462 SapphireCollectionSettings *colSettings = [[SapphireCollectionSettings alloc] initWithScene:[self scene] collection:metaCollection]; trunk/SapphireShowChooser.h
r201 r218 14 14 NSString *searchStr; 15 15 int selection; 16 BRTextControl *fileName; 16 17 } 17 18 18 19 - (void)setShows:(NSArray *)showList; 20 - (void)setFileName:(NSString *)choosingForFileName; 19 21 - (NSArray *)shows; 20 22 - (void)setSearchStr:(NSString *)search; trunk/SapphireShowChooser.m
r201 r218 26 26 selection = -1; 27 27 28 /* Set a control to display the fileName */ 29 fileName = [[BRTextControl alloc] initWithScene: scene]; 30 [fileName setTextAttributes:[[BRThemeInfo sharedTheme] paragraphTextAttributes]]; 31 [fileName setText:@"File:"]; 32 NSRect frame = [[self masterLayer] frame]; 33 // frame.size.height = frame.size.height / 16.0f; 34 // frame.size.width = frame.size.width * 2.0f / 3.0f; 35 frame.origin.y = frame.size.height / 4.0f; 36 frame.origin.x = frame.size.width * (2.0f / 9.0f); 37 [fileName setFrame: frame]; 38 39 40 [self addControl: fileName]; 28 41 [[self list] setDatasource:self]; 29 42 … … 72 85 73 86 /*! 87 * @brief Sets the filename to display 88 * 89 * @param choosingForFileName The filename being choosen for 90 */ 91 - (void)setFileName:(NSString*)choosingForFileName 92 { 93 [fileName setText:choosingForFileName]; 94 } 95 96 /*! 74 97 * @brief The string we searched for 75 98 * … … 99 122 { 100 123 BRAdornedMenuItemLayer *result = [BRAdornedMenuItemLayer adornedMenuItemWithScene:[self scene]]; 124 101 125 102 126 if(row == 0) 127 { 103 128 /*Put in the special "this is not a show"*/ 104 129 [[result textItem] setTitle:BRLocalizedString(@"<This is not a TV Show>", @"Mark an episode as not a TV show in the show chooser")]; 130 } 105 131 else 132 { 106 133 /*Put in the show*/ 107 134 [[result textItem] setTitle:[[shows objectAtIndex:row-1] objectForKey:@"name"]]; 135 } 108 136 109 137 return result; trunk/SapphireTVShowImporter.m
r201 r218 12 12 #import "SapphireShowChooser.h" 13 13 14 /* TVRage XPATHS */ 14 15 #define TVRAGE_SHOWNAME_XPATH @".//h3/text()" 15 16 #define TVRAGE_EPLIST_XPATH @"//*[@class='b']" … … 19 20 #define TVRAGE_SEARCH_XPATH @"//*[@class='b1']/a" 20 21 #define TVRAGE_UNKNOWN_XPATH @"//*[contains(text(), 'Unknown Page')]" 22 23 /* IMDB XPATHS */ 24 #define IMDB_SEARCH_XPATH @"//td[starts-with(a/@href,'/title')]" 25 #define IMDB_RESULT_LINK_XPATH @"a/@href" 26 #define IMDB_RESULT_NAME_XPATH @"normalize-space(string())" 21 27 22 28 #define TRANSLATIONS_KEY @"Translations" … … 494 500 SapphireShowChooser *chooser = [[SapphireShowChooser alloc] initWithScene:[dataMenu scene]]; 495 501 [chooser setShows:shows]; 496 [chooser setListTitle:[BRLocalizedString(@"Show? ", @"Prompt the user for showname with a file") stringByAppendingString:fileName]]; 502 [chooser setFileName:fileName]; 503 //[chooser setListTitle:[BRLocalizedString(@"Show? ", @"Prompt the user for showname with a file") stringByAppendingString:fileName]]; 504 [chooser setListTitle:BRLocalizedString(@"Select Show Title", @"Prompt the user for showname with a file")]; 497 505 [chooser setSearchStr:searchStr]; 498 506 /*And display prompt*/ … … 575 583 - (NSString *)completionText 576 584 { 577 return BRLocalizedString(@"All availble TV Show & Moviedata has been imported", @"The TV Show import complete");585 return BRLocalizedString(@"All availble TV Show data has been imported", @"The TV Show import complete"); 578 586 } 579 587 … … 595 603 - (NSString *)informativeText 596 604 { 597 return BRLocalizedString(@"This tool will attempt to fetch information about your TV Show & Movie files from the Internet (TVRage, IMDB, IMPAwards). This procedure may take quite some time and could ask you questions. You may cancel at any time.", @"Description of the tv showimport");605 return BRLocalizedString(@"This tool will attempt to fetch information about your Movie files from the Internet (IMDB/IMPAwards). This procedure may take quite some time and could ask you questions. You may cancel at any time.", @"Description of the movie import"); 598 606 } 599 607
