aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableView.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-05-23 21:44:59 +0000
committerrowanbeentje <rowan@beent.je>2010-05-23 21:44:59 +0000
commitc661b409eaa0e29d9e012b79e7a66574a554817a (patch)
tree49b310ded9a226a66aa53444c9ba112824854f68 /Source/SPTableView.m
parentb66006f3755c6a57dfc60d4133bc4dc4da0fef56 (diff)
downloadsequelpro-c661b409eaa0e29d9e012b79e7a66574a554817a.tar.gz
sequelpro-c661b409eaa0e29d9e012b79e7a66574a554817a.tar.bz2
sequelpro-c661b409eaa0e29d9e012b79e7a66574a554817a.zip
Initial implementation of tabs:
- Addition of PSMTabBar framework - Rework away from a document-based TableDocument - Support tabs throughout the application - Add menu items for creating tabs, and add support for dragging tabs to different windows
Diffstat (limited to 'Source/SPTableView.m')
-rw-r--r--Source/SPTableView.m12
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/SPTableView.m b/Source/SPTableView.m
index 4acf4879..58e2206e 100644
--- a/Source/SPTableView.m
+++ b/Source/SPTableView.m
@@ -37,14 +37,18 @@
- (NSMenu *)menuForEvent:(NSEvent *)event
{
+ // Try to retrieve a reference to the table document (assuming this is frontmost tab)
+ TableDocument *parentTableDocument = nil;
+ if ([[[[[self window] delegate] class] description] isEqualToString:@"SPWindowController"]) {
+ parentTableDocument = [[[self window] delegate] selectedTableDocument];
+ }
+
// If TableDocument is performing a task suppress any context menu
- if ([[[[[self window] delegate] class] description] isEqualToString:@"TableDocument"]
- && [[[self window] delegate] isWorking])
+ if (parentTableDocument && [parentTableDocument isWorking])
return nil;
// Check to see whether any edits-in-progress need to be saved before changing selections
- if ([[[[[self window] delegate] class] description] isEqualToString:@"TableDocument"]
- && ![[[self window] delegate] couldCommitCurrentViewActions])
+ if (parentTableDocument && ![parentTableDocument couldCommitCurrentViewActions])
return nil;
// If more than one row is selected only returns the default contextual menu