AbstractFileBrowser.st
changeset 5836 922c94b683a1
parent 5832 9de8aba50b6b
child 5843 faf292b20c14
equal deleted inserted replaced
5835:228d78813972 5836:922c94b683a1
  5451             inDirectory:(files first asFilename directory).
  5451             inDirectory:(files first asFilename directory).
  5452     ] fork
  5452     ] fork
  5453 !
  5453 !
  5454 
  5454 
  5455 openPDFViewer
  5455 openPDFViewer
  5456     |files fileNames|
  5456     |files fileNames cmd arg|
  5457 
  5457 
  5458     files := self currentSelectedFiles.
  5458     files := self currentSelectedFiles.
  5459     (files isEmpty) ifTrue:[
  5459     (files isEmpty) ifTrue:[
  5460         ^ self.
  5460         ^ self.
  5461     ].
  5461     ].
       
  5462     cmd := MIMETypes defaultCommandForMimeType:'application/pdf'.
       
  5463     cmd isNil ifTrue:[
       
  5464         Dialog warn:'No viewer has been defined for pdf-files (See MIMETypes initialization).'.
       
  5465         ^ self.
       
  5466     ].
       
  5467 
  5462     fileNames := 
  5468     fileNames := 
  5463         files 
  5469         files 
  5464             collect:
  5470             collect:
  5465                 [:each |
  5471                 [:each |
  5466                     '"' , each asFilename pathName , '"'
  5472                     '"' , each asFilename pathName , '"'
  5467                 ].
  5473                 ].
       
  5474     arg := fileNames asStringCollection asStringWith:' '.
       
  5475 
       
  5476     (cmd includesString:'"%1"') ifTrue:[
       
  5477         cmd := cmd copyReplaceString:'"%1"' withString:'%1'    
       
  5478     ].
  5468 
  5479 
  5469     [
  5480     [
  5470         OperatingSystem 
  5481         OperatingSystem executeCommand:(cmd bindWith:arg).
  5471             executeCommand:'acroread ' , fileNames asStringCollection asString.
       
  5472     ] fork
  5482     ] fork
       
  5483 
       
  5484     "Modified: / 12-05-2004 / 12:31:20 / cg"
  5473 !
  5485 !
  5474 
  5486 
  5475 openRP
  5487 openRP
  5476     self openOSCommandWithFiles:'realplay'
  5488     self openOSCommandWithFiles:'realplay'
  5477 !
  5489 !
  6739 ! !
  6751 ! !
  6740 
  6752 
  6741 !AbstractFileBrowser class methodsFor:'documentation'!
  6753 !AbstractFileBrowser class methodsFor:'documentation'!
  6742 
  6754 
  6743 version
  6755 version
  6744     ^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.230 2004-05-11 14:58:58 cg Exp $'
  6756     ^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.231 2004-05-12 10:21:08 cg Exp $'
  6745 ! !
  6757 ! !