FileBrowser.st
changeset 18263 cdd0584fff3a
parent 18027 4be2b1bb3a66
child 18427 f1e576436ad5
equal deleted inserted replaced
18262:18e456b91b31 18263:cdd0584fff3a
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1991 by Claus Gittinger
     4  COPYRIGHT (c) 1991 by Claus Gittinger
     3               All Rights Reserved
     5               All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
  5336      action ..."
  5338      action ..."
  5337 
  5339 
  5338     |cmd|
  5340     |cmd|
  5339 
  5341 
  5340     (aFilename asFilename hasSuffix:'pdf') ifTrue:[
  5342     (aFilename asFilename hasSuffix:'pdf') ifTrue:[
  5341         cmd := MIMETypes defaultCommandPerMIME at:'application/pdf' ifAbsent:nil.
  5343         cmd := MIMETypes defaultCommandTemplateToOpenMimeType:'application/pdf'.
  5342         cmd notNil ifTrue:[
  5344         cmd notNil ifTrue:[
  5343             (OperatingSystem 
  5345             (OperatingSystem 
  5344                 executeCommand:(cmd bindWith:aFilename with:Screen current displayName) 
  5346                 executeCommand:(cmd bindWith:aFilename with:Screen current displayName) 
  5345                 inDirectory:currentDirectory)
  5347                 inDirectory:currentDirectory)
  5346             ifTrue:[^true].
  5348             ifTrue:[^true].
  5351         (OperatingSystem executeCommand:aFilename inDirectory:currentDirectory)
  5353         (OperatingSystem executeCommand:aFilename inDirectory:currentDirectory)
  5352         ifTrue:[^true].
  5354         ifTrue:[^true].
  5353     ].
  5355     ].
  5354     ^ self imageAction:aFilename
  5356     ^ self imageAction:aFilename
  5355 
  5357 
  5356     "Modified: 19.6.1996 / 09:44:07 / cg"
  5358     "Modified: / 19-06-1996 / 09:44:07 / cg"
  5357     "Modified: 18.9.1997 / 17:18:04 / stefan"
  5359     "Modified: / 18-09-1997 / 17:18:04 / stefan"
       
  5360     "Modified: / 09-07-2018 / 11:17:20 / Stefan Vogel"
  5358 !
  5361 !
  5359 
  5362 
  5360 doExecuteCommand:commandArg replace:replace
  5363 doExecuteCommand:commandArg replace:replace
  5361     "execute a unix command inserting the output of the command.
  5364     "execute a unix command inserting the output of the command.
  5362      If replace is true, all text is replaced by the commands output;
  5365      If replace is true, all text is replaced by the commands output;