From: <ho...@us...> - 2006-04-23 14:05:17
|
Revision: 6315 Author: hofman Date: 2006-04-23 07:05:10 -0700 (Sun, 23 Apr 2006) ViewCVS: http://svn.sourceforge.net/bibdesk/?rev=6315&view=rev Log Message: ----------- Shared groups are only selected by themselves now, use that fact. Make sure shared items can only be dropped on the All Publications group. Modified Paths: -------------- trunk/bibdesk/BibDocument_DataSource.m Modified: trunk/bibdesk/BibDocument_DataSource.m =================================================================== --- trunk/bibdesk/BibDocument_DataSource.m 2006-04-23 12:11:20 UTC (rev 6314) +++ trunk/bibdesk/BibDocument_DataSource.m 2006-04-23 14:05:10 UTC (rev 6315) @@ -431,13 +431,13 @@ } pubs = pubsInGroup; } + dragFromSharedGroups = [self hasSharedGroupsAtIndexes:rowIndexes]; } if([pubs count] == 0){ NSBeginAlertSheet(NSLocalizedString(@"Empty Groups", @""),nil,nil,nil,documentWindow,nil,NULL,NULL,NULL, NSLocalizedString(@"The groups you want to drag do not contain any items.", @"")); return NO; } - dragFromSharedGroups = [self hasOnlySharedGroupsAtIndexes:rowIndexes]; } else if(tv == (NSTableView *)ccTableView){ // drag from the custom cite drawer table @@ -457,14 +457,12 @@ pubs = [self selectedPublications]; dragCopyType = 1; // only type that makes sense here - NSIndexSet *indexes = [groupTableView selectedRowIndexes]; - dragFromSharedGroups = [self hasOnlySharedGroupsAtIndexes:indexes]; + dragFromSharedGroups = [self hasSharedGroupsAtIndexes:[groupTableView selectedRowIndexes]]; }else{ // drag from the main table pubs = [shownPublications objectsAtIndexes:rowIndexes]; - NSIndexSet *indexes = [groupTableView selectedRowIndexes]; - dragFromSharedGroups = [self hasOnlySharedGroupsAtIndexes:indexes]; + dragFromSharedGroups = [self hasSharedGroupsAtIndexes:[groupTableView selectedRowIndexes]]; if(pboard == [NSPasteboard pasteboardWithName:NSDragPboard]){ // see where we clicked in the table @@ -895,7 +893,9 @@ return NSDragOperationEvery; // if it's not from me, copying is OK } }else if(tv == groupTableView){ - if (([info draggingSource] == groupTableView || [info draggingSource] == tableView) && dragFromSharedGroups && row == 0) { + if (([info draggingSource] == groupTableView || [info draggingSource] == tableView) && dragFromSharedGroups) { + if (row != 0) + return NSDragOperationNone; [tv setDropRow:row dropOperation:NSTableViewDropOn]; return NSDragOperationCopy; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |