Spec icon indicating copy to clipboard operation
Spec copied to clipboard

Need defaultFolder: in SpDialog

Open Ducasse opened this issue 3 months ago • 1 comments

Hi

I wanted to fix the fact that when we use directory in epicea it opens on /users/ducasse instead of the image location so the user has to know that the pharo files are somewhere in the disc…. Basic UX I would say

https://github.com/pharo-project/pharo/issues/17381

Just one year ago…

So now I decided to fix it

I see the following

selectDirectory
	(self application selectDirectoryTitle: self directory basename)
		ifNotNil: [ :selectedDirectory | self directory: selectedDirectory ]

where

	(self application selectDirectoryTitle: self directory basename)

open the file browser in my home :(((((

	selectDirectoryTitle: aString 
		 ^ self newOpenFile title: aString; 
			 beOpenDirectory; openModal
	newOpenFile

		^ SpFileDialog newApplication: self

I do not understand the relationship between SpFileDialog and the SpFileDialogPresenter Because it lStFileDialogPresenter has a defaultFolder: method and it is doing what I want.

StFileDialogPresenter new 
	defaultFolder: FileLocator image parent asFileReference;
	openModal 

Is there a way to specify the location in the SpFileDialog?

Ducasse avatar Nov 22 '25 11:11 Ducasse

is the way

StOpenFileOrDirectoryPresenter new 
	title: 'Select a change file';
	defaultFolder: FileLocator image parent asFileReference;
	openModal 

Ducasse avatar Nov 22 '25 11:11 Ducasse