Revision: 3178
http://skim-app.svn.sourceforge.net/skim-app/?rev=3178&view=rev
Author: hofman
Date: 2007-11-07 10:51:10 -0800 (Wed, 07 Nov 2007)
Log Message:
-----------
Allow editing or (de)selecting notes when both the anchored note and its child
is selected.
Modified Paths:
--------------
trunk/SKMainWindowController.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2007-11-07 18:37:45 UTC (rev 3177)
+++ trunk/SKMainWindowController.m 2007-11-07 18:51:10 UTC (rev 3178)
@@ -3775,11 +3775,11 @@
if ([noteOutlineView isRowSelected:[noteOutlineView rowForItem:item]]
== NO)
[noteOutlineView selectRowIndexes:[NSIndexSet
indexSetWithIndex:[noteOutlineView rowForItem:item]] byExtendingSelection:NO];
- NSMutableArray *items = [NSMutableArray array];
+ NSArray *items = [NSMutableArray array];
NSIndexSet *rowIndexes = [noteOutlineView selectedRowIndexes];
unsigned int row = [rowIndexes firstIndex];
while (row != NSNotFound) {
- [items addObject:[noteOutlineView itemAtRow:row]];
+ [(NSMutableArray *)items addObject:[noteOutlineView
itemAtRow:row]];
row = [rowIndexes indexGreaterThanIndex:row];
}
@@ -3794,21 +3794,22 @@
[menuItem setTarget:self];
[menuItem setRepresentedObject:item];
}
- if ([pdfView hideNotes] == NO && [items count] == 1) {
- PDFAnnotation *annotation = [items lastObject];
- if ([annotation type] == nil)
- annotation = [(SKNoteText *)annotation annotation];
- if ([annotation isEditable]) {
- menuItem = [menu addItemWithTitle:NSLocalizedString(@"Edit",
@"Menu item title") action:@selector(editThisAnnotation:) keyEquivalent:@""];
- [menuItem setTarget:pdfView];
+ if ([pdfView hideNotes] == NO) {
+ items = [self noteItems:items];
+ if ([items count] == 1) {
+ PDFAnnotation *annotation = [items lastObject];
+ if ([annotation isEditable]) {
+ menuItem = [menu
addItemWithTitle:NSLocalizedString(@"Edit", @"Menu item title")
action:@selector(editThisAnnotation:) keyEquivalent:@""];
+ [menuItem setTarget:pdfView];
+ [menuItem setRepresentedObject:annotation];
+ }
+ if ([pdfView activeAnnotation] == annotation)
+ menuItem = [menu
addItemWithTitle:NSLocalizedString(@"Deselect", @"Menu item title")
action:@selector(deselectNote:) keyEquivalent:@""];
+ else
+ menuItem = [menu
addItemWithTitle:NSLocalizedString(@"Select", @"Menu item title")
action:@selector(selectNote:) keyEquivalent:@""];
+ [menuItem setTarget:self];
[menuItem setRepresentedObject:annotation];
}
- if ([pdfView activeAnnotation] == annotation)
- menuItem = [menu
addItemWithTitle:NSLocalizedString(@"Deselect", @"Menu item title")
action:@selector(deselectNote:) keyEquivalent:@""];
- else
- menuItem = [menu addItemWithTitle:NSLocalizedString(@"Select",
@"Menu item title") action:@selector(selectNote:) keyEquivalent:@""];
- [menuItem setTarget:self];
- [menuItem setRepresentedObject:annotation];
}
if ([menu numberOfItems] > 0)
[menu addItem:[NSMenuItem separatorItem]];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit