diff options
author | bamse16 <marius@marius.me.uk> | 2010-01-31 18:56:25 +0000 |
---|---|---|
committer | bamse16 <marius@marius.me.uk> | 2010-01-31 18:56:25 +0000 |
commit | 223dd9139ae61d9319ea5f719a1a08feb63bfeb4 (patch) | |
tree | 378bf3a8440de007df8b8c76d0847abe845fa848 /Source/TableDocument.m | |
parent | 890247960876e8dd987dd44ec98da4300b6a0fd3 (diff) | |
download | sequelpro-223dd9139ae61d9319ea5f719a1a08feb63bfeb4.tar.gz sequelpro-223dd9139ae61d9319ea5f719a1a08feb63bfeb4.tar.bz2 sequelpro-223dd9139ae61d9319ea5f719a1a08feb63bfeb4.zip |
Added preliminary support for triggers. You can access the tab via the
menu item View > Table Triggers (apple-6).
Heavily copied from Relations tab, lots of functionality missing. Just
lists the triggers for the table now.
M Source/SPTableData.m
M Source/SPConstants.h
M Source/SPConstants.m
A Source/SPTableTriggers.h
A Source/SPTableTriggers.m
M Source/TableDocument.h
M Source/TableDocument.m
M Source/SPTableData.h
M Interfaces/English.lproj/MainMenu.xib
M Interfaces/English.lproj/DBView.xib
M sequel-pro.xcodeproj/project.pbxproj
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r-- | Source/TableDocument.m | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 368d9f94..c8834af3 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -3077,6 +3077,30 @@ [prefs setInteger:SPRelationsViewMode forKey:SPLastViewMode]; } +- (IBAction)viewTriggers:(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:SPMainToolbarTableStructure]; + return; + } + + // Cancel the selection if currently editing a content row and unable to save + if ([tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]] == 1 + && ![tableContentInstance saveRowOnDeselect]) { + [mainToolbar setSelectedItemIdentifier:SPMainToolbarTableContent]; + return; + } + + + [tableTabView selectTabViewItemAtIndex:5]; + [mainToolbar setSelectedItemIdentifier:SPMainToolbarTableTriggers]; + [spHistoryControllerInstance updateHistoryEntries]; + + //[prefs setInteger:SPRelationsViewMode forKey:SPLastViewMode]; +} + /** * Adds the current database connection details to the user's favorites if it doesn't already exist. |