From 1ca710ff8f4c5535d638ea31d3aae98a7791f485 Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Mon, 8 Sep 2014 15:01:26 +0000 Subject: [PATCH] OS X: only store the sjis string from the memory card: The sjis title returned from GetMcdBlockInfo is is the latin title with Shift Japanese added, use that exclusively for PcsxrMemoryObject's name string. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@91359 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/Pcsxr-QL/GeneratePreviewForURL.m | 4 +- macosx/Resources/Base.lproj/Configuration.xib | 39 +++++++------------ macosx/Resources/en.lproj/Localizable.strings | 2 +- macosx/Resources/fr.lproj/Localizable.strings | 4 +- macosx/Resources/hu.lproj/Localizable.strings | 4 +- .../zh-Hans.lproj/Localizable.strings | 2 +- macosx/Source/PcsxrDiscHandler.m | 2 +- macosx/Source/PcsxrMemCardController.m | 2 +- macosx/Source/PcsxrMemoryObject.h | 3 +- macosx/Source/PcsxrMemoryObject.m | 25 +++--------- 10 files changed, 30 insertions(+), 57 deletions(-) diff --git a/macosx/Pcsxr-QL/GeneratePreviewForURL.m b/macosx/Pcsxr-QL/GeneratePreviewForURL.m index b4b61e3a..6238f911 100644 --- a/macosx/Pcsxr-QL/GeneratePreviewForURL.m +++ b/macosx/Pcsxr-QL/GeneratePreviewForURL.m @@ -118,7 +118,7 @@ static OSStatus GeneratePreviewForMemCard(void *thisInterface, QLPreviewRequestR NSDictionary *imgProps = @{(NSString *)kQLPreviewPropertyAttachmentDataKey: pngData, (NSString *)kQLPreviewPropertyMIMETypeKey: @"image/png"}; NSString *imgName = [[@(i++) stringValue] stringByAppendingPathExtension:@"png"]; - [htmlStr appendFormat:@"\t\t\t %@ %i\n", imgName, obj.sjisName, obj.blockSize]; + [htmlStr appendFormat:@"\t\t\t %@ %i\n", imgName, obj.name, obj.blockSize]; htmlDict[imgName] = imgProps; continue; } @@ -135,7 +135,7 @@ static OSStatus GeneratePreviewForMemCard(void *thisInterface, QLPreviewRequestR NSDictionary *imgProps = @{(NSString *)kQLPreviewPropertyAttachmentDataKey: gifData, (NSString *)kQLPreviewPropertyMIMETypeKey: @"image/gif"}; NSString *imgName = [[@(i++) stringValue] stringByAppendingPathExtension:@"gif"]; - [htmlStr appendFormat:@"\t\t\t %@ %i\n", imgName, obj.sjisName, obj.blockSize]; + [htmlStr appendFormat:@"\t\t\t %@ %i\n", imgName, obj.name, obj.blockSize]; htmlDict[imgName] = imgProps; } diff --git a/macosx/Resources/Base.lproj/Configuration.xib b/macosx/Resources/Base.lproj/Configuration.xib index 75798625..e6e9d7ea 100644 --- a/macosx/Resources/Base.lproj/Configuration.xib +++ b/macosx/Resources/Base.lproj/Configuration.xib @@ -1147,17 +1147,17 @@ - + - + - + - + @@ -1168,29 +1168,21 @@ - - - - - - - - - - - - + + + + - + - + @@ -1201,7 +1193,7 @@ - + @@ -1237,21 +1229,16 @@ - - + - - - + - - diff --git a/macosx/Resources/en.lproj/Localizable.strings b/macosx/Resources/en.lproj/Localizable.strings index af3d0e8d..8937f85e 100644 --- a/macosx/Resources/en.lproj/Localizable.strings +++ b/macosx/Resources/en.lproj/Localizable.strings @@ -87,7 +87,7 @@ "Deleting a block will remove all saved data on that block.\n\nThis cannot be undone." = "Deleting a memory card object will set the blocks to not be readable by the emulator, and may result in the data being overwritten in the future."; "No Free Space" = "No Free Space"; "Memory card %d doesn't have %d free consecutive blocks on it. Please remove some blocks on that card to continue" = "Memory card %1$d doesn't have %2$d free consecutive blocks on it. Please remove some blocks on that card to continue."; -"Memory card %i does not have enough free consecutive blocks.\n\nIn order to copy over \"%@ (%@),\" memory card %i must be compressed. Compressing memory cards will make deleted blocks unrecoverable.\n\nDo you want to continue?" = "Memory card %1$i does not have enough free consecutive blocks.\n\nIn order to copy over “%2$@ (%3$@),” memory card %4$i must be compressed. Compressing memory cards will make deleted blocks unrecoverable.\n\nDo you want to continue?"; +"Memory card %i does not have enough free consecutive blocks.\n\nIn order to copy over \"%@,\" memory card %i must be compressed. Compressing memory cards will make deleted blocks unrecoverable.\n\nDo you want to continue?" = "Memory card %1$i does not have enough free consecutive blocks.\n\nIn order to copy over “%2$@,” memory card %3$i must be compressed. Compressing memory cards will make deleted blocks unrecoverable.\n\nDo you want to continue?"; //Cheat manager "Save Cheats" = "Save Cheats"; diff --git a/macosx/Resources/fr.lproj/Localizable.strings b/macosx/Resources/fr.lproj/Localizable.strings index 15bbc906..945cd05c 100644 --- a/macosx/Resources/fr.lproj/Localizable.strings +++ b/macosx/Resources/fr.lproj/Localizable.strings @@ -1,4 +1,4 @@ -/* +/* Localizable.strings Pcsx @@ -89,7 +89,7 @@ //"Deleting a block will remove all saved data on that block.\n\nThis cannot be undone." = "Deleting a memory card object will set the blocks to not be readable by the emulator, and may result in the data being overwritten in the future."; "No Free Space" = "Pas d'emplacement libre sur la carte mémoire"; //Trim this down //"Memory card %d doesn't have %d free consecutive blocks on it. Please remove some blocks on that card to continue" = "Memory card %1$d doesn't have %2$d free consecutive blocks on it. Please remove some blocks on that card to continue."; -//"Memory card %i does not have enough free consecutive blocks.\n\nIn order to copy over \"%@ (%@),\" memory card %i must be compressed. Compressing memory cards will make deleted blocks unrecoverable.\n\nDo you want to continue?" = "Memory card %1$i does not have enough free consecutive blocks.\n\nIn order to copy over \"%2$@ (%3$@),\" memory card %4$i must be compressed. Compressing memory cards will make deleted blocks unrecoverable.\n\nDo you want to continue?"; +//"Memory card %i does not have enough free consecutive blocks.\n\nIn order to copy over \"%@,\" memory card %i must be compressed. Compressing memory cards will make deleted blocks unrecoverable.\n\nDo you want to continue?" = "Memory card %1$i does not have enough free consecutive blocks.\n\nIn order to copy over “%2$@,” memory card %3$i must be compressed. Compressing memory cards will make deleted blocks unrecoverable.\n\nDo you want to continue?"; //Cheat manager //"Save Cheats" = "Save Cheats"; diff --git a/macosx/Resources/hu.lproj/Localizable.strings b/macosx/Resources/hu.lproj/Localizable.strings index e88aa559..77f7bba9 100644 --- a/macosx/Resources/hu.lproj/Localizable.strings +++ b/macosx/Resources/hu.lproj/Localizable.strings @@ -1,4 +1,4 @@ -/* +/* Localizable.strings Pcsx @@ -89,7 +89,7 @@ //"Deleting a block will remove all saved data on that block.\n\nThis cannot be undone." = "Deleting a memory card object will set the blocks to not be readable by the emulator, and may result in the data being overwritten in the future."; "No Free Space" = "Nincs szabad hely a memória kártyán"; //"Memory card %d doesn't have %d free consecutive blocks on it. Please remove some blocks on that card to continue" = "Memory card %1$d doesn't have %2$d free consecutive blocks on it. Please remove some blocks on that card to continue."; -//"Memory card %i does not have enough free consecutive blocks.\n\nIn order to copy over \"%@ (%@),\" memory card %i must be compressed. Compressing memory cards will make deleted blocks unrecoverable.\n\nDo you want to continue?" = "Memory card %1$i does not have enough free consecutive blocks.\n\nIn order to copy over \"%2$@ (%3$@),\" memory card %4$i must be compressed. Compressing memory cards will make deleted blocks unrecoverable.\n\nDo you want to continue?"; +//"Memory card %i does not have enough free consecutive blocks.\n\nIn order to copy over \"%@,\" memory card %i must be compressed. Compressing memory cards will make deleted blocks unrecoverable.\n\nDo you want to continue?" = "Memory card %1$i does not have enough free consecutive blocks.\n\nIn order to copy over “%2$@,” memory card %3$i must be compressed. Compressing memory cards will make deleted blocks unrecoverable.\n\nDo you want to continue?"; //Cheat manager //"Save Cheats" = "Save Cheats"; diff --git a/macosx/Resources/zh-Hans.lproj/Localizable.strings b/macosx/Resources/zh-Hans.lproj/Localizable.strings index beea96da..871ef102 100644 --- a/macosx/Resources/zh-Hans.lproj/Localizable.strings +++ b/macosx/Resources/zh-Hans.lproj/Localizable.strings @@ -89,7 +89,7 @@ "Deleting a block will remove all saved data on that block.\n\nThis cannot be undone." = "删除后在模拟器里将不能呢个读取这个存档."; "No Free Space" = "没有可用空间"; "Memory card %d doesn't have %d free consecutive blocks on it. Please remove some blocks on that card to continue" = "记忆卡 %1$d 没有 %2$d 个可用存储位置.请移除一些存档."; -"Memory card %i does not have enough free consecutive blocks.\n\nIn order to copy over \"%@ (%@),\" memory card %i must be compressed. Compressing memory cards will make deleted blocks unrecoverable.\n\nDo you want to continue?" = "记忆卡 %1$i 没有足够的空间.\n\nIn 复制结束 “%2$@ (%3$@),” 记忆卡 %4$i 必须压缩. 压缩记忆卡将删除存档且不可回复.\n\n要继续吗?"; +"Memory card %i does not have enough free consecutive blocks.\n\nIn order to copy over \"%@,\" memory card %i must be compressed. Compressing memory cards will make deleted blocks unrecoverable.\n\nDo you want to continue?" = "记忆卡 %1$i 没有足够的空间.\n\nIn 复制结束 “%2$@,” 记忆卡 %3$i 必须压缩. 压缩记忆卡将删除存档且不可回复.\n\n要继续吗?"; //Cheat manager "Save Cheats" = "存储金手指"; diff --git a/macosx/Source/PcsxrDiscHandler.m b/macosx/Source/PcsxrDiscHandler.m index 996fdab3..f93f91d4 100644 --- a/macosx/Source/PcsxrDiscHandler.m +++ b/macosx/Source/PcsxrDiscHandler.m @@ -46,7 +46,7 @@ - (BOOL)handleFile:(NSString *)theFile { self.discPath = theFile; - PcsxrController *appDelegate = [NSApp delegate]; + PcsxrController *appDelegate = [(NSApplication*)NSApp delegate]; if ([EmuThread active] == YES && !UsingIso()) { return NO; } diff --git a/macosx/Source/PcsxrMemCardController.m b/macosx/Source/PcsxrMemCardController.m index 7dbc271a..1adf505b 100644 --- a/macosx/Source/PcsxrMemCardController.m +++ b/macosx/Source/PcsxrMemCardController.m @@ -121,7 +121,7 @@ availBlocks = [toCard availableBlocks]; if (freeConsBlocks == -1 && availBlocks >= cardSize) { PcsxrMemoryObject *tmpmemobj = (fromCard.memoryArray)[selectedIndex]; - NSInteger copyOK = NSRunInformationalAlertPanel(NSLocalizedString(@"Free Size", nil), NSLocalizedString(@"Memory card %i does not have enough free consecutive blocks.\n\nIn order to copy over \"%@ (%@),\" memory card %i must be compressed. Compressing memory cards will make deleted blocks unrecoverable.\n\nDo you want to continue?", nil), NSLocalizedString(@"Yes", nil), NSLocalizedString(@"No", nil), nil, cardnum, tmpmemobj.englishName, tmpmemobj.sjisName, cardnum); + NSInteger copyOK = NSRunInformationalAlertPanel(NSLocalizedString(@"Free Size", nil), NSLocalizedString(@"Memory card %i does not have enough free consecutive blocks.\n\nIn order to copy over \"%@,\" memory card %i must be compressed. Compressing memory cards will make deleted blocks unrecoverable.\n\nDo you want to continue?", nil), NSLocalizedString(@"Yes", nil), NSLocalizedString(@"No", nil), nil, cardnum, tmpmemobj.name, cardnum); if (copyOK != NSAlertDefaultReturn) { return; } diff --git a/macosx/Source/PcsxrMemoryObject.h b/macosx/Source/PcsxrMemoryObject.h index 39b44be5..80f63f57 100644 --- a/macosx/Source/PcsxrMemoryObject.h +++ b/macosx/Source/PcsxrMemoryObject.h @@ -28,8 +28,7 @@ typedef NS_ENUM(char, PCSXRMemFlags) { - (NSImage*)memoryImageAtIndex:(NSInteger)idx; -@property (readonly, strong) NSString *englishName; -@property (readonly, strong) NSString *sjisName; +@property (readonly, strong) NSString *name; @property (readonly, strong) NSString *memName; @property (readonly, strong) NSString *memID; @property (readonly, strong) NSArray *memoryCardImages; diff --git a/macosx/Source/PcsxrMemoryObject.m b/macosx/Source/PcsxrMemoryObject.m index 4f564b86..87d6f2fd 100644 --- a/macosx/Source/PcsxrMemoryObject.m +++ b/macosx/Source/PcsxrMemoryObject.m @@ -10,8 +10,7 @@ #import "PcsxrMemoryObject.h" @interface PcsxrMemoryObject () -@property (readwrite, strong) NSString *englishName; -@property (readwrite, strong) NSString *sjisName; +@property (readwrite, strong) NSString *name; @property (readwrite, strong) NSString *memName; @property (readwrite, strong) NSString *memID; @property (readwrite) uint8_t startingIndex; @@ -152,22 +151,11 @@ static NSString *MemLabelEndLink; if (self.flagNameIndex == memFlagFree) { self.memoryCardImages = @[]; self.hasImages = NO; - self.englishName = self.sjisName = @"Free block"; + self.name = @"Free block"; self.memID = self.memName = @""; } else { - self.englishName = @(infoBlock->Title); - self.sjisName = [NSString stringWithCString:infoBlock->sTitle encoding:NSShiftJISStringEncoding]; - - if ([englishName isEqualToString:sjisName]) { -#if 0 - if (![englishName isEqualToString:@""]) - NSLog(@"English name and sjis name are the same: %@. Replacing the sjis string with the English string.", englishName); -#endif - self.sjisName = self.englishName; - } - @autoreleasepool { - self.memoryCardImages = [PcsxrMemoryObject imagesFromMcd:infoBlock]; - } + self.name = [NSString stringWithCString:infoBlock->sTitle encoding:NSShiftJISStringEncoding]; + self.memoryCardImages = [PcsxrMemoryObject imagesFromMcd:infoBlock]; if ([memImages count] == 0) { self.hasImages = NO; @@ -182,8 +170,7 @@ static NSString *MemLabelEndLink; } #pragma mark - Property Synthesizers -@synthesize englishName; -@synthesize sjisName; +@synthesize name; @synthesize memName; @synthesize memID; @synthesize memoryCardImages = memImages; @@ -331,7 +318,7 @@ static inline void SetupAttrStr(NSMutableAttributedString *mutStr, NSColor *txtc - (NSString *)description { - return [NSString stringWithFormat:@"%@ (%@): Name: %@ ID: %@, type: %@ start: %i size: %i", englishName, sjisName, memName, memID, self.flagName, startingIndex, blockSize]; + return [NSString stringWithFormat:@"%@: Name: %@ ID: %@, type: %@ start: %i size: %i", name, memName, memID, self.flagName, startingIndex, blockSize]; } @end