From f083576763c6c97b03943e335a6948411e7214ef Mon Sep 17 00:00:00 2001 From: Bibiko Date: Sat, 8 Aug 2009 11:00:00 +0000 Subject: =?UTF-8?q?=E2=80=A2=20added=20field=20name=20to=20Field=20Editor?= =?UTF-8?q?=20Sheet=20-=20initial=20support=20(not=20yet=20finished)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Note: maybe add information about field type, max length as attributed string --- Interfaces/English.lproj/FieldEditorSheet.xib | 192 +++++++++++++++++++++++--- Source/CustomQuery.m | 1 + Source/SPFieldEditorController.h | 5 +- Source/SPFieldEditorController.m | 3 +- Source/TableContent.m | 5 +- 5 files changed, 180 insertions(+), 26 deletions(-) diff --git a/Interfaces/English.lproj/FieldEditorSheet.xib b/Interfaces/English.lproj/FieldEditorSheet.xib index a1a1e864..c4192a3e 100644 --- a/Interfaces/English.lproj/FieldEditorSheet.xib +++ b/Interfaces/English.lproj/FieldEditorSheet.xib @@ -2,13 +2,12 @@ 1050 - 9J61 + 9L30 677 - 949.46 + 949.54 353.00 YES - YES @@ -37,7 +36,7 @@ 9 2 - {{364, 195}, {667, 416}} + {{364, 183}, {667, 428}} 544735232 Field Editor NSPanel @@ -53,8 +52,9 @@ 34 - {{0, 36}, {667, 5}} + {{0, 48}, {667, 5}} + {0, 0} 67239424 @@ -87,8 +87,9 @@ 257 - {{581, 7}, {66, 25}} + {{581, 10}, {66, 25}} + 1 YES @@ -118,8 +119,9 @@ 257 - {{507, 7}, {66, 25}} + {{507, 10}, {66, 25}} + YES 67239424 @@ -143,8 +145,9 @@ 256 - {{94, 7}, {66, 25}} + {{94, 10}, {66, 25}} + YES 67239424 @@ -164,8 +167,9 @@ 256 - {{20, 7}, {66, 25}} + {{20, 10}, {66, 25}} + YES 67239424 @@ -185,8 +189,9 @@ 292 - {{328, 7}, {48, 25}} + {{328, 10}, {48, 25}} + YES 71433792 @@ -323,7 +328,6 @@ - 7 YES 1 YES @@ -334,8 +338,9 @@ 292 - {{183, 10}, {137, 19}} + {{183, 13}, {137, 19}} + YES -2080244224 @@ -401,6 +406,7 @@ {667, 14} + @@ -440,7 +446,7 @@ 6 System selectedTextBackgroundColor - + 3 MC42NjY2NjY2OQA @@ -465,6 +471,7 @@ {667, 370} + @@ -479,6 +486,7 @@ -2147483392 {{220, 1}, {11, 141}} + 256 _doScroller: @@ -489,6 +497,7 @@ 256 {{-100, -100}, {87, 18}} + 257 _doScroller: @@ -496,8 +505,9 @@ 9.456522e-01 - {{0, 39}, {667, 370}} + {{0, 51}, {667, 370}} + 528 @@ -519,8 +529,9 @@ NeXT TIFF v4.0 pasteboard type - {{0, 39}, {667, 370}} + {{0, 51}, {667, 370}} + YES 270663168 @@ -570,6 +581,7 @@ {667, 14} + @@ -638,6 +650,7 @@ {667, 370} + @@ -649,6 +662,7 @@ -2147483392 {{639, 2}, {11, 359}} + 256 _doScroller: @@ -659,6 +673,7 @@ 256 {{-100, -100}, {87, 18}} + 257 _doScroller: @@ -666,8 +681,9 @@ 9.456522e-01 - {{0, 39}, {667, 370}} + {{0, 51}, {667, 370}} + 528 @@ -678,8 +694,9 @@ 1325 - {{325, 220}, {32, 32}} + {{325, 232}, {32, 32}} + 28682 1.600000e+01 1.000000e+02 @@ -687,8 +704,9 @@ 10 - {{0, 407}, {667, 5}} + {{0, 419}, {667, 5}} + {0, 0} 67239424 @@ -706,9 +724,41 @@ 0 NO + + + 257 + {{284, 36}, {362, 11}} + + + YES + + 67239488 + 1145309184 + Label + + LucidaGrande + 9.000000e+00 + 3614 + + + + 6 + System + controlColor + + + + 6 + System + controlTextColor + + + + - {667, 416} + {667, 428} + {{0, 0}, {1280, 778}} {3.40282e+38, 3.40282e+38} @@ -966,6 +1016,14 @@ 70 + + + editSheetFieldName + + + + 75 + @@ -1023,6 +1081,7 @@ + @@ -1263,6 +1322,20 @@ + + 73 + + + YES + + + + + + 74 + + + @@ -1331,6 +1404,8 @@ 7.CustomClassName 7.IBPluginDependency 7.ImportedFromIB2 + 73.IBPluginDependency + 74.IBPluginDependency 8.IBAttributePlaceholdersKey 8.IBPluginDependency 9.IBPluginDependency @@ -1342,8 +1417,8 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{795, 333}, {667, 416}} - {{795, 333}, {667, 416}} + {{263, 324}, {667, 428}} + {{263, 324}, {667, 428}} @@ -1366,7 +1441,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{1112, 192}, {126, 173}} + {{580, 195}, {126, 173}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1401,6 +1476,8 @@ CMImageView com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin ToolTip @@ -1435,7 +1512,7 @@ - 70 + 75 @@ -1624,6 +1701,75 @@ + + YES + + SPFieldEditorController + NSWindowController + + YES + + YES + closeEditSheet: + dropImage: + openEditSheet: + quickLookFormatButton: + saveEditSheet: + segmentControllerChanged: + + + YES + id + id + id + id + id + id + + + + YES + + YES + editImage + editSheet + editSheetCancelButton + editSheetFieldName + editSheetOkButton + editSheetOpenButton + editSheetProgressBar + editSheetQuickLookButton + editSheetSegmentControl + editTextScrollView + editTextView + hexTextScrollView + hexTextView + sheetEditData + + + YES + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + IBDocumentRelativeSource + ../../Source/SPFieldEditorController.h + + + 0 ../../sequel-pro.xcodeproj diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index 5f8c368a..7153e916 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -1724,6 +1724,7 @@ SPFieldEditorController *fieldEditor = [[SPFieldEditorController alloc] init]; id editData = [[fieldEditor editWithObject:[[fullResult objectAtIndex:rowIndex] objectAtIndex:[[aTableColumn identifier] intValue]] + fieldName:[columnDefinition objectForKey:@"name"] usingEncoding:[mySQLConnection encoding] isObjectBlob:isBlob isEditable:isFieldEditable diff --git a/Source/SPFieldEditorController.h b/Source/SPFieldEditorController.h index 56168620..76e8a86e 100644 --- a/Source/SPFieldEditorController.h +++ b/Source/SPFieldEditorController.h @@ -38,6 +38,7 @@ IBOutlet id editSheetCancelButton; IBOutlet id editSheetOkButton; IBOutlet id editSheetOpenButton; + IBOutlet id editSheetFieldName; id sheetEditData; BOOL editSheetWillBeInitialized; @@ -60,7 +61,9 @@ - (IBAction)quickLookFormatButton:(id)sender; - (IBAction)dropImage:(id)sender; -- (id)editWithObject:(id)data usingEncoding:(NSStringEncoding)anEncoding isObjectBlob:(BOOL)isFieldBlob isEditable:(BOOL)isEditable withWindow:(NSWindow *)tableWindow; + +- (id)editWithObject:(id)data fieldName:(NSString*)fieldName usingEncoding:(NSStringEncoding)anEncoding + isObjectBlob:(BOOL)isFieldBlob isEditable:(BOOL)isEditable withWindow:(NSWindow *)tableWindow; - (void)processPasteImageData; - (void)processUpdatedImageData:(NSData *)data; diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m index 32b817eb..7b05c5fa 100644 --- a/Source/SPFieldEditorController.m +++ b/Source/SPFieldEditorController.m @@ -51,7 +51,7 @@ [super dealloc]; } -- (id)editWithObject:(id)data usingEncoding:(NSStringEncoding)anEncoding +- (id)editWithObject:(id)data fieldName:(NSString*)fieldName usingEncoding:(NSStringEncoding)anEncoding isObjectBlob:(BOOL)isFieldBlob isEditable:(BOOL)isEditable withWindow:(NSWindow *)tableWindow { prefs = [NSUserDefaults standardUserDefaults]; @@ -63,6 +63,7 @@ } [hexTextView setFont:[NSFont fontWithName:@"Monaco" size:[NSFont smallSystemFontSize]]]; + [editSheetFieldName setStringValue:[NSString stringWithFormat:@"%@: %@", NSLocalizedString(@"Field", @"Field"), fieldName]]; // hide all views in editSheet [hexTextView setHidden:YES]; diff --git a/Source/TableContent.m b/Source/TableContent.m index 746d0638..c0d77959 100644 --- a/Source/TableContent.m +++ b/Source/TableContent.m @@ -2141,7 +2141,10 @@ SPFieldEditorController *fieldEditor = [[SPFieldEditorController alloc] init]; id editData = [[fieldEditor editWithObject:[[filteredResult objectAtIndex:rowIndex] objectAtIndex:[[aTableColumn identifier] intValue]] - usingEncoding:[mySQLConnection encoding] isObjectBlob:isBlob isEditable:YES withWindow:tableWindow] retain]; + fieldName:[[aTableColumn headerCell] stringValue] + usingEncoding:[mySQLConnection encoding] + isObjectBlob:isBlob + isEditable:YES withWindow:tableWindow] retain]; if (editData) { if (!isEditingRow) { -- cgit v1.2.3