diff options
author | rowanbeentje <rowan@beent.je> | 2011-02-11 02:06:18 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2011-02-11 02:06:18 +0000 |
commit | e3ac547a6fb5b73581e61bb35ac2f3f7fca67a96 (patch) | |
tree | 8ed159102057d9a26a5dd13e303cf1ce37da7c3b /Source/SPTableTriggers.m | |
parent | f5a99e49839174bdfa2364fbba1c963da4a3481b (diff) | |
download | sequelpro-e3ac547a6fb5b73581e61bb35ac2f3f7fca67a96.tar.gz sequelpro-e3ac547a6fb5b73581e61bb35ac2f3f7fca67a96.tar.bz2 sequelpro-e3ac547a6fb5b73581e61bb35ac2f3f7fca67a96.zip |
- Revert r3187, which only masked an underlying bug and caused double columns in views
- In SPTableStructureDelete, don't request the encoding if the table is reloading; this prevents multithreaded data fetches and race conditions causing Issue #974.
- Alter SPTableData to use thread mutexes instead of a boolean to prevent threading issues, which also fixes Issue #974 in a different way. Alter race condition checks to block their threads instead of returning bogus information to prevent state issues.
- Alter table loading to no longer load trigger information until required, speeding up use of other views and cleaning up the console log.
Diffstat (limited to 'Source/SPTableTriggers.m')
-rw-r--r-- | Source/SPTableTriggers.m | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/Source/SPTableTriggers.m b/Source/SPTableTriggers.m index 44a17549..6462a43f 100644 --- a/Source/SPTableTriggers.m +++ b/Source/SPTableTriggers.m @@ -111,17 +111,7 @@ static const NSString *SPTriggerSQLMode = @"TriggerSQLMode"; { BOOL enableInteraction = ((![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:SPMainToolbarTableTriggers]) || (![tableDocumentInstance isWorking])); - // Disable all interface elements by default - [addTriggerButton setEnabled:NO]; - [refreshTriggersButton setEnabled:NO]; - [triggersTableView setEnabled:NO]; - [labelTextField setStringValue:@""]; - - // Show a warning if the version of MySQL is too low to support triggers - if (![[tableDocumentInstance serverSupport] supportsTriggers]) { - [labelTextField setStringValue:NSLocalizedString(@"This version of MySQL does not support triggers. Support for triggers was added in MySQL 5.0.2", @"triggers not supported label")]; - return; - } + [self resetInterface]; // If no item is selected, or the item selected is not a table, return. if (![tablesListInstance tableName] || [tablesListInstance tableType] != SPTableTypeTable) @@ -139,6 +129,26 @@ static const NSString *SPTriggerSQLMode = @"TriggerSQLMode"; [self _refreshTriggerDataForcingCacheRefresh:NO]; } +/** + * Reset the trigger interface, as for no selected table. + */ +- (void)resetInterface +{ + [triggerData removeAllObjects]; + [triggersTableView noteNumberOfRowsChanged]; + + // Disable all interface elements by default + [addTriggerButton setEnabled:NO]; + [refreshTriggersButton setEnabled:NO]; + [triggersTableView setEnabled:NO]; + [labelTextField setStringValue:@""]; + + // Show a warning if the version of MySQL is too low to support triggers + if (![[tableDocumentInstance serverSupport] supportsTriggers]) { + [labelTextField setStringValue:NSLocalizedString(@"This version of MySQL does not support triggers. Support for triggers was added in MySQL 5.0.2", @"triggers not supported label")]; + } +} + #pragma mark - #pragma mark IB action methods |