showFileSaveDialog doesn't honor "dir suggestion"

Hello,

I am trying to force the FileSaveDialog to jump to an inital directory. However, if I try to do plugins.file.showFileSaveDialog(‘C:/test.txt’), the dialog shows the correct filename (“test.txt”), but always jumps to the user’s home directory (documents and settings/…).

Can this be fixed, so that the full given path will be used?

Thanks
Patrick

I am having a similar problem on a Mac, running servoy 2.2.5 on Java 1.4.2-54.

Actually, I cannot get the filename suggestion to appear AT ALL - whether or not I include a directory. If I specify just the directory it works fine, but if I suggest a directory and a file (using the same syntax as above, e.g. a full file path), NEITHER is followed; I am taken to my home directory with no filename suggestion.

Is this a bug, or are we calling the function with incorrect arguments?

currently you can only specify the directory (know dir)
or specify a name and then the default dir is used.

I can change the second one so that it takes the parent dir from the file you give with it and use that as the default open dir.
The only problem is that when people do this: “text.txt” then the parent dir will i guess be the user.dir or something instead of the “My Documents”

I have to look what to do then.

tested it and it works fine
now the directory will be get from the suggested filename.

also improved it a bit more.
If you don’t specify a name/file with file open or save dialog. It will use the last one the user did choose.
So the dialog you use now of the plugin will always remember the last selected dir of the user and display that. Except of course if you override it yourself with a suggested dir.

amisle:
I am having a similar problem on a Mac, running servoy 2.2.5 on Java 1.4.2-54.

Actually, I cannot get the filename suggestion to appear AT ALL - whether or not I include a directory. If I specify just the directory it works fine, but if I suggest a directory and a file (using the same syntax as above, e.g. a full file path), NEITHER is followed; I am taken to my home directory with no filename suggestion.

Is this a bug, or are we calling the function with incorrect arguments?

If I remember well, it’s an historical bug of Apple’s JVM.

jcompagner:
…So the dialog you use now of the plugin will always remember the last selected dir of the user and display that. Except of course if you override it yourself with a suggested dir.

This improvement is very much appreciated. Thank you!

Dean

If I remember well, it’s an historical bug of Apple’s JVM.

I have been able to set/find a directory in my Java development…

IT2Be:

If I remember well, it’s an historical bug of Apple’s JVM.

I have been able to set/find a directory in my Java development…

But you can’t suggest the file name.

Not sure about that… Will have to test that.