diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2014-07-21 21:12:28 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2014-07-21 21:12:28 +0000 |
| commit | f6fffad08b0ef0709f8c897cef74ca822d80d802 (patch) | |
| tree | 740d07465113d7494a10728d758775605a89f392 | |
| parent | 0a350e09575dda4ad7c5bb21c5fe5edc659f1d59 (diff) | |
| download | pcsxr-f6fffad08b0ef0709f8c897cef74ca822d80d802.tar.gz | |
OS X: more improvements to the QuickLook plug-in.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@91020 e17a0e51-4ae3-4d35-97c3-1a29b211df97
| -rw-r--r-- | macosx/Pcsxr-QL/GeneratePreviewForURL.m | 21 | ||||
| -rw-r--r-- | macosx/Pcsxr-QL/GenerateThumbnailForURL.m | 4 | ||||
| -rw-r--r-- | macosx/Pcsxr-QL/Style.css | 5 | ||||
| -rw-r--r-- | macosx/Pcsxr-QL/en.lproj/InfoPlist.strings | 1 | ||||
| -rw-r--r-- | macosx/Pcsxr.xcodeproj/project.pbxproj | 4 | ||||
| -rw-r--r-- | macosx/Pcsxr.xcodeproj/xcshareddata/xcschemes/Pcsxr-QL.xcscheme | 25 |
6 files changed, 52 insertions, 8 deletions
diff --git a/macosx/Pcsxr-QL/GeneratePreviewForURL.m b/macosx/Pcsxr-QL/GeneratePreviewForURL.m index 24031a1c..afb150d7 100644 --- a/macosx/Pcsxr-QL/GeneratePreviewForURL.m +++ b/macosx/Pcsxr-QL/GeneratePreviewForURL.m @@ -77,15 +77,26 @@ OSStatus GeneratePreviewForFreeze(void *thisInterface, QLPreviewRequestRef previ free(pMem); return noErr; #else - return unimpErr; + return noErr; #endif } static OSStatus GeneratePreviewForMemCard(void *thisInterface, QLPreviewRequestRef preview, NSURL *url, NSDictionary *options) { NSArray *memCards = CreateArrayByEnumeratingMemoryCardAtURL(url); + + if (!memCards) { + return noErr; + } + NSMutableString *htmlStr = [[NSMutableString alloc] initWithCapacity:memCards.count * 200]; NSMutableDictionary *htmlDict = [[NSMutableDictionary alloc] initWithCapacity:memCards.count]; + NSBundle *Bundle; + { + CFBundleRef cfbundle = QLPreviewRequestGetGeneratorBundle(preview); + NSURL *bundURL = CFBridgingRelease(CFBundleCopyBundleURL(cfbundle)); + Bundle = [NSBundle bundleWithURL:bundURL]; + } int i; for (PcsxrMemoryObject *obj in memCards) { NSImage *theImage = [obj firstMemImage]; @@ -95,11 +106,15 @@ static OSStatus GeneratePreviewForMemCard(void *thisInterface, QLPreviewRequestR NSDictionary *imgProps = @{(NSString *)kQLPreviewPropertyAttachmentDataKey: pngData, (NSString *)kQLPreviewPropertyMIMETypeKey: @"image/png"}; NSString *imgName = [[@(i++) stringValue] stringByAppendingPathComponent:@"png"]; - [htmlStr appendFormat:@"<tr><td><img src=\"cid:%@\"></td><td>%@</td><td>%i</td></tr>\n", imgName, obj.sjisName, obj.blockSize]; + [htmlStr appendFormat:@"\t\t\t<tr><td><img src=\"cid:%@\"></td> <td>%@</td> <td>%i</td></tr>\n", imgName, obj.sjisName, obj.blockSize]; htmlDict[imgName] = imgProps; } - NSString *theStr = [[NSString alloc] initWithFormat:@"<html>\n<body>\n<table>\n<tr><td ALIGN=center>Image</td><td ALIGN=name>Image</td><td ALIGN=center>Count</td></tr>%@\n</table>\n</body>\n</html>", htmlStr]; + NSURL *cssURL = [Bundle URLForResource:@"Style" withExtension:@"css"]; + + NSString *attributeStr = [[NSString alloc] initWithContentsOfURL:cssURL encoding:NSUTF8StringEncoding error:NULL]; + + NSString *theStr = [[NSString alloc] initWithFormat:@"<html>\n\t<body>\n<style>\n%@</style>\n\t\t\t<table>\n<tr> <td ALIGN=center>Image</td> <td ALIGN=center>Name</td> <td ALIGN=center>Count</td> </tr>\n%@\n</table>\n\t</body>\n</html>", attributeStr ? attributeStr : @"", htmlStr]; NSData *data = [theStr dataUsingEncoding:NSUTF8StringEncoding]; NSDictionary *previewDict = diff --git a/macosx/Pcsxr-QL/GenerateThumbnailForURL.m b/macosx/Pcsxr-QL/GenerateThumbnailForURL.m index 44830fbd..2e84f4a6 100644 --- a/macosx/Pcsxr-QL/GenerateThumbnailForURL.m +++ b/macosx/Pcsxr-QL/GenerateThumbnailForURL.m @@ -88,12 +88,12 @@ OSStatus GenerateThumbnailForFreeze(void *thisInterface, QLThumbnailRequestRef t } return noErr; #else - return unimpErr; + return noErr; #endif } OSStatus GenerateThumbnailForMemCard(void *thisInterface, QLThumbnailRequestRef thumbnail, NSURL *url, NSDictionary *options, CGSize maxSize) { //NSArray *memCards = CreateArrayByEnumeratingMemoryCardAtURL(url); - return unimpErr; + return noErr; } diff --git a/macosx/Pcsxr-QL/Style.css b/macosx/Pcsxr-QL/Style.css new file mode 100644 index 00000000..e7f99748 --- /dev/null +++ b/macosx/Pcsxr-QL/Style.css @@ -0,0 +1,5 @@ +table,th,td +{ + border:1px solid black; + width:400px; +} diff --git a/macosx/Pcsxr-QL/en.lproj/InfoPlist.strings b/macosx/Pcsxr-QL/en.lproj/InfoPlist.strings index 477b28ff..1de7259d 100644 --- a/macosx/Pcsxr-QL/en.lproj/InfoPlist.strings +++ b/macosx/Pcsxr-QL/en.lproj/InfoPlist.strings @@ -1,2 +1,3 @@ /* Localized versions of Info.plist keys */ +NSHumanReadableCopyright = "Copyright © 2014 Pcsx Reloaded team"; diff --git a/macosx/Pcsxr.xcodeproj/project.pbxproj b/macosx/Pcsxr.xcodeproj/project.pbxproj index 0ded01e6..598a1b9b 100644 --- a/macosx/Pcsxr.xcodeproj/project.pbxproj +++ b/macosx/Pcsxr.xcodeproj/project.pbxproj @@ -194,6 +194,7 @@ 556C37AB197C9C59001A4265 /* PcsxrMemoryObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 55A90228147D89380037E18F /* PcsxrMemoryObject.m */; }; 556C37AD197D94C8001A4265 /* SDL2.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 554FD70817C6A13E0056CF66 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 556C37AE197D94D6001A4265 /* libSPUSharedCode.dylib in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 551A76E71786971B0052D185 /* libSPUSharedCode.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 556C37B0197DB3CB001A4265 /* Style.css in Resources */ = {isa = PBXBuildFile; fileRef = 556C37AF197DB3CB001A4265 /* Style.css */; }; 5581463917AABCD100862DBF /* PcsxrCheatHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 5581463817AABCD100862DBF /* PcsxrCheatHandler.m */; }; 559366CA12B694DF004ACC1E /* iR3000A-64.c in Sources */ = {isa = PBXBuildFile; fileRef = 559366C112B694DF004ACC1E /* iR3000A-64.c */; }; 559366CB12B694DF004ACC1E /* ix86-64.c in Sources */ = {isa = PBXBuildFile; fileRef = 559366C212B694DF004ACC1E /* ix86-64.c */; }; @@ -716,6 +717,7 @@ 5569B0C1182F0BE100991C9C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/NetPcsxrHIDInputPluginMain.strings; sourceTree = "<group>"; }; 556C37A8197C815C001A4265 /* PSXMemEnumerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSXMemEnumerator.m; sourceTree = "<group>"; }; 556C37AA197C81F9001A4265 /* PSXMemEnumerator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PSXMemEnumerator.h; sourceTree = "<group>"; }; + 556C37AF197DB3CB001A4265 /* Style.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = Style.css; sourceTree = "<group>"; }; 55707E8E18123579007CC5D0 /* hu */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/Localizable.strings; sourceTree = "<group>"; }; 55707E901812357B007CC5D0 /* hu */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/Localizable.strings; sourceTree = "<group>"; }; 55707E921812357D007CC5D0 /* hu */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/Localizable.strings; sourceTree = "<group>"; }; @@ -1166,6 +1168,7 @@ 550E343F18E6293D00A1AD21 /* Pcsxr-QL-Info.plist */, 550E344018E6293D00A1AD21 /* InfoPlist.strings */, 550E344918E6293D00A1AD21 /* Pcsxr-QL-Prefix.pch */, + 556C37AF197DB3CB001A4265 /* Style.css */, ); name = "Supporting Files"; sourceTree = "<group>"; @@ -2108,6 +2111,7 @@ buildActionMask = 2147483647; files = ( 550E344218E6293D00A1AD21 /* InfoPlist.strings in Resources */, + 556C37B0197DB3CB001A4265 /* Style.css in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/macosx/Pcsxr.xcodeproj/xcshareddata/xcschemes/Pcsxr-QL.xcscheme b/macosx/Pcsxr.xcodeproj/xcshareddata/xcschemes/Pcsxr-QL.xcscheme index e9759098..39e97aed 100644 --- a/macosx/Pcsxr.xcodeproj/xcshareddata/xcschemes/Pcsxr-QL.xcscheme +++ b/macosx/Pcsxr.xcodeproj/xcshareddata/xcschemes/Pcsxr-QL.xcscheme @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <Scheme LastUpgradeVersion = "0510" - version = "1.3"> + version = "2.0"> <BuildAction parallelizeBuildables = "YES" buildImplicitDependencies = "YES"> @@ -38,16 +38,35 @@ buildConfiguration = "Debug" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "NO" - allowLocationSimulation = "YES"> + debugXPCServices = "NO" + allowLocationSimulation = "NO" + viewDebuggingEnabled = "No"> <PathRunnable FilePath = "/System/Library/Frameworks/QuickLook.framework/Versions/A/Resources/quicklookd.app/Contents/MacOS/qlmanage"> </PathRunnable> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "550E343618E6293D00A1AD21" + BuildableName = "Pcsxr-QL.qlgenerator" + BlueprintName = "Pcsxr-QL" + ReferencedContainer = "container:Pcsxr.xcodeproj"> + </BuildableReference> + </MacroExpansion> <CommandLineArguments> <CommandLineArgument - argument = "-p /Users/cwbetts/Library/Application\ Support/Pcsxr/Save\ States/SCUS94555-000.pcsxrstate" + argument = "-g "${TARGET_BUILD_DIR}"/"${PRODUCT_NAME}".${WRAPPER_EXTENSION} -c com.codeplex.pcsxr.memcard" + isEnabled = "YES"> + </CommandLineArgument> + <CommandLineArgument + argument = "-p /Users/cwbetts/Library/"Application Support"/Pcsxr/"Memory Cards"/"descent max.mcr"" isEnabled = "YES"> </CommandLineArgument> <CommandLineArgument + argument = "-p /Users/cwbetts/Library/Application\ Support/Pcsxr/Save\ States/SCUS94555-000.pcsxrstate" + isEnabled = "NO"> + </CommandLineArgument> + <CommandLineArgument argument = "-p /Users/cwbetts/Library/Application\ Support/Pcsxr/Save\ States/JM3_FINAL1V4-SCUS94555.000.pcsxrstate" isEnabled = "NO"> </CommandLineArgument> |
