From ce0bde25cb5388aeb33e57883e7da89473086417 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Mon, 14 Jun 2010 21:20:40 +0000 Subject: - Convert connection encoding menus to be menu tag based to fix localisation errors - Add database encoding retrieval support for MySQL 4.1 - Convert the add table and add database sheets to use encoding menus derived from server supported encodings - Re-layout preferences with larger labels to aid localisation - Fix preference resizing in non-Favorite tabs --- Source/SPPreferenceController.m | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'Source/SPPreferenceController.m') diff --git a/Source/SPPreferenceController.m b/Source/SPPreferenceController.m index 2a621325..bbf5c434 100644 --- a/Source/SPPreferenceController.m +++ b/Source/SPPreferenceController.m @@ -309,6 +309,34 @@ [prefs removeObjectForKey:@"SUSendProfileInfo"]; } + // For versions prior to 2325 (<0.9.9), convert the old encoding pref string into the new localizable constant + if (recordedVersionNumber < 2325 && [prefs objectForKey:@"DefaultEncoding"] && [[prefs objectForKey:@"DefaultEncoding"] isKindOfClass:[NSString class]]) { + NSDictionary *encodingMap = [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithInt:SPEncodingAutodetect], @"Autodetect", + [NSNumber numberWithInt:SPEncodingUCS2], @"UCS-2 Unicode (ucs2)", + [NSNumber numberWithInt:SPEncodingUTF8], @"UTF-8 Unicode (utf8)", + [NSNumber numberWithInt:SPEncodingUTF8viaLatin1], @"UTF-8 Unicode via Latin 1", + [NSNumber numberWithInt:SPEncodingASCII], @"US ASCII (ascii)", + [NSNumber numberWithInt:SPEncodingLatin1], @"ISO Latin 1 (latin1)", + [NSNumber numberWithInt:SPEncodingMacRoman], @"Mac Roman (macroman)", + [NSNumber numberWithInt:SPEncodingCP1250Latin2], @"Windows Latin 2 (cp1250)", + [NSNumber numberWithInt:SPEncodingISOLatin2], @"ISO Latin 2 (latin2)", + [NSNumber numberWithInt:SPEncodingCP1256Arabic], @"Windows Arabic (cp1256)", + [NSNumber numberWithInt:SPEncodingGreek], @"ISO Greek (greek)", + [NSNumber numberWithInt:SPEncodingHebrew], @"ISO Hebrew (hebrew)", + [NSNumber numberWithInt:SPEncodingLatin5Turkish], @"ISO Turkish (latin5)", + [NSNumber numberWithInt:SPEncodingCP1257WinBaltic], @"Windows Baltic (cp1257)", + [NSNumber numberWithInt:SPEncodingCP1251WinCyrillic], @"Windows Cyrillic (cp1251)", + [NSNumber numberWithInt:SPEncodingBig5Chinese], @"Big5 Traditional Chinese (big5)", + [NSNumber numberWithInt:SPEncodingShiftJISJapanese], @"Shift-JIS Japanese (sjis)", + [NSNumber numberWithInt:SPEncodingEUCJPJapanese], @"EUC-JP Japanese (ujis)", + [NSNumber numberWithInt:SPEncodingEUCKRKorean], @"EUC-KR Korean (euckr)", + nil]; + NSNumber *newMappedValue = [encodingMap valueForKey:[prefs objectForKey:@"DefaultEncoding"]]; + if (newMappedValue == nil) newMappedValue = [NSNumber numberWithInt:0]; + [prefs setObject:newMappedValue forKey:@"DefaultEncodingTag"]; + } + // Update the prefs revision [prefs setObject:[NSNumber numberWithInteger:currentVersionNumber] forKey:SPLastUsedVersion]; } @@ -989,6 +1017,19 @@ [preferencesWindow endEditingFor:[preferencesWindow firstResponder]]; } +// ------------------------------------------------------------------------------- +// windowWillResize:toSize: +// Trap window resize notifications and use them to disable resizing on most tabs +// - except for the favourites tab. +// ------------------------------------------------------------------------------- +- (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)frameSize +{ + if ([sender showsResizeIndicator]) + return frameSize; + else + return [sender frame].size; +} + #pragma mark - #pragma mark Other -- cgit v1.2.3