UnixOperatingSystem.st
changeset 18923 fc32a7567437
parent 18758 fd717520a5ef
child 18930 59e70e261e49
child 19044 318352c827d7
--- a/UnixOperatingSystem.st	Thu Nov 19 12:24:04 2015 +0100
+++ b/UnixOperatingSystem.st	Thu Nov 19 14:56:31 2015 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1988 by Claus Gittinger
 	      All Rights Reserved
@@ -625,7 +623,6 @@
 ! !
 
 !UnixOperatingSystem primitiveFunctions!
-
 %{
 
 /*
@@ -1962,9 +1959,9 @@
     "open a windows-shell/mac finder/desktop application to present the document contained in aFilenameOrString.
      This is typically used to present help-files, html documents, pdf documents etc.
      operationSymbol is one of:
-	open
-	edit
-	explore
+        open
+        edit
+        explore
      mimeTypeStringArgOrNil is e.g. 'text/html' or: 'application/pdf';
      if nil is passed in, the file's suffix is used to guess it.
     "
@@ -1973,16 +1970,16 @@
 
     cmd := self openApplicationHelperCommand.
     cmd notNil ifTrue:[
-	(cmd includesSubString:'%1') ifTrue:[
-	    cmd := cmd bindWith:aFilenameOrString asString.
-	] ifFalse:[
-	    cmd := cmd, ' "', aFilenameOrString asString, '"'.
-	].
-	(self
-		startProcess:cmd
-		inputFrom:nil outputTo:nil
-		errorTo:nil auxFrom:nil
-		environment: self getEnvironment inDirectory:nil) notNil ifTrue:[ ^ self ]
+        (cmd includesSubString:'%1') ifTrue:[
+            cmd := cmd bindWith:aFilenameOrString asString.
+        ] ifFalse:[
+            cmd := cmd, ' "', aFilenameOrString asString, '"'.
+        ].
+        (self
+            startProcess:cmd
+            inputFrom:nil outputTo:nil
+            errorTo:nil auxFrom:nil
+            environment: self getEnvironment inDirectory:nil) notNil ifTrue:[ ^ self ]
     ].
     ^ super openApplicationForDocument:aFilenameOrString operation:operationSymbol mimeType:mimeTypeStringArgOrNil ifNone:exceptionBlock
 
@@ -2001,18 +1998,26 @@
 openApplicationHelperCommand
     "Return a command line helper to open a default application for file or URL"
 
-    | xdgCurrentDesktop |
+    | xdgCurrentDesktop usersPref |
+
+    ((usersPref := UserPreferences current osFileExplorerCommand) notEmptyOrNil
+    and:[ self canExecuteCommand:(usersPref subStrings first) ]) ifTrue:[
+        ^ usersPref
+    ].    
 
     xdgCurrentDesktop := self getEnvironment: 'XDG_CURRENT_DESKTOP'.
     ((xdgCurrentDesktop = 'GNOME') and:[self canExecuteCommand: 'gnome-open']) ifTrue:[
-	^ 'gnome-open'
+        ^ 'gnome-open'
     ].
     "/ Guess...
     ((xdgCurrentDesktop = 'KDE') and:[self canExecuteCommand: 'kde-open']) ifTrue:[
-	^ 'kde-open'
+        ^ 'kde-open'
     ].
     (self canExecuteCommand: 'xdg-open') ifTrue:[
-	^ 'xdg-open'
+        ^ 'xdg-open'
+    ].
+    (self canExecuteCommand: 'nautilus') ifTrue:[
+        ^ 'nautilus'
     ].
     ^ nil
 
@@ -2024,7 +2029,6 @@
     "
 
     "Created: / 13-01-2015 / 09:02:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-
 ! !
 
 !UnixOperatingSystem class methodsFor:'error messages'!
@@ -9535,7 +9539,7 @@
      Codeset := #'utf8-mac'.
      CodesetEncoder := nil.
      OperatingSystem getCodesetEncoder
-     OperatingSystem encodePath:'äöü'
+     OperatingSystem encodePath:'äöü'
     "
 
     "Modified: / 23-01-2013 / 10:00:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -13060,7 +13064,7 @@
 	    domain:#'AF_INET' type:nil protocol:nil flags:nil
      self getAddressInfo:'www.exept.de' serviceName:nil
 	    domain:#'AF_INET6' type:nil protocol:nil flags:nil
-     self getAddressInfo:'www.baden-württemberg.de' serviceName:nil
+     self getAddressInfo:'www.baden-württemberg.de' serviceName:nil
 	    domain:#'AF_INET' type:#stream protocol:nil flags:nil
     "
 !