aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTablesList.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-09-24 03:42:30 +0000
committerstuconnolly <stuart02@gmail.com>2012-09-24 03:42:30 +0000
commitf37e308174721f2b2a8cb704fad9eb810bf0e273 (patch)
treed966b8f7ed9b115fd10d76fa7a30d7cc0ed6b9d2 /Source/SPTablesList.m
parent544e82c69fe3e1bfce7df5c0e2d89a6bd2d834fc (diff)
downloadsequelpro-f37e308174721f2b2a8cb704fad9eb810bf0e273.tar.gz
sequelpro-f37e308174721f2b2a8cb704fad9eb810bf0e273.tar.bz2
sequelpro-f37e308174721f2b2a8cb704fad9eb810bf0e273.zip
Fix r3857 regression. There is no table name when more than one item is selected.
Diffstat (limited to 'Source/SPTablesList.m')
-rw-r--r--Source/SPTablesList.m12
1 files changed, 9 insertions, 3 deletions
diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m
index c2a773bc..4da69390 100644
--- a/Source/SPTablesList.m
+++ b/Source/SPTablesList.m
@@ -1760,6 +1760,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable";
- (NSDragOperation)tableView:(NSTableView *)aTableView validateDrop:(id < NSDraggingInfo >)info proposedRow:(NSInteger)row proposedDropOperation:(NSTableViewDropOperation)operation
{
[tablesListView setDropRow:row dropOperation:NSTableViewDropAbove];
+
return NSDragOperationCopy;
}
@@ -1772,14 +1773,19 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable";
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
{
SEL action = [menuItem action];
+ NSInteger selectedRows = [tablesListView numberOfSelectedRows];
if (action == @selector(copyTable:) ||
action == @selector(renameTable:) ||
- action == @selector(removeTable:) ||
- action == @selector(truncateTable:) ||
action == @selector(openTableInNewTab:))
{
- return [tablesListView numberOfSelectedRows] == 1 && [[self tableName] length];
+ return selectedRows == 1 && [[self tableName] length];
+ }
+
+ if (action == @selector(removeTable:) ||
+ action == @selector(truncateTable:))
+ {
+ return selectedRows > 0;
}
return [super validateMenuItem:menuItem];