Mantis - tweak
Viewing Issue Advanced Details
1468 Any trivial always 07-15-05 01:32 07-15-05 02:31
0001468: filedialog - multiple InvalidDirectoryErrors when we should get only one or none, imo.
when initializing a filedialog with an invalid directory,
the user gets the following aptly-titled dialog:
"An problem has occured: InvalidDirectoryError" [sic].

.. Which is possibly reasonable, altho personally i would prefer
not to be notified of that and just have the browser choose either
the current directory or the root directory as default.

However, the error dialog must be "Abort"ed three times before
it finally goes away and all is finally well with the world.

Why are you initializing a dialog with an invalid directory you ask ?

our app keeps track of a 'user's last directory' so that the filebrowser
opens up in a convenient spot.
We then use the app to load a default scene, say, and save the resulting squeak image.
We then pass that .image on to a user, who possibly installs it in a different location.

True, we should check the directory before trying to browse it,
but since we're obviously going to choose some default directory,
i think the file browser could just do that rather than sending up
scary-looking errors in triplicate.

07-15-05 02:11   
A very simple solution to this problem is to add a line saying:

   lastUsedDirectory exist
      ifFalse:[lastUsedDirectory := FileDirectory default].

and only then:

   fileDialog directory: lastUsedDirectory.
07-15-05 02:18   
thanks andreas.

i agree,
i just think that functionality should be in the dialog,
with perhaps one notification if the problem occurs.
07-15-05 02:28   
Yes I agree, something needs to be done here but I was just trying to be helpful and offer a workaround for the short term ;-)
07-15-05 02:31   
roger, thanks!