Revision: 13428
          http://sourceforge.net/p/skim-app/code/13428
Author:   hofman
Date:     2023-04-28 21:15:46 +0000 (Fri, 28 Apr 2023)
Log Message:
-----------
implement copyURL: action in overview

Modified Paths:
--------------
    trunk/SKOverviewView.m
    trunk/SKThumbnailView.m

Modified: trunk/SKOverviewView.m
===================================================================
--- trunk/SKOverviewView.m      2023-04-28 16:23:51 UTC (rev 13427)
+++ trunk/SKOverviewView.m      2023-04-28 21:15:46 UTC (rev 13428)
@@ -73,13 +73,23 @@
     }
 }
 
+- (void)copyURL:(id)sender {
+    NSUInteger i = [[self selectionIndexes] firstIndex];
+    if (i != NSNotFound) {
+        id view = [[self itemAtIndex:i] view];
+        if ([view respondsToSelector:_cmd])
+            [view copyURL:sender];
+    }
+}
+
 - (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
-    if ([menuItem action] == @selector(copy:)) {
+    SEL action = [menuItem action];
+    if (action == @selector(copy:) || action == @selector(copyURL:)) {
         NSUInteger i = [[self selectionIndexes] firstIndex];
         if (i == NSNotFound)
             return NO;
         id view = [[self itemAtIndex:i] view];
-        if ([view respondsToSelector:@selector(copy:)] == NO)
+        if ([view respondsToSelector:action] == NO)
             return NO;
         if ([view respondsToSelector:_cmd])
             return [view validateMenuItem:menuItem];

Modified: trunk/SKThumbnailView.m
===================================================================
--- trunk/SKThumbnailView.m     2023-04-28 16:23:51 UTC (rev 13427)
+++ trunk/SKThumbnailView.m     2023-04-28 21:15:46 UTC (rev 13428)
@@ -444,7 +444,7 @@
     [[[self thumbnail] page] writeToClipboardForPageIndexes:selectionIndexes];
 }
 
-- (void)copyPageURL:(id)sender {
+- (void)copyURL:(id)sender {
     PDFPage *page = [[self thumbnail] page];
     NSIndexSet *selectionIndexes = [[[self controller] collectionView] 
selectionIndexes];
     if ([selectionIndexes count] < 2 || [selectionIndexes containsIndex:[page 
pageIndex]] == NO)
@@ -480,7 +480,7 @@
     if (page && [[page document] isLocked] == NO) {
         menu = [[[NSMenu alloc] initWithTitle:@""] autorelease];
         [menu addItemWithTitle:NSLocalizedString(@"Copy", @"Menu item title") 
action:@selector(copy:) target:self];
-        [menu addItemWithTitle:NSLocalizedString(@"Copy URL", @"Menu item 
title") action:@selector(copyPageURL:) target:self];
+        [menu addItemWithTitle:NSLocalizedString(@"Copy URL", @"Menu item 
title") action:@selector(copyURL:) target:self];
     }
     return menu;
 }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to