1960 |
1957 |
1961 openApplicationForDocument:aFilenameOrString operation:operationSymbol mimeType:mimeTypeStringArgOrNil ifNone:exceptionBlock |
1958 openApplicationForDocument:aFilenameOrString operation:operationSymbol mimeType:mimeTypeStringArgOrNil ifNone:exceptionBlock |
1962 "open a windows-shell/mac finder/desktop application to present the document contained in aFilenameOrString. |
1959 "open a windows-shell/mac finder/desktop application to present the document contained in aFilenameOrString. |
1963 This is typically used to present help-files, html documents, pdf documents etc. |
1960 This is typically used to present help-files, html documents, pdf documents etc. |
1964 operationSymbol is one of: |
1961 operationSymbol is one of: |
1965 open |
1962 open |
1966 edit |
1963 edit |
1967 explore |
1964 explore |
1968 mimeTypeStringArgOrNil is e.g. 'text/html' or: 'application/pdf'; |
1965 mimeTypeStringArgOrNil is e.g. 'text/html' or: 'application/pdf'; |
1969 if nil is passed in, the file's suffix is used to guess it. |
1966 if nil is passed in, the file's suffix is used to guess it. |
1970 " |
1967 " |
1971 |
1968 |
1972 | cmd | |
1969 | cmd | |
1973 |
1970 |
1974 cmd := self openApplicationHelperCommand. |
1971 cmd := self openApplicationHelperCommand. |
1975 cmd notNil ifTrue:[ |
1972 cmd notNil ifTrue:[ |
1976 (cmd includesSubString:'%1') ifTrue:[ |
1973 (cmd includesSubString:'%1') ifTrue:[ |
1977 cmd := cmd bindWith:aFilenameOrString asString. |
1974 cmd := cmd bindWith:aFilenameOrString asString. |
1978 ] ifFalse:[ |
1975 ] ifFalse:[ |
1979 cmd := cmd, ' "', aFilenameOrString asString, '"'. |
1976 cmd := cmd, ' "', aFilenameOrString asString, '"'. |
1980 ]. |
1977 ]. |
1981 (self |
1978 (self |
1982 startProcess:cmd |
1979 startProcess:cmd |
1983 inputFrom:nil outputTo:nil |
1980 inputFrom:nil outputTo:nil |
1984 errorTo:nil auxFrom:nil |
1981 errorTo:nil auxFrom:nil |
1985 environment: self getEnvironment inDirectory:nil) notNil ifTrue:[ ^ self ] |
1982 environment: self getEnvironment inDirectory:nil) notNil ifTrue:[ ^ self ] |
1986 ]. |
1983 ]. |
1987 ^ super openApplicationForDocument:aFilenameOrString operation:operationSymbol mimeType:mimeTypeStringArgOrNil ifNone:exceptionBlock |
1984 ^ super openApplicationForDocument:aFilenameOrString operation:operationSymbol mimeType:mimeTypeStringArgOrNil ifNone:exceptionBlock |
1988 |
1985 |
1989 |
1986 |
1990 " |
1987 " |
1999 ! |
1996 ! |
2000 |
1997 |
2001 openApplicationHelperCommand |
1998 openApplicationHelperCommand |
2002 "Return a command line helper to open a default application for file or URL" |
1999 "Return a command line helper to open a default application for file or URL" |
2003 |
2000 |
2004 | xdgCurrentDesktop | |
2001 | xdgCurrentDesktop usersPref | |
|
2002 |
|
2003 ((usersPref := UserPreferences current osFileExplorerCommand) notEmptyOrNil |
|
2004 and:[ self canExecuteCommand:(usersPref subStrings first) ]) ifTrue:[ |
|
2005 ^ usersPref |
|
2006 ]. |
2005 |
2007 |
2006 xdgCurrentDesktop := self getEnvironment: 'XDG_CURRENT_DESKTOP'. |
2008 xdgCurrentDesktop := self getEnvironment: 'XDG_CURRENT_DESKTOP'. |
2007 ((xdgCurrentDesktop = 'GNOME') and:[self canExecuteCommand: 'gnome-open']) ifTrue:[ |
2009 ((xdgCurrentDesktop = 'GNOME') and:[self canExecuteCommand: 'gnome-open']) ifTrue:[ |
2008 ^ 'gnome-open' |
2010 ^ 'gnome-open' |
2009 ]. |
2011 ]. |
2010 "/ Guess... |
2012 "/ Guess... |
2011 ((xdgCurrentDesktop = 'KDE') and:[self canExecuteCommand: 'kde-open']) ifTrue:[ |
2013 ((xdgCurrentDesktop = 'KDE') and:[self canExecuteCommand: 'kde-open']) ifTrue:[ |
2012 ^ 'kde-open' |
2014 ^ 'kde-open' |
2013 ]. |
2015 ]. |
2014 (self canExecuteCommand: 'xdg-open') ifTrue:[ |
2016 (self canExecuteCommand: 'xdg-open') ifTrue:[ |
2015 ^ 'xdg-open' |
2017 ^ 'xdg-open' |
|
2018 ]. |
|
2019 (self canExecuteCommand: 'nautilus') ifTrue:[ |
|
2020 ^ 'nautilus' |
2016 ]. |
2021 ]. |
2017 ^ nil |
2022 ^ nil |
2018 |
2023 |
2019 " |
2024 " |
2020 self openApplicationHelperCommand |
2025 self openApplicationHelperCommand |
13058 domain:nil type:nil protocol:nil flags:nil |
13062 domain:nil type:nil protocol:nil flags:nil |
13059 self getAddressInfo:'www.exept.de' serviceName:nil |
13063 self getAddressInfo:'www.exept.de' serviceName:nil |
13060 domain:#'AF_INET' type:nil protocol:nil flags:nil |
13064 domain:#'AF_INET' type:nil protocol:nil flags:nil |
13061 self getAddressInfo:'www.exept.de' serviceName:nil |
13065 self getAddressInfo:'www.exept.de' serviceName:nil |
13062 domain:#'AF_INET6' type:nil protocol:nil flags:nil |
13066 domain:#'AF_INET6' type:nil protocol:nil flags:nil |
13063 self getAddressInfo:'www.baden-württemberg.de' serviceName:nil |
13067 self getAddressInfo:'www.baden-württemberg.de' serviceName:nil |
13064 domain:#'AF_INET' type:#stream protocol:nil flags:nil |
13068 domain:#'AF_INET' type:#stream protocol:nil flags:nil |
13065 " |
13069 " |
13066 ! |
13070 ! |
13067 |
13071 |
13068 getNameInfo:socketAddress wantHostName:wantHostName wantServiceName:wantServiceName datagram:useDatagram flags:flags |
13072 getNameInfo:socketAddress wantHostName:wantHostName wantServiceName:wantServiceName datagram:useDatagram flags:flags |