From 54ed811d6071cc843a9d2699d3ca972af9ca4c5d Mon Sep 17 00:00:00 2001 From: Bibiko Date: Sat, 22 Aug 2009 13:26:08 +0000 Subject: =?UTF-8?q?=E2=80=A2=20outsourced=20SPEncodingPopupAccessory=20-?= =?UTF-8?q?=20added=20SPEncodingPopupAccessory=20class=20and=20nib=20-=20i?= =?UTF-8?q?t=20returns=20an=20accessory=20view=20containing=20a=20popup=20?= =?UTF-8?q?menu=20with=20predefined=20encodings=20-=20removed=20that=20vie?= =?UTF-8?q?w=20from=20DBView?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Interfaces/English.lproj/DBView.xib | 227 +------------------------ Interfaces/English.lproj/EncodingPopupView.xib | 46 ++++- Source/SPAppController.h | 2 + Source/SPAppController.m | 50 +++++- Source/SPEncodingPopupAccessory.h | 41 +++++ Source/SPEncodingPopupAccessory.m | 118 +++++++++++++ Source/TableDocument.h | 4 - Source/TableDocument.m | 87 +--------- sequel-pro.xcodeproj/project.pbxproj | 6 + 9 files changed, 268 insertions(+), 313 deletions(-) create mode 100644 Source/SPEncodingPopupAccessory.h create mode 100644 Source/SPEncodingPopupAccessory.m diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib index 38e8b39d..cea60e1f 100644 --- a/Interfaces/English.lproj/DBView.xib +++ b/Interfaces/English.lproj/DBView.xib @@ -8,7 +8,6 @@ 353.00 YES - YES @@ -47,7 +46,7 @@ {3.40282e+38, 3.40282e+38} {780, 480} - + 256 YES @@ -186,7 +185,6 @@ {212, 26} - 6 @@ -222,7 +220,6 @@ {212, 26} - 0 @@ -337,7 +334,6 @@ {212, 354} - 6 @@ -369,7 +365,6 @@ {212, 354} - 528 @@ -494,7 +489,6 @@ {212, 145} - 6 @@ -521,7 +515,6 @@ {212, 145} - 512 @@ -2128,7 +2121,6 @@ {{1, 17}, {688, 455}} - 2 @@ -2162,7 +2154,6 @@ {{1, 0}, {688, 17}} - 4 @@ -2171,7 +2162,6 @@ {{6, 32}, {690, 473}} - 562 @@ -2242,8 +2232,8 @@ YES YES - . - , + , + . NO YES NO @@ -3238,7 +3228,7 @@ -2042609409 35 - + NSImage button_action @@ -3253,10 +3243,7 @@ 1048576 2147483647 - - NSImage - button_action - + _popUpItemAction: @@ -4690,7 +4677,6 @@ {944, 550} - {{0, 0}, {1920, 1178}} {780, 502} @@ -11296,98 +11282,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {269, 32} NSView - - - 268 - - YES - - - 268 - {{6, 10}, {180, 14}} - - YES - - 68288064 - 272761856 - File Encoding: - - - - - - - - - 268 - {{84, 5}, {180, 22}} - - YES - - -1539178944 - 133120 - - - 109199615 - 129 - - - 400 - 75 - - - Item 1 - - 1048576 - 2147483647 - 1 - - - _popUpItemAction: - - - YES - - OtherViews - - YES - - - - Item 2 - - 1048576 - 2147483647 - - - _popUpItemAction: - 1 - - - - - Item 3 - - 1048576 - 2147483647 - - - _popUpItemAction: - 2 - - - - - 1 - YES - YES - 2 - - - - {271, 34} - NSView - 265 @@ -15036,22 +14930,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 6323 - - - encodingAccessoryView - - - - 6331 - - - - encodingPopUp - - - - 6338 - copy: @@ -21205,75 +21083,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 - - 6325 - - - YES - - - - - Encoding Accessory - - - 6328 - - - YES - - - - - - 6329 - - - - - 6332 - - - YES - - - - - - 6333 - - - YES - - - - - - 6334 - - - YES - - - - - - - - 6335 - - - - - 6336 - - - - - 6337 - - - 6340 @@ -22618,17 +22427,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 6305.IBPluginDependency 6317.IBPluginDependency 6318.IBPluginDependency - 6325.IBEditorWindowLastContentRect - 6325.IBPluginDependency - 6328.IBPluginDependency - 6329.IBPluginDependency - 6332.IBPluginDependency - 6333.IBPluginDependency - 6334.IBEditorWindowLastContentRect - 6334.IBPluginDependency - 6335.IBPluginDependency - 6336.IBPluginDependency - 6337.IBPluginDependency 6340.IBPluginDependency 6341.IBPluginDependency 6343.IBPluginDependency @@ -23677,9 +23475,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{280, 178}, {944, 550}} + {{78, 178}, {944, 550}} - {{280, 178}, {944, 550}} + {{78, 178}, {944, 550}} {{62, 352}, {845, 504}} @@ -24436,17 +24234,6 @@ aGUgYWN0aXZlIHNlbGVjdGlvbiAo4oyl4oyYUik com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{736, 891}, {271, 34}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{769, 837}, {180, 54}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin diff --git a/Interfaces/English.lproj/EncodingPopupView.xib b/Interfaces/English.lproj/EncodingPopupView.xib index b7265b31..4effe3f9 100644 --- a/Interfaces/English.lproj/EncodingPopupView.xib +++ b/Interfaces/English.lproj/EncodingPopupView.xib @@ -26,7 +26,7 @@ YES - NSObject + SPEncodingPopupAccessory FirstResponder @@ -157,6 +157,22 @@ YES + + + encodingPopUp + + + + 10 + + + + encodingAccessoryView + + + + 11 + @@ -315,9 +331,33 @@ - 9 + 11 + + + + YES + + SPEncodingPopupAccessory + + YES + + YES + encodingAccessoryView + encodingPopUp + + + YES + id + id + + + + IBUserSource + + + + - 0 3 diff --git a/Source/SPAppController.h b/Source/SPAppController.h index d328d353..6a5f9b6a 100644 --- a/Source/SPAppController.h +++ b/Source/SPAppController.h @@ -32,6 +32,8 @@ BOOL isNewFavorite; SPPreferenceController *prefsController; + + id encodingPopUp; } // IBAction methods diff --git a/Source/SPAppController.m b/Source/SPAppController.m index 2dba0c68..97029a68 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -27,6 +27,7 @@ #import "SPAppController.h" #import "TableDocument.h" #import "SPPreferenceController.h" +#import "SPEncodingPopupAccessory.h" #import @@ -47,6 +48,23 @@ return self; } + +- (void)panelSelectionDidChange:(id)sender +{ + + if([sender isKindOfClass:[NSOpenPanel class]]) { + if([[[[sender filename] pathExtension] lowercaseString] isEqualToString:@"sql"]) { + [encodingPopUp setEnabled:YES]; + [sender setAllowsMultipleSelection:NO]; + } else { + [encodingPopUp setEnabled:NO]; + [sender setAllowsMultipleSelection:YES]; + } + } + +} + + - (IBAction)openConnectionSheet:(id)sender { NSOpenPanel *panel = [NSOpenPanel openPanel]; @@ -55,18 +73,21 @@ [panel setCanChooseDirectories:NO]; [panel setAllowsMultipleSelection:YES]; [panel setResolvesAliases:YES]; - // [panel setAccessoryView:encodingAccessoryView]; - // Set up encoding list - // [encodingPopUp setEnabled:NO]; - + // // Set up encoding list + // If no lastSqlFileEncoding in prefs set it to UTF-8 if(![[NSUserDefaults standardUserDefaults] integerForKey:@"lastSqlFileEncoding"]) { [[NSUserDefaults standardUserDefaults] setInteger:4 forKey:@"lastSqlFileEncoding"]; [[NSUserDefaults standardUserDefaults] synchronize]; } - // [self setupPopUp:encodingPopUp selectedEncoding:[prefs integerForKey:@"lastSqlFileEncoding"] withDefaultEntry:NO]; + [panel setAccessoryView:[SPEncodingPopupAccessory encodingAccessory:[[NSUserDefaults standardUserDefaults] integerForKey:@"lastSqlFileEncoding"] + includeDefaultEntry:NO encodingPopUp:&encodingPopUp]]; + + [encodingPopUp setEnabled:NO]; + + // [self setupPopUp:encodingPopUp selectedEncoding:[[NSUserDefaults standardUserDefaults] integerForKey:@"lastSqlFileEncoding"] withDefaultEntry:NO]; int returnCode = [panel runModalForDirectory:nil file:nil types:[NSArray arrayWithObjects:@"spf", @"sql", nil]]; if( returnCode ) @@ -86,6 +107,11 @@ // Opens a sql file and insert its content into the Custom Query editor if([[[filename pathExtension] lowercaseString] isEqualToString:@"sql"]) { + // if encodingPopUp is defined the filename comes from an openPanel and + // the encodingPopUp contains the chosen encoding; otherwise autodetect encoding + if(encodingPopUp) + [[NSUserDefaults standardUserDefaults] setInteger:[[encodingPopUp selectedItem] tag] forKey:@"lastSqlFileEncoding"]; + // Check if at least one document exists if (![[[NSDocumentController sharedDocumentController] documents] count]) { @@ -94,7 +120,19 @@ // Manually open a new document, setting SPAppController as sender to trigger autoconnection if (firstTableDocument = [[NSDocumentController sharedDocumentController] makeUntitledDocumentOfType:@"DocumentType" error:nil]) { [firstTableDocument setShouldAutomaticallyConnect:NO]; - [firstTableDocument initQueryEditorWithString:[self contentOfFile:filename]]; + if(encodingPopUp) { + NSError *error = nil; + NSString *content = [NSString stringWithContentsOfFile:filename encoding:[[encodingPopUp selectedItem] tag] error:&error]; + if(error != nil) { + NSAlert *errorAlert = [NSAlert alertWithError:error]; + [errorAlert runModal]; + return; + } + [firstTableDocument initQueryEditorWithString:content]; + + } + else + [firstTableDocument initQueryEditorWithString:[self contentOfFile:filename]]; [[NSDocumentController sharedDocumentController] addDocument:firstTableDocument]; [firstTableDocument makeWindowControllers]; [firstTableDocument showWindows]; diff --git a/Source/SPEncodingPopupAccessory.h b/Source/SPEncodingPopupAccessory.h new file mode 100644 index 00000000..7f594095 --- /dev/null +++ b/Source/SPEncodingPopupAccessory.h @@ -0,0 +1,41 @@ +// +// $Id$ +// +// SPEncodingPopupAccessory.h +// sequel-pro +// +// Created by Hans-Jörg Bibiko on August 22, 2009 +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// More info at + +#import + +enum { + NoStringEncoding = 0xFFFFFFFF +}; + +@interface SPEncodingPopupAccessory : NSObject { +@public + IBOutlet NSPopUpButton *encodingPopUp; + IBOutlet NSView *encodingAccessoryView; +} + ++ (NSArray *)enabledEncodings; ++ (NSView *)encodingAccessory:(NSUInteger)encoding includeDefaultEntry:(BOOL)includeDefaultItem encodingPopUp:(NSPopUpButton **)popup; ++ (void)setupPopUp:(NSPopUpButton *)popup selectedEncoding:(NSUInteger)selectedEncoding withDefaultEntry:(BOOL)includeDefaultItem; + +@end diff --git a/Source/SPEncodingPopupAccessory.m b/Source/SPEncodingPopupAccessory.m new file mode 100644 index 00000000..c5b30630 --- /dev/null +++ b/Source/SPEncodingPopupAccessory.m @@ -0,0 +1,118 @@ +// +// $Id$ +// +// SPEncodingPopupAccessory.m +// sequel-pro +// +// Created by Hans-Jörg Bibiko on August 22, 2009 +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// More info at + +#import "SPEncodingPopupAccessory.h" + + +@implementation SPEncodingPopupAccessory + ++ (NSView *)encodingAccessory:(NSUInteger)encoding includeDefaultEntry:(BOOL)includeDefaultItem encodingPopUp:(NSPopUpButton **)popup { + SPEncodingPopupAccessory *owner = [[[SPEncodingPopupAccessory alloc] init] autorelease]; + // Rather than caching, load the accessory view everytime, as it might appear in multiple panels simultaneously. + if (![NSBundle loadNibNamed:@"EncodingPopupView" owner:owner]) { + NSLog(@"Failed to load EncodingPopupView.nib"); + return nil; + } + if (popup) *popup = owner->encodingPopUp; + [[self class] setupPopUp:owner->encodingPopUp selectedEncoding:encoding withDefaultEntry:includeDefaultItem]; + return [owner->encodingAccessoryView autorelease]; +} + +/** + * Returns the actual enabled list of encodings for open/save SQL files. + */ ++ (NSArray *)enabledEncodings +{ + static const NSInteger plainTextFileStringEncodingsSupported[] = { + kCFStringEncodingUTF8, + kCFStringEncodingUTF16, + kCFStringEncodingUTF16BE, + kCFStringEncodingUTF16LE, + kCFStringEncodingUTF32, + kCFStringEncodingWindowsLatin1, + kCFStringEncodingISOLatin1, + kCFStringEncodingWindowsLatin2, + kCFStringEncodingISOLatin2, + kCFStringEncodingISOLatin3, + kCFStringEncodingISOLatin4, + kCFStringEncodingWindowsLatin5, + kCFStringEncodingKOI8_R, + kCFStringEncodingKOI8_U, + kCFStringEncodingMacRoman, + kCFStringEncodingMacJapanese, + kCFStringEncodingShiftJIS, + kCFStringEncodingEUC_JP, + kCFStringEncodingISO_2022_JP, + kCFStringEncodingMacChineseTrad, + kCFStringEncodingMacChineseSimp, + kCFStringEncodingBig5, + kCFStringEncodingGB_18030_2000, + kCFStringEncodingEUC_CN, + kCFStringEncodingEUC_TW, + kCFStringEncodingMacKorean, + kCFStringEncodingEUC_KR, + -1 + }; + NSStringEncoding encoding; + NSInteger cnt = 0; + NSMutableArray *encs = [NSMutableArray array]; + while (plainTextFileStringEncodingsSupported[cnt] != -1) + if ((encoding = CFStringConvertEncodingToNSStringEncoding(plainTextFileStringEncodingsSupported[cnt++])) != kCFStringEncodingInvalidId) + [encs addObject:[NSNumber numberWithUnsignedInteger:encoding]]; + + return encs; +} + +/** + * This method initializes the provided popup with list of encodings; + * it also sets up the selected encoding as indicated and if includeDefaultItem is YES. + * Otherwise the tags are set to the NSStringEncoding value for the encoding. + */ ++ (void)setupPopUp:(NSPopUpButton *)popup selectedEncoding:(NSUInteger)selectedEncoding withDefaultEntry:(BOOL)includeDefaultItem +{ + NSArray *encs = [self enabledEncodings]; + NSUInteger cnt, numEncodings, itemToSelect = 0; + + // Put the encodings in the popup + [popup removeAllItems]; + + // Make sure the initial selected encoding appears in the list + if (!includeDefaultItem && (selectedEncoding != NoStringEncoding) && ![encs containsObject:[NSNumber numberWithUnsignedInteger:selectedEncoding]]) encs = [encs arrayByAddingObject:[NSNumber numberWithUnsignedInteger:selectedEncoding]]; + + numEncodings = [encs count]; + + // Fill with encodings + for (cnt = 0; cnt < numEncodings; cnt++) { + NSStringEncoding enc = [[encs objectAtIndex:cnt] unsignedIntegerValue]; + [popup addItemWithTitle:[NSString localizedNameOfStringEncoding:enc]]; + [[popup lastItem] setTag:enc]; + [[popup lastItem] setEnabled:YES]; + if (enc == selectedEncoding) itemToSelect = [popup numberOfItems] - 1; + } + + [popup selectItemAtIndex:itemToSelect]; +} + + +@end diff --git a/Source/TableDocument.h b/Source/TableDocument.h index 22c836db..6f36ea83 100644 --- a/Source/TableDocument.h +++ b/Source/TableDocument.h @@ -29,10 +29,6 @@ #import #import -enum { - NoStringEncoding = 0xFFFFFFFF -}; - @class SPConnectionController, SPUserManager; diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 70d4089f..cd5967cb 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -49,6 +49,7 @@ #import "SPPrintAccessory.h" #import "QLPreviewPanel.h" #import "SPUserManager.h" +#import "SPEncodingPopupAccessory.h" // Used for printing #import "MGTemplateEngine.h" @@ -1586,82 +1587,6 @@ #pragma mark - #pragma mark Menu methods -/** - * Returns the actual enabled list of encodings for open/save SQL files. - */ -- (NSArray *)enabledEncodings -{ - static const NSInteger plainTextFileStringEncodingsSupported[] = { - kCFStringEncodingUTF8, - kCFStringEncodingUTF16, - kCFStringEncodingUTF16BE, - kCFStringEncodingUTF16LE, - kCFStringEncodingUTF32, - kCFStringEncodingWindowsLatin1, - kCFStringEncodingISOLatin1, - kCFStringEncodingWindowsLatin2, - kCFStringEncodingISOLatin2, - kCFStringEncodingISOLatin3, - kCFStringEncodingISOLatin4, - kCFStringEncodingWindowsLatin5, - kCFStringEncodingKOI8_R, - kCFStringEncodingKOI8_U, - kCFStringEncodingMacRoman, - kCFStringEncodingMacJapanese, - kCFStringEncodingShiftJIS, - kCFStringEncodingEUC_JP, - kCFStringEncodingISO_2022_JP, - kCFStringEncodingMacChineseTrad, - kCFStringEncodingMacChineseSimp, - kCFStringEncodingBig5, - kCFStringEncodingGB_18030_2000, - kCFStringEncodingEUC_CN, - kCFStringEncodingEUC_TW, - kCFStringEncodingMacKorean, - kCFStringEncodingEUC_KR, - -1 - }; - NSStringEncoding encoding; - NSInteger cnt = 0; - NSMutableArray *encs = [NSMutableArray array]; - while (plainTextFileStringEncodingsSupported[cnt] != -1) - if ((encoding = CFStringConvertEncodingToNSStringEncoding(plainTextFileStringEncodingsSupported[cnt++])) != kCFStringEncodingInvalidId) - [encs addObject:[NSNumber numberWithUnsignedInteger:encoding]]; - - return encs; -} - -/** - * This method initializes the provided popup with list of encodings; - * it also sets up the selected encoding as indicated and if includeDefaultItem is YES. - * Otherwise the tags are set to the NSStringEncoding value for the encoding. - */ -- (void)setupPopUp:(NSPopUpButton *)popup selectedEncoding:(NSUInteger)selectedEncoding withDefaultEntry:(BOOL)includeDefaultItem -{ - NSArray *encs = [self enabledEncodings]; - NSUInteger cnt, numEncodings, itemToSelect = 0; - - // Put the encodings in the popup - [popup removeAllItems]; - - // Make sure the initial selected encoding appears in the list - if (!includeDefaultItem && (selectedEncoding != NoStringEncoding) && ![encs containsObject:[NSNumber numberWithUnsignedInteger:selectedEncoding]]) encs = [encs arrayByAddingObject:[NSNumber numberWithUnsignedInteger:selectedEncoding]]; - - numEncodings = [encs count]; - - // Fill with encodings - for (cnt = 0; cnt < numEncodings; cnt++) { - NSStringEncoding enc = [[encs objectAtIndex:cnt] unsignedIntegerValue]; - [popup addItemWithTitle:[NSString localizedNameOfStringEncoding:enc]]; - [[popup lastItem] setTag:enc]; - [[popup lastItem] setEnabled:YES]; - if (enc == selectedEncoding) itemToSelect = [popup numberOfItems] - 1; - } - - [popup selectItemAtIndex:itemToSelect]; -} - - /** * Opens SP session file(s) or a SQL file */ @@ -1674,7 +1599,8 @@ [panel setCanChooseDirectories:NO]; [panel setAllowsMultipleSelection:YES]; [panel setResolvesAliases:YES]; - [panel setAccessoryView:encodingAccessoryView]; + [panel setAccessoryView:[SPEncodingPopupAccessory encodingAccessory:[prefs integerForKey:@"lastSqlFileEncoding"] + includeDefaultEntry:NO encodingPopUp:&encodingPopUp]]; // Set up encoding list [encodingPopUp setEnabled:NO]; @@ -1685,7 +1611,7 @@ [prefs synchronize]; } - [self setupPopUp:encodingPopUp selectedEncoding:[prefs integerForKey:@"lastSqlFileEncoding"] withDefaultEntry:NO]; + // [self setupPopUp:encodingPopUp selectedEncoding:[prefs integerForKey:@"lastSqlFileEncoding"] withDefaultEntry:NO]; [panel beginSheetForDirectory:nil file:@"" @@ -1791,7 +1717,8 @@ if( [sender tag] == 0 ) { // Save the editor's content as SQL file - [panel setAccessoryView:encodingAccessoryView]; + [panel setAccessoryView:[SPEncodingPopupAccessory encodingAccessory:[prefs integerForKey:@"lastSqlFileEncoding"] + includeDefaultEntry:NO encodingPopUp:&encodingPopUp]]; // [panel setMessage:NSLocalizedString(@"Save SQL file", @"Save SQL file")]; [panel setAllowedFileTypes:[NSArray arrayWithObjects:@"sql", nil]]; if(![prefs stringForKey:@"lastSqlFileName"]) { @@ -1810,7 +1737,7 @@ // Set up encoding list [encodingPopUp setEnabled:YES]; - [self setupPopUp:encodingPopUp selectedEncoding:[prefs integerForKey:@"lastSqlFileEncoding"] withDefaultEntry:NO]; + // [self setupPopUp:encodingPopUp selectedEncoding:[prefs integerForKey:@"lastSqlFileEncoding"] withDefaultEntry:NO]; } else if([sender tag] == 1){ diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index c3752b27..c776e45b 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -214,6 +214,7 @@ B5E92F400F75B32100012500 /* toolbar-export-xml.tiff in Resources */ = {isa = PBXBuildFile; fileRef = B5E92F3A0F75B32100012500 /* toolbar-export-xml.tiff */; }; B5EAC0FD0EC87FF900CC579C /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5EAC0FC0EC87FF900CC579C /* Security.framework */; }; B5F4F7810F7BCF990059AE84 /* toolbar-switch-to-procedures.tiff in Resources */ = {isa = PBXBuildFile; fileRef = B5F4F7800F7BCF990059AE84 /* toolbar-switch-to-procedures.tiff */; }; + BC01BCCF104024BE006BDEE7 /* SPEncodingPopupAccessory.m in Sources */ = {isa = PBXBuildFile; fileRef = BC01BCCE104024BE006BDEE7 /* SPEncodingPopupAccessory.m */; }; BC05F1C5101241DF008A97F8 /* AMIndeterminateProgressIndicatorCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BC05F1C4101241DF008A97F8 /* AMIndeterminateProgressIndicatorCell.m */; }; BC1847EA0FE6EC8400094BFB /* SPEditSheetTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1847E90FE6EC8400094BFB /* SPEditSheetTextView.m */; }; BC1E55C4100DC92200AAE9F0 /* table-view-small-square.tiff in Resources */ = {isa = PBXBuildFile; fileRef = BC1E55C3100DC92200AAE9F0 /* table-view-small-square.tiff */; }; @@ -585,6 +586,8 @@ B5E92F3A0F75B32100012500 /* toolbar-export-xml.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "toolbar-export-xml.tiff"; sourceTree = ""; }; B5EAC0FC0EC87FF900CC579C /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; B5F4F7800F7BCF990059AE84 /* toolbar-switch-to-procedures.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "toolbar-switch-to-procedures.tiff"; sourceTree = ""; }; + BC01BCCD104024BE006BDEE7 /* SPEncodingPopupAccessory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPEncodingPopupAccessory.h; sourceTree = ""; }; + BC01BCCE104024BE006BDEE7 /* SPEncodingPopupAccessory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPEncodingPopupAccessory.m; sourceTree = ""; }; BC05F1C3101241DF008A97F8 /* AMIndeterminateProgressIndicatorCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AMIndeterminateProgressIndicatorCell.h; sourceTree = ""; }; BC05F1C4101241DF008A97F8 /* AMIndeterminateProgressIndicatorCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AMIndeterminateProgressIndicatorCell.m; sourceTree = ""; }; BC1847E80FE6EC8400094BFB /* SPEditSheetTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPEditSheetTextView.h; sourceTree = ""; }; @@ -930,6 +933,8 @@ 17E641530EF01EF6001BC333 /* TableDump.m */, 17E641540EF01EF6001BC333 /* TableSource.h */, 17E641550EF01EF6001BC333 /* TableSource.m */, + BC01BCCD104024BE006BDEE7 /* SPEncodingPopupAccessory.h */, + BC01BCCE104024BE006BDEE7 /* SPEncodingPopupAccessory.m */, ); name = Controllers; sourceTree = ""; @@ -1647,6 +1652,7 @@ 589235321020C1230011DE00 /* SPHistoryController.m in Sources */, BCA6271C1031B9D40047E5D5 /* SPTooltip.m in Sources */, 58DA8863103E15B5000B98DF /* SPLogger.m in Sources */, + BC01BCCF104024BE006BDEE7 /* SPEncodingPopupAccessory.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; -- cgit v1.2.3