diff options
author | stuconnolly <stuart02@gmail.com> | 2011-05-14 17:26:18 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2011-05-14 17:26:18 +0000 |
commit | 2dbae24c7735ead0524bd9847af6ea99d8654ec6 (patch) | |
tree | 87dbed4317214da2aa9e2aed493fd7b798b3e2bc /Source/SPTableTriggers.m | |
parent | 160728cd29519794b47b3a09b139ce9d604883f0 (diff) | |
download | sequelpro-2dbae24c7735ead0524bd9847af6ea99d8654ec6.tar.gz sequelpro-2dbae24c7735ead0524bd9847af6ea99d8654ec6.tar.bz2 sequelpro-2dbae24c7735ead0524bd9847af6ea99d8654ec6.zip |
Bring outline view branch up to date with trunk (r3279:r3306).
Diffstat (limited to 'Source/SPTableTriggers.m')
-rw-r--r-- | Source/SPTableTriggers.m | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/SPTableTriggers.m b/Source/SPTableTriggers.m index bc5fc4f6..742579d8 100644 --- a/Source/SPTableTriggers.m +++ b/Source/SPTableTriggers.m @@ -27,6 +27,7 @@ #import "SPDatabaseDocument.h" #import "SPTablesList.h" #import "SPTableData.h" +#import "SPTableView.h" #import "SPAlertSheets.h" #import "SPServerSupport.h" @@ -76,6 +77,9 @@ static const NSString *SPTriggerSQLMode = @"TriggerSQLMode"; // Set the table triggers view's vertical gridlines if required [triggersTableView setGridStyleMask:([[NSUserDefaults standardUserDefaults] boolForKey:SPDisplayTableViewVerticalGridlines]) ? NSTableViewSolidVerticalGridLineMask : NSTableViewGridNone]; + // Set the double-click action in blank areas of the table to create new rows + [triggersTableView setEmptyDoubleClickAction:@selector(addTrigger:)]; + // Set the strutcture and index view's font BOOL useMonospacedFont = [[NSUserDefaults standardUserDefaults] boolForKey:SPUseMonospacedFonts]; @@ -263,6 +267,10 @@ static const NSString *SPTriggerSQLMode = @"TriggerSQLMode"; */ - (IBAction)addTrigger:(id)sender { + + // Check whether table editing is permitted (necessary as some actions - eg table double-click - bypass validation) + if ([tableDocumentInstance isWorking] || [tablesListInstance tableType] != SPTableTypeTable) return; + [NSApp beginSheet:addTriggerPanel modalForWindow:[tableDocumentInstance parentWindow] modalDelegate:self |