From c06c5fe8261183d5f154edb1866608e8013ebbaa Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sun, 29 Jul 2012 21:40:15 +0000 Subject: - Remove the last BWToolKit view items from the main nib (DBView) by redesigning the advanced Content Filter window - Tweak SPTextView to support translucent views, or views which are set not to draw their background - Fix Lion compatibility for advanced content filter default operator (Issue #1255) --- Source/SPContentFilterManager.h | 2 +- Source/SPTableContent.h | 12 ++++++++---- Source/SPTableContent.m | 25 +++++++++++++++---------- Source/SPTextView.m | 7 ++++--- 4 files changed, 28 insertions(+), 18 deletions(-) (limited to 'Source') 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:@"(?