Hi all,
to my knowledge, PluggableFileList should be deprecated and removed (see PluggableFileList>>#open). At the moment, it is only referenced from MVCProject>>#findAFolderForProject:label:. If I try to run that in MVC, I get an #errorEmptyCollection from MVCToolBuilder>>setLayout:in:. Could we just migrate MVCProject>>#findAFolderForProject:label: to use DirectoryChooserDialog? Because MVC does not support tree widgets, users could only enter a path string there, but the current way is broken anyway, and to be honest I don't know whether anyone wants to save an MVC project ...
Best, Christoph
--- Sent from Squeak Inbox Talk
Sure, go ahead :-)
Best, Marcel Am 17.05.2023 20:56:10 schrieb christoph.thiede@student.hpi.uni-potsdam.de christoph.thiede@student.hpi.uni-potsdam.de: Hi all,
to my knowledge, PluggableFileList should be deprecated and removed (see PluggableFileList>>#open). At the moment, it is only referenced from MVCProject>>#findAFolderForProject:label:. If I try to run that in MVC, I get an #errorEmptyCollection from MVCToolBuilder>>setLayout:in:. Could we just migrate MVCProject>>#findAFolderForProject:label: to use DirectoryChooserDialog? Because MVC does not support tree widgets, users could only enter a path string there, but the current way is broken anyway, and to be honest I don't know whether anyone wants to save an MVC project ...
Best, Christoph
--- Sent from Squeak Inbox Talk [https://github.com/hpi-swa-lab/squeak-inbox-talk]
Hi Marcel,
upon closer investigation, I discovered that PluggableFileList still works well for MVC and could be a suitable implementation for the relevant protocols in Project/UIManager. See Tools-ct.1209 which makes Project>>#findAFolderForProject:label: work again in MVC (even though you see a DeprecationWarning first).
Current state:
* Project>>#findAFolderForProject:label: dispatchs to DirectoryChooserDialog (ToolBuilder-Morphic) for Morphic and to PluggableFileList (Tools) for MVC. * PluggableFileList is marked for deprecation but not yet in a Deprecated package. It has no other non-deprecated senders than MVCProject>>#findAFolderForProject:label:. * UIManager>>#chooseDirectory.../chooseFile.../saveFilename... dispatch to DirectoryChooserDialog/FileChooserDialog/FileSaverDialog(FileAbstractSelectionDialog) (ToolBuilder-Morphic) for Morphic and are #notYetImplemented for MVC (just #saveFilenameRequest:initialAnswer: falls back to #request:). * DirectoryChooserDialog et al. are in ToolBuilder-Morphic but are implemented through the ToolBuilder, they do not depend on Morphic. However, they don't work in MVC because PluggableDialogSpec is not properly built and opened there. (This should however be possible through ModalSystemWindowView which PluggableFileListView, the MVC backend for PluggableFileList, inherits from.)
Suggested solution:
* Instead of deprecating PluggableFileList, move it to ST80, keep using it in MVCProject>>#findAFolderForProject:label:, and start using it in MVCUIManager>>#chooseDirectory.../chooseFile.../saveFilename.... We can keep it in use until MVC has proper support for PluggableDialogSpec and can deal with the layout of our file dialogs (and if this never happens, we have a nice UI anyway.) We could also add an MVC/ST80 prefix to the class to avoid confusion if necessary. * Move FileAbstractSelectionDialog and subclasses from ToolBuilder-Morphic to a new package ToolBuilder-Kernel and move up MorphicUIManager>>#chooseDirectory.../chooseFile.../saveFilename... which dispatch to them to UIManager, so that any other Project type will automatically use them as well. (Even if a project does not support modal dialogs, we can map the interaction and validation logic of our file dialogs to simple UIManager requests in 5 lines - see attachment.) This will make ToolBuilder-Kernel more dependent on Files, unfortunately. Alternatively, create a new Files-Tools package for the dialogs and make #chooseDirectory... et al. extension methods analogously to #request:regex:? * At any future point in time, optionally provide a suitable implementation of MVCToolBuilder>>#buildPluggableDialog: using ModalSystemWindowView and deprecate/delete PluggableFileList and PluggableFileListView. But I personally do not feel like committing to that. :-)
Looking forward to your feedback! :-)
Best, Christoph
On 2023-05-19T17:35:22+02:00, marcel.taeumel@hpi.de wrote:
Sure, go ahead :-)
Best, Marcel Am 17.05.2023 20:56:10 schrieb christoph.thiede(a)student.hpi.uni-potsdam.de <christoph.thiede(a)student.hpi.uni-potsdam.de>: Hi all,
to my knowledge, PluggableFileList should be deprecated and removed (see PluggableFileList>>#open). At the moment, it is only referenced from MVCProject>>#findAFolderForProject:label:. If I try to run that in MVC, I get an #errorEmptyCollection from MVCToolBuilder>>setLayout:in:. Could we just migrate MVCProject>>#findAFolderForProject:label: to use DirectoryChooserDialog? Because MVC does not support tree widgets, users could only enter a path string there, but the current way is broken anyway, and to be honest I don't know whether anyone wants to save an MVC project ...
Best, Christoph
Sent from Squeak Inbox Talk [https://github.com/hpi-swa-lab/squeak-inbox-talk]
["FileAbstractSelectionDialog-getSimpleUserResponse.st"]
squeak-dev@lists.squeakfoundation.org