aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
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.
*/