Revision: 14731
          http://sourceforge.net/p/skim-app/code/14731
Author:   hofman
Date:     2024-11-20 22:55:40 +0000 (Wed, 20 Nov 2024)
Log Message:
-----------
Add services to print with or without panel from Skim

Modified Paths:
--------------
    trunk/Info.plist
    trunk/SKDocumentController.m
    trunk/de.lproj/ServicesMenu.strings
    trunk/en.lproj/ServicesMenu.strings
    trunk/es.lproj/ServicesMenu.strings
    trunk/fr.lproj/ServicesMenu.strings
    trunk/it.lproj/ServicesMenu.strings
    trunk/ja.lproj/ServicesMenu.strings
    trunk/nl.lproj/ServicesMenu.strings
    trunk/pl.lproj/ServicesMenu.strings
    trunk/ru.lproj/ServicesMenu.strings
    trunk/zh_CN.lproj/ServicesMenu.strings
    trunk/zh_TW.lproj/ServicesMenu.strings

Modified: trunk/Info.plist
===================================================================
--- trunk/Info.plist    2024-11-20 17:12:46 UTC (rev 14730)
+++ trunk/Info.plist    2024-11-20 22:55:40 UTC (rev 14731)
@@ -458,6 +458,70 @@
                                <string>public.plain-text</string>
                        </array>
                </dict>
+               <dict>
+                       <key>NSMenuItem</key>
+                       <dict>
+                               <key>default</key>
+                               <string>Print File with Skim…</string>
+                       </dict>
+                       <key>NSMessage</key>
+                       <string>printDocumentFromURLOnPboard</string>
+                       <key>NSPortName</key>
+                       <string>Skim</string>
+                       <key>NSRequiredContext</key>
+                       <dict>
+                               <key>NSTextContent</key>
+                               <string>FilePath</string>
+                       </dict>
+                       <key>NSSendFileTypes</key>
+                       <array>
+                               <string>com.adobe.pdf</string>
+                               <string>com.adobe.postscript</string>
+                               
<string>com.adobe.encapsulated-postscript</string>
+                               <string>org.tug.tex.dvi</string>
+                               <string>org.tug.tex.xdv</string>
+                               <string>net.sourceforge.skim-app.pdfd</string>
+                               
<string>net.sourceforge.skim-app.skimnotes</string>
+                       </array>
+                       <key>NSSendTypes</key>
+                       <array>
+                               <string>public.url</string>
+                               <string>public.file-url</string>
+                               <string>public.plain-text</string>
+                       </array>
+               </dict>
+               <dict>
+                       <key>NSMenuItem</key>
+                       <dict>
+                               <key>default</key>
+                               <string>Print File with Skim</string>
+                       </dict>
+                       <key>NSMessage</key>
+                       
<string>printDocumentWithoutPanelFromURLOnPboard</string>
+                       <key>NSPortName</key>
+                       <string>Skim</string>
+                       <key>NSRequiredContext</key>
+                       <dict>
+                               <key>NSTextContent</key>
+                               <string>FilePath</string>
+                       </dict>
+                       <key>NSSendFileTypes</key>
+                       <array>
+                               <string>com.adobe.pdf</string>
+                               <string>com.adobe.postscript</string>
+                               
<string>com.adobe.encapsulated-postscript</string>
+                               <string>org.tug.tex.dvi</string>
+                               <string>org.tug.tex.xdv</string>
+                               <string>net.sourceforge.skim-app.pdfd</string>
+                               
<string>net.sourceforge.skim-app.skimnotes</string>
+                       </array>
+                       <key>NSSendTypes</key>
+                       <array>
+                               <string>public.url</string>
+                               <string>public.file-url</string>
+                               <string>public.plain-text</string>
+                       </array>
+               </dict>
        </array>
        <key>NSSupportsAutomaticGraphicsSwitching</key>
        <true/>

Modified: trunk/SKDocumentController.m
===================================================================
--- trunk/SKDocumentController.m        2024-11-20 17:12:46 UTC (rev 14730)
+++ trunk/SKDocumentController.m        2024-11-20 22:55:40 UTC (rev 14731)
@@ -691,4 +691,18 @@
     [self openDocumentWithURLFromPasteboard:pboard showNotes:YES 
completionHandler:^(NSDocument *document, BOOL documentWasAlreadyOpen, NSError 
*error){}];
 }
 
+- (void)printDocumentFromURLOnPboard:(NSPasteboard *)pboard userData:(NSString 
*)userData error:(out NSString * __autoreleasing *)errorString {
+    NSURL *theURL = [[NSURL readURLsFromPasteboard:pboard] firstObject];
+    if ([theURL isFileURL] && [[NSApp delegate] 
respondsToSelector:@selector(application:printFiles:withSettings:showPrintPanels:)])
 {
+        [[NSApp delegate] application:NSApp printFiles:@[theURL] 
withSettings:@{} showPrintPanels:YES];
+    }
+}
+
+- (void)printDocumentWithoutPanelFromURLOnPboard:(NSPasteboard *)pboard 
userData:(NSString *)userData error:(out NSString * __autoreleasing 
*)errorString {
+    NSURL *theURL = [[NSURL readURLsFromPasteboard:pboard] firstObject];
+    if ([theURL isFileURL] && [[NSApp delegate] 
respondsToSelector:@selector(application:printFiles:withSettings:showPrintPanels:)])
 {
+        [[NSApp delegate] application:NSApp printFiles:@[theURL] 
withSettings:@{} showPrintPanels:NO];
+    }
+}
+
 @end

Modified: trunk/de.lproj/ServicesMenu.strings
===================================================================
(Binary files differ)

Modified: trunk/en.lproj/ServicesMenu.strings
===================================================================
(Binary files differ)

Modified: trunk/es.lproj/ServicesMenu.strings
===================================================================
(Binary files differ)

Modified: trunk/fr.lproj/ServicesMenu.strings
===================================================================
(Binary files differ)

Modified: trunk/it.lproj/ServicesMenu.strings
===================================================================
(Binary files differ)

Modified: trunk/ja.lproj/ServicesMenu.strings
===================================================================
(Binary files differ)

Modified: trunk/nl.lproj/ServicesMenu.strings
===================================================================
(Binary files differ)

Modified: trunk/pl.lproj/ServicesMenu.strings
===================================================================
(Binary files differ)

Modified: trunk/ru.lproj/ServicesMenu.strings
===================================================================
(Binary files differ)

Modified: trunk/zh_CN.lproj/ServicesMenu.strings
===================================================================
(Binary files differ)

Modified: trunk/zh_TW.lproj/ServicesMenu.strings
===================================================================
(Binary files differ)

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