aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
authormtvee <emptyvee@gmail.com>2009-05-14 20:41:57 +0000
committermtvee <emptyvee@gmail.com>2009-05-14 20:41:57 +0000
commit840079ef1085b588b5c30f666f9c3ac2af65b291 (patch)
treedab7cd3046cd99011538cb29000c2988577403d6 /Source/TableDocument.m
parentbe4aac5c809f8f74c20f1d7b03a932e5ee0720df (diff)
downloadsequelpro-840079ef1085b588b5c30f666f9c3ac2af65b291.tar.gz
sequelpro-840079ef1085b588b5c30f666f9c3ac2af65b291.tar.bz2
sequelpro-840079ef1085b588b5c30f666f9c3ac2af65b291.zip
preliminary support for constraint editing
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r--Source/TableDocument.m22
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index 3e666cfd..f292e691 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -333,6 +333,7 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
[tablesListInstance setConnection:mySQLConnection];
[tableSourceInstance setConnection:mySQLConnection];
[tableContentInstance setConnection:mySQLConnection];
+ [tableRelationsInstance setConnection:mySQLConnection];
[customQueryInstance setConnection:mySQLConnection];
[customQueryInstance setMySQLversion:mySQLVersion];
[tableDumpInstance setConnection:mySQLConnection];
@@ -1622,6 +1623,27 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
[mainToolbar setSelectedItemIdentifier:@"SwitchToTableStatusToolbarItemIdentifier"];
}
+- (IBAction)viewRelations:(id)sender
+{
+ // Cancel the selection if currently editing structure/a field and unable to save
+ if ([tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]] == 0
+ && ![tableSourceInstance saveRowOnDeselect]) {
+ [mainToolbar setSelectedItemIdentifier:@"SwitchToTableStructureToolbarItemIdentifier"];
+ return;
+ }
+
+ // Cancel the selection if currently editing a content row and unable to save
+ if ([tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]] == 1
+ && ![tableContentInstance saveRowOnDeselect]) {
+ [mainToolbar setSelectedItemIdentifier:@"SwitchToTableContentToolbarItemIdentifier"];
+ return;
+ }
+
+ [tableTabView selectTabViewItemAtIndex:4];
+ [mainToolbar setSelectedItemIdentifier:@"SwitchToTableStatusToolbarItemIdentifier"];
+}
+
+
/**
* Adds the current database connection details to the user's favorites if it doesn't already exist.
*/