diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPContentFilterManager.h | 2 | ||||
-rw-r--r-- | Source/SPTableContent.h | 12 | ||||
-rw-r--r-- | Source/SPTableContent.m | 25 | ||||
-rw-r--r-- | Source/SPTextView.m | 7 |
4 files changed, 28 insertions, 18 deletions
diff --git a/Source/SPContentFilterManager.h b/Source/SPContentFilterManager.h index 9f1d06a6..88eda63c 100644 --- a/Source/SPContentFilterManager.h +++ b/Source/SPContentFilterManager.h @@ -62,7 +62,7 @@ IBOutlet id resultingClauseLabel; IBOutlet id resultingClauseContentLabel; IBOutlet id insertPlaceholderButton; - IBOutlet id suppressLeadingFiledPlaceholderCheckbox; + IBOutlet NSButton *suppressLeadingFiledPlaceholderCheckbox; IBOutlet BWAnchoredButtonBar *splitViewButtonBar; diff --git a/Source/SPTableContent.h b/Source/SPTableContent.h index 7be0a415..71ae4a43 100644 --- a/Source/SPTableContent.h +++ b/Source/SPTableContent.h @@ -47,6 +47,9 @@ @class SPTableStructure; @class SPTableList; @class SPContentFilterManager; +#ifndef SP_REFACTOR +@class SPSplitView; +#endif @interface SPTableContent : NSObject #ifdef SP_REFACTOR @@ -98,15 +101,17 @@ IBOutlet SPCopyTable *filterTableView; IBOutlet NSPanel *filterTableWindow; + IBOutlet SPSplitView *filterTableSplitView; + IBOutlet NSBox *filterTableQueryBox; IBOutlet NSButton *filterTableFilterButton; IBOutlet NSButton *filterTableClearButton; IBOutlet SPTextView *filterTableWhereClause; IBOutlet NSButton *filterTableNegateCheckbox; - IBOutlet NSMenuItem *filterTableDistinctMenuItem; + IBOutlet NSButton *filterTableDistinctCheckbox; IBOutlet NSButton *filterTableLiveSearchCheckbox; - IBOutlet NSMenuItem *filterTableGearLookAllFields; + IBOutlet NSButton *filterTableSearchAllFields; IBOutlet NSPanel *filterTableSetDefaultOperatorSheet; - IBOutlet NSComboBox* filterTableSetDefaultOperatorValue; + IBOutlet NSComboBox *filterTableSetDefaultOperatorValue; #endif SPMySQLConnection *mySQLConnection; @@ -239,7 +244,6 @@ - (IBAction)toggleNegateClause:(id)sender; - (IBAction)toggleDistinctSelect:(id)sender; - (IBAction)setDefaultOperator:(id)sender; -- (IBAction)swapFilterTable:(id)sender; - (IBAction)toggleLookAllFieldsMode:(id)sender; - (IBAction)closeSheet:(id)sender; - (IBAction)showDefaultOperaterHelp:(id)sender; diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 7cc7ffe3..a024e09f 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -45,6 +45,7 @@ #import "SPTextAndLinkCell.h" #ifndef SP_REFACTOR #import "QLPreviewPanel.h" +#import "SPSplitView.h" #endif #import "SPFieldEditorController.h" #import "SPTooltip.h" @@ -229,13 +230,16 @@ paginationViewFrame.size.height = 0; [paginationView setFrame:paginationViewFrame]; [contentViewPane addSubview:paginationView]; + + // Modify the filter table split view sizes + [filterTableSplitView setMinSize:135 ofSubviewAtIndex:1]; #endif [tableContentView setFieldEditorSelectedRange:NSMakeRange(0,0)]; #ifndef SP_REFACTOR // Init Filter Table GUI - [filterTableDistinctMenuItem setState:(filterTableDistinct) ? NSOnState : NSOffState]; + [filterTableDistinctCheckbox setState:(filterTableDistinct) ? NSOnState : NSOffState]; [filterTableNegateCheckbox setState:(filterTableNegate) ? NSOnState : NSOffState]; [filterTableLiveSearchCheckbox setState:NSOffState]; #endif @@ -3591,6 +3595,12 @@ #ifndef SP_REFACTOR filterTableNegate = !filterTableNegate; + if (filterTableNegate) { + [filterTableQueryBox setTitle:NSLocalizedString(@"WHERE NOT query", @"Title of filter preview area when the query WHERE is negated")]; + } else { + [filterTableQueryBox setTitle:NSLocalizedString(@"WHERE query", @"Title of filter preview area when the query WHERE is normal")]; + } + // If live search is set perform filtering if([filterTableLiveSearchCheckbox state] == NSOnState) [self filterTable:filterTableFilterButton]; @@ -3606,7 +3616,7 @@ #ifndef SP_REFACTOR filterTableDistinct = !filterTableDistinct; - [filterTableDistinctMenuItem setState:(filterTableDistinct) ? NSOnState : NSOffState]; + [filterTableDistinctCheckbox setState:(filterTableDistinct) ? NSOnState : NSOffState]; // If live search is set perform filtering if([filterTableLiveSearchCheckbox state] == NSOnState) @@ -3647,11 +3657,6 @@ } -- (IBAction)swapFilterTable:(id)sender -{ - NSLog(@"SWAP"); -} - /** * Generate WHERE clause to look for last typed pattern in all fields */ @@ -4226,14 +4231,14 @@ NSMutableString *newOp = [[[NSMutableString alloc] initWithCapacity:[anOperator length]] autorelease]; [newOp setString:anOperator]; [newOp replaceOccurrencesOfRegex:@"%" withString:@"%%"]; - [newOp replaceOccurrencesOfRegex:@"(?<!`)@(?!=`)" withString:@"%"]; + [newOp replaceOccurrencesOfRegex:@"(?<!`)@(?!=`)" withString:@"%@"]; return newOp; } /** * Update WHERE clause in Filter Table Window * - * @param currentValue If currentValue == nil take the data from filterTableData, if currentValue == filterTableGearLookAllFields + * @param currentValue If currentValue == nil take the data from filterTableData, if currentValue == filterTableSearchAllFields * generate a WHERE clause to search in all given fields, if currentValue == a string take this string as table cell data of the * currently edited table cell */ @@ -4253,7 +4258,7 @@ NSInteger editedRow = [filterTableView editedRow]; - if(currentValue == filterTableGearLookAllFields) { + if(currentValue == filterTableSearchAllFields) { numberOfRows = 1; lookInAllFields = YES; } diff --git a/Source/SPTextView.m b/Source/SPTextView.m index e9dc1413..e3d3d70c 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -2980,12 +2980,13 @@ NSInteger _alphabeticSort(id string1, id string2, void *reverse) - (void)drawRect:(NSRect)rect { - // Draw background only for screen display but not while printing - if([NSGraphicsContext currentContextDrawingToScreen]) { + // Draw background only for screen display but not while printing, and only if view + // background drawing is enabled. + if([NSGraphicsContext currentContextDrawingToScreen] && [self drawsBackground]) { // Draw textview's background since due to the snippet highlighting we're responsible for it. [[self queryEditorBackgroundColor] setFill]; - NSRectFill(rect); + NSRectFillUsingOperation(rect, NSCompositeSourceOver); if([[self delegate] isKindOfClass:[SPCustomQuery class]]) { |