From 61c1ffe21ce73752bc195e0312a6a851808601e6 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Sat, 1 Aug 2009 17:08:19 +0000 Subject: Put the table content filter in a split view so the field name drop down and search field can be resized. Addresses issue #339. --- Interfaces/English.lproj/DBView.xib | 667 ++++++++++++++++++++---------------- Source/TableContent.m | 18 + Source/TableSource.m | 35 +- 3 files changed, 408 insertions(+), 312 deletions(-) diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib index 9fabfe46..092b6a8a 100644 --- a/Interfaces/English.lproj/DBView.xib +++ b/Interfaces/English.lproj/DBView.xib @@ -8,7 +8,7 @@ 353.00 YES - + YES @@ -47,7 +47,7 @@ {3.40282e+38, 3.40282e+38} {780, 480} - + 256 YES @@ -924,11 +924,12 @@ longtext enum set + bit 274 - {13, 486} + {13, 504} YES @@ -2051,7 +2052,7 @@ content - + 256 YES @@ -2168,7 +2169,7 @@ - {{6, 32}, {690, 472}} + {{6, 33}, {690, 472}} 562 @@ -2179,169 +2180,6 @@ QSAAAEEgAABBkAAAQZAAAA - - - 264 - {{56, 512}, {152, 20}} - - YES - - -1539178944 - 133120 - - LucidaGrande - 1.100000e+01 - 16 - - - -2038284033 - 36 - - - - - - 400 - 75 - - - field - - 1048576 - 2147483647 - 1 - - - _popUpItemAction: - - - YES - - - OtherViews - - - YES - - - - 3 - YES - YES - 1 - - - - - 264 - {{215, 509}, {86, 25}} - - YES - - -1539178944 - 133120 - - - -2038415105 - 36 - - - - - 400 - 75 - - - is - - 1048576 - 2147483647 - 1 - - - _popUpItemAction: - - - YES - - - OtherViews - - - YES - - - - -1 - 3 - YES - YES - 1 - - - - - 266 - {{309, 513}, {172, 19}} - - YES - - 879885888 - 268567552 - - - - YES - 1 - - - - 537001472 - 0 - search - _searchFieldSearch: - - - 138690815 - 0 - - 400 - 75 - - - 537001472 - 0 - clear - - YES - - YES - - YES - AXDescription - NSAccessibilityEncodedAttributesValueType - - - YES - cancel - - - - - _searchFieldCancel: - - - 138690815 - 0 - - 400 - 75 - - 255 - YES - CAAAAA - - 265 @@ -2422,22 +2260,6 @@ - - - 268 - {{11, 515}, {43, 14}} - - YES - - 67239488 - 272761856 - Search: - - - - - - 265 @@ -2473,7 +2295,11 @@ -2080244224 134217728 Filter - + + LucidaGrande + 1.100000e+01 + 16 + -2038152961 164 @@ -2656,8 +2482,215 @@ + + + 266 + + YES + + + 290 + + YES + + + 264 + {{7, 6}, {43, 14}} + + YES + + 67239488 + 272761856 + Search: + + + + + + + + + 266 + {{54, 3}, {102, 20}} + + YES + + -1539178944 + 133120 + + + -2038284033 + 36 + + + + + + 400 + 75 + + + field + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + + OtherViews + + + YES + + + + 3 + YES + YES + 1 + + + + + 265 + {{161, 0}, {89, 25}} + + YES + + -1539178944 + 133120 + + + -2038415105 + 36 + + + + + 400 + 75 + + + is + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + + OtherViews + + + YES + + + + -1 + 3 + YES + YES + 1 + + + + {255, 27} + + NSView + + + + 290 + + YES + + + 266 + {{5, 4}, {205, 19}} + + YES + + 879885888 + 268567552 + + + + YES + 1 + + + + 537001472 + 0 + search + _searchFieldSearch: + + + 138690815 + 0 + + 400 + 75 + + + 537001472 + 0 + clear + + YES + + YES + + YES + AXDescription + NSAccessibilityEncodedAttributesValueType + + + YES + cancel + + + + + _searchFieldCancel: + + + 138690815 + 0 + + 400 + 75 + + 255 + YES + CAAAAA + + + + {{264, 0}, {211, 27}} + + NSView + + + {{6, 509}, {475, 27}} + + YES + TableFilterSplitter + {{10, 7}, {700, 544}} + Content @@ -3068,7 +3101,7 @@ -2042609409 35 - + NSImage button_action @@ -3083,7 +3116,7 @@ 1048576 2147483647 - + _popUpItemAction: @@ -3752,6 +3785,7 @@ {{24, 30}, {645, 278}} + TableInfoSplitter @@ -4111,7 +4145,7 @@ relations - + 256 YES @@ -4487,21 +4521,20 @@ {{10, 7}, {700, 544}} - Relations - + 134217731 YES YES YES - + @@ -4517,6 +4550,7 @@ {944, 550} + {{0, 0}, {1920, 1178}} {780, 502} @@ -8434,7 +8468,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {3.40282e+38, 3.40282e+38} {350, 250} - + 256 YES @@ -8628,6 +8662,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {{1, 17}, {423, 141}} + 6 @@ -8661,6 +8696,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {{1, 0}, {423, 17}} + 4 @@ -8669,6 +8705,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {{20, 45}, {425, 159}} + 530 @@ -8809,7 +8846,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {465, 294} - {{0, 0}, {1920, 1178}} {350, 272} @@ -14572,6 +14608,14 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 6302 + + + delegate + + + + 6306 + @@ -18125,21 +18169,18 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 YES - - - - - + + @@ -18161,24 +18202,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 - - 3971 - - - YES - - - - - - 146 - - - YES - - - - 5175 @@ -18299,34 +18322,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 - - 3754 - - - YES - - - - - - 147 - - - YES - - - - - - 144 - - - - - 3972 - - - 3759 @@ -18407,52 +18402,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 - - 3963 - - - YES - - - - - - 3964 - - - - - 156 - - - YES - - - - - - 3755 - - - YES - - - - - - 157 - - - YES - - - - - - 154 - - - 5428 @@ -20569,6 +20518,128 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 SPHistoryController + + 6303 + + + YES + + + + + + + 6304 + + + YES + + + + + + + + 6305 + + + YES + + + + + + 3963 + + + YES + + + + + + 3964 + + + + + 3971 + + + YES + + + + + + 3972 + + + + + 146 + + + YES + + + + + + 3754 + + + YES + + + + + + 147 + + + YES + + + + + + 144 + + + + + 156 + + + YES + + + + + + 3755 + + + YES + + + + + + 157 + + + YES + + + + + + 154 + + + @@ -20758,6 +20829,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 156.IBAttributePlaceholdersKey 156.IBPluginDependency 156.ImportedFromIB2 + 157.IBEditorWindowLastContentRect 157.IBPluginDependency 157.ImportedFromIB2 157.editorWindowContentRectSynchronizationRect @@ -21259,6 +21331,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 4777.ImportedFromIB2 4795.IBPluginDependency 5.IBEditorWindowLastContentRect + 5.IBViewEditorWindowController.showingLayoutRectangles 5.IBWindowTemplateEditedContentRect 5.ImportedFromIB2 5.NSWindowTemplate.visibleAtLaunch @@ -21802,6 +21875,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 6293.IBSegmentedControlTracker.WasGrowing 6294.IBPluginDependency 6297.IBPluginDependency + 6303.IBPluginDependency + 6304.IBPluginDependency + 6305.IBPluginDependency 654.IBPluginDependency 654.ImportedFromIB2 655.IBPluginDependency @@ -22264,6 +22340,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 com.apple.InterfaceBuilder.CocoaPlugin + {{618, 746}, {92, 20}} com.apple.InterfaceBuilder.CocoaPlugin {{535, 926}, {92, 23}} @@ -22829,8 +22906,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{251, 233}, {944, 550}} - {{251, 233}, {944, 550}} + {{252, 100}, {944, 550}} + + {{252, 100}, {944, 550}} {{62, 352}, {845, 504}} @@ -23584,6 +23662,9 @@ aGUgYWN0aXZlIHNlbGVjdGlvbiAo4oyl4oyYUik 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 @@ -23803,7 +23884,7 @@ Y2hhbmdlIHRoZSBvcmRlcg - 6302 + 6315 diff --git a/Source/TableContent.m b/Source/TableContent.m index 263b48dd..d596eb7b 100644 --- a/Source/TableContent.m +++ b/Source/TableContent.m @@ -2032,6 +2032,24 @@ return NO; } +#pragma mark - +#pragma mark SplitView delegate methods + +- (BOOL)splitView:(NSSplitView *)sender canCollapseSubview:(NSView *)subview +{ + return NO; +} + +- (float)splitView:(NSSplitView *)sender constrainMaxCoordinate:(float)proposedMax ofSubviewAt:(int)offset +{ + return (proposedMax - 150); +} + +- (float)splitView:(NSSplitView *)sender constrainMinCoordinate:(float)proposedMin ofSubviewAt:(int)offset +{ + return (proposedMin + 200); +} + #pragma mark - /* diff --git a/Source/TableSource.m b/Source/TableSource.m index 48d1d75d..165d6461 100644 --- a/Source/TableSource.m +++ b/Source/TableSource.m @@ -243,6 +243,8 @@ loads aTable, put it in an array, update the tableViewColumns and reload the tab //query finished [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:self]; + + NSLog(@"%@", tableFields); } /* @@ -663,7 +665,7 @@ fetches the result as an array with a dictionary for each row in it // CHANGE syntax if (([[theRow objectForKey:@"Length"] isEqualToString:@""]) || (![theRow objectForKey:@"Length"]) || ([[theRow objectForKey:@"Type"] isEqualToString:@"datetime"])) { - // If the old row and new row dictionaries are equel then the user didn't actually change anything so don't continue + // If the old row and new row dictionaries are equal then the user didn't actually change anything so don't continue if ([oldRow isEqualToDictionary:theRow]) { return YES; } @@ -675,7 +677,7 @@ fetches the result as an array with a dictionary for each row in it [theRow objectForKey:@"Type"]]; } else { - // If the old row and new row dictionaries are equel then the user didn't actually change anything so don't continue + // If the old row and new row dictionaries are equal then the user didn't actually change anything so don't continue if ([oldRow isEqualToDictionary:theRow]) { return YES; } @@ -711,8 +713,8 @@ fetches the result as an array with a dictionary for each row in it // Don't provide any defaults for auto-increment fields if ([[theRow objectForKey:@"Extra"] isEqualToString:@"auto_increment"]) { [queryString appendString:@" "]; - } else { - + } + else { // If a null value has been specified, and null is allowed, specify DEFAULT NULL if ([[theRow objectForKey:@"Default"] isEqualToString:[prefs objectForKey:@"NullValue"]]) { if ([[theRow objectForKey:@"Null"] intValue] == 1) { @@ -720,13 +722,15 @@ fetches the result as an array with a dictionary for each row in it } // Otherwise, if current_timestamp was specified for timestamps, use that - } else if ([[theRow objectForKey:@"Type"] isEqualToString:@"timestamp"] && - [[[theRow objectForKey:@"Default"] uppercaseString] isEqualToString:@"CURRENT_TIMESTAMP"]) + } + else if ([[theRow objectForKey:@"Type"] isEqualToString:@"timestamp"] && + [[[theRow objectForKey:@"Default"] uppercaseString] isEqualToString:@"CURRENT_TIMESTAMP"]) { [queryString appendString:@" DEFAULT CURRENT_TIMESTAMP "]; + } // Otherwise, use the provided default - } else { + else { [queryString appendString:[NSString stringWithFormat:@" DEFAULT '%@' ", [mySQLConnection prepareString:[theRow objectForKey:@"Default"]]]]; } } @@ -1019,11 +1023,7 @@ returns a dictionary containing enum/set field names as key and possible values - (int)numberOfRowsInTableView:(NSTableView *)aTableView { - if ( aTableView == tableSourceView ) { - return [tableFields count]; - } else { - return [indexes count]; - } + return (aTableView == tableSourceView) ? [tableFields count] : [indexes count]; } - (id)tableView:(NSTableView *)aTableView @@ -1047,19 +1047,16 @@ returns a dictionary containing enum/set field names as key and possible values forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { - //make sure that the drag operation is for the right table view + // Make sure that the drag operation is for the right table view if (aTableView!=tableSourceView) return; - if ( !isEditingRow ) { + if (!isEditingRow) { [oldRow setDictionary:[tableFields objectAtIndex:rowIndex]]; isEditingRow = YES; currentlyEditingRow = rowIndex; } - if ( anObject ) { - [[tableFields objectAtIndex:rowIndex] setObject:anObject forKey:[aTableColumn identifier]]; - } else { - [[tableFields objectAtIndex:rowIndex] setObject:@"" forKey:[aTableColumn identifier]]; - } + + [[tableFields objectAtIndex:rowIndex] setObject:(anObject) ? anObject : @"" forKey:[aTableColumn identifier]]; } /* -- cgit v1.2.3