aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPPreferenceController.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-06-14 21:20:40 +0000
committerrowanbeentje <rowan@beent.je>2010-06-14 21:20:40 +0000
commitce0bde25cb5388aeb33e57883e7da89473086417 (patch)
treea2c91ca879e15a8f809361a5a5d1a18ee4e603de /Source/SPPreferenceController.m
parent6e1a24c45eb99a9c9f8e1cb708b64bdc504d5efe (diff)
downloadsequelpro-ce0bde25cb5388aeb33e57883e7da89473086417.tar.gz
sequelpro-ce0bde25cb5388aeb33e57883e7da89473086417.tar.bz2
sequelpro-ce0bde25cb5388aeb33e57883e7da89473086417.zip
- 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
Diffstat (limited to 'Source/SPPreferenceController.m')
-rw-r--r--Source/SPPreferenceController.m41
1 files changed, 41 insertions, 0 deletions
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