Remove unnecessary complex code and test to now simply #openInOSFileBrowser in more recent versions of Pharo
Fix
DELETE
src/PharoLauncher-Core/PhLFileBrowser.class.st
-"
-I'm a simple visitor in charge of opening an operating system browser on the provided path string.
-"
-Class {
- #name : #PhLFileBrowser,
- #superclass : #OSPlatformVisitor,
- #instVars : [
- 'process',
- 'vmPath',
- 'launchInALoginShell',
- 'imageFile',
- 'usePharoSettings',
- 'path'
- ],
- #category : #'PharoLauncher-Core-Model'
-}
-
-{ #category : #'instance creation' }
-PhLFileBrowser class >> openOn: aFileReferenceOrPathString [
-
- ^ self new
- path: aFileReferenceOrPathString;
- open.
-]
-
-{ #category : #action }
-PhLFileBrowser >> open [
- self visit
-]
-
-{ #category : #accessing }
-PhLFileBrowser >> path: aFileReferenceOrPathString [
- "Opens an OS-specific file and directory browser on ==aFileReference==. If aFileReference is a file, opens the browser on its containing directory instead."
- | ref |
- aFileReferenceOrPathString isNil ifTrue: [ ^ nil ].
- ref := aFileReferenceOrPathString asFileReference.
- ref exists ifFalse: [ ^ nil ].
-
- ref := ref isFile ifTrue: [ ref parent ] ifFalse: [ ref ].
- (ref isNil or: [ ref exists not ])
- ifTrue: [ ^ nil ].
-
- path := ref fullName.
-]
-
-{ #category : #visiting }
-PhLFileBrowser >> visitMacOS: aPlatform [
- ^ PhLProcessWrapper new
- shellCommand;
- addArgument: ('open "{1}"' format: {path});
- runUnwatch
-]
-
-{ #category : #visiting }
-PhLFileBrowser >> visitUnix: aPlatform [
- ^ PhLProcessWrapper new
- shellCommand;
- addArgument: ('xdg-open "{1}"' format: {path});
- runUnwatch
-]
-
-{ #category : #visiting }
-PhLFileBrowser >> visitWindows: aPlatform [
- ^ aPlatform privShellExplore: path
-]

MODIFY
src/PharoLauncher-Core/PhLImage.class.st
src/PharoLauncher-Core/PhLImage.class.st
@@ -479,7 +479,7 @@ PhLImage >> shouldRunInitializationScript: aBoolean [
{ #category : #printing }
PhLImage >> showNativeFolder [
- PhLFileBrowser openOn: file
+ file asFileReference openInOSFileBrowser
]
{ #category : #'private ui' }

MODIFY
src/PharoLauncher-Core/PhLVirtualMachine.class.st
src/PharoLauncher-Core/PhLVirtualMachine.class.st
@@ -356,7 +356,7 @@ PhLVirtualMachine >> removeFromSystem [
{ #category : #actions }
PhLVirtualMachine >> showInFolder [
- PhLFileBrowser openOn: self vmStore / self id
+ (self vmStore / self id) asFileReference openInOSFileBrowser
]
{ #category : #'ston persistence' }

MODIFY
src/PharoLauncher-Core/WinPlatform.extension.st
src/PharoLauncher-Core/WinPlatform.extension.st
@@ -9,30 +9,6 @@ WinPlatform >> hostArchitecture [
^ processorArch
]
-{ #category : #'*PharoLauncher-Core' }
-WinPlatform >> privShellExecute: lpOperation file: lpFile parameters: lpParameters directory: lpDirectory show: nShowCmd [
-
- ^self ffiCall: #(
- FFIConstantHandle ShellExecuteA(
- 0,
- char* lpOperation,
- char* lpFile,
- char* lpParameters,
- char* lpDirectory,
- int nShowCmd)) module: #shell32
-
-
-]
-
-{ #category : #'*PharoLauncher-Core' }
-WinPlatform >> privShellExplore: folder [
- "
- self privShellExplore: 'c:\'
- "
-
- ^self privShellExecute: 'explore' file: folder parameters: '' directory: '' show: 5 "SW_SHOW"
-]
-
{ #category : #'*PharoLauncher-Core' }
WinPlatform >> uname [
^ PhLVmProvider osWindows

DELETE
src/PharoLauncher-Tests-Core/PhLFileBrowserTest.class.st
-Class {
- #name : #PhLFileBrowserTest,
- #superclass : #TestCase,
- #category : #'PharoLauncher-Tests-Core'
-}
-
-{ #category : #tests }
-PhLFileBrowserTest >> testCanOpenAFileBrowserOnImageFolder [
- | path |
- path := Smalltalk image imageDirectory fullName.
- PhLFileBrowser openOn: path.
-]

Remove unnecessary complex code and test to now simply #openInOSFileBrowser in more recent versions of Pharo (#569)

Fix #568