# HG changeset patch # User Claus Gittinger # Date 1084357268 -7200 # Node ID 922c94b683a16037cdc10e5835605bb362359dfe # Parent 228d7881397204ab763d0d9937e11a11d3ce0dea ask MIMETypes for pdf-command diff -r 228d78813972 -r 922c94b683a1 AbstractFileBrowser.st --- a/AbstractFileBrowser.st Wed May 12 10:15:54 2004 +0200 +++ b/AbstractFileBrowser.st Wed May 12 12:21:08 2004 +0200 @@ -5453,23 +5453,35 @@ ! openPDFViewer - |files fileNames| + |files fileNames cmd arg| files := self currentSelectedFiles. (files isEmpty) ifTrue:[ ^ self. ]. + cmd := MIMETypes defaultCommandForMimeType:'application/pdf'. + cmd isNil ifTrue:[ + Dialog warn:'No viewer has been defined for pdf-files (See MIMETypes initialization).'. + ^ self. + ]. + fileNames := files collect: [:each | '"' , each asFilename pathName , '"' ]. + arg := fileNames asStringCollection asStringWith:' '. + + (cmd includesString:'"%1"') ifTrue:[ + cmd := cmd copyReplaceString:'"%1"' withString:'%1' + ]. [ - OperatingSystem - executeCommand:'acroread ' , fileNames asStringCollection asString. + OperatingSystem executeCommand:(cmd bindWith:arg). ] fork + + "Modified: / 12-05-2004 / 12:31:20 / cg" ! openRP @@ -6741,5 +6753,5 @@ !AbstractFileBrowser class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.230 2004-05-11 14:58:58 cg Exp $' + ^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.231 2004-05-12 10:21:08 cg Exp $' ! !