Page 1 of 1

Open,SaveFileRequester default path parent locked [Resolved]

Posted: Wed Feb 10, 2010 12:25 pm
by Kwai chang caine
Hello at all the familly :D

My program need to load and save external file.
So for do this i use OpenFileRequester and SaveFileRequester.

But the problem is that i want to force the user to not load or save a file out of the directory of my program.

If i give a default path that's works, but the user can call the parent directory with a click on the arrow, or even enter another path in the path field, and press return and the OpenFileRequester, SaveFileRequester is out of my program

Have you a way for lock the path only on the default path and his child directory ?? :roll:

Have a good day

Re: Open or SaveFileRequester default path parent locked

Posted: Wed Feb 10, 2010 3:02 pm
by y3an
I think you should use the threat and the fear of death on the user.
Maybe you could add a message like " If you go out my directory, you will die hanged in a wardrobe, dressed as a woman. "

I hope it helped.

Re: Open or SaveFileRequester default path parent locked

Posted: Wed Feb 10, 2010 3:11 pm
by Kwai chang caine
:lol: :lol:
It's a good idea :D

Re: Open or SaveFileRequester default path parent locked

Posted: Wed Feb 10, 2010 5:48 pm
by IdeasVacuum
Does the User have to be involved in the process? If the User has to make a choice from only the files that you supply, why not offer that choice in a list view only, then let the code handle load and save?

Re: Open or SaveFileRequester default path parent locked

Posted: Wed Feb 10, 2010 6:17 pm
by Kwai chang caine
Yes you have right
I have believed it exist an API for restricted the path, but apparently not :(
So in this case, there is more simple, because all the child arborescence is managed.

So i do like you say, i create my PathRequester and only show the path that i want

Thanks at you two for your answer
I wish you a good day 8)

Re: Open,SaveFileRequester default path parent locked [Resolved]

Posted: Wed Feb 10, 2010 8:24 pm
by UserOfPure
You can still OpenFileRequester and SaveFileRequester, but then check the path selected. If GetPathPart() doesn't match your app's directory, show them a MessageRequester and get them to choose again. And again. And again. Until they do. :)

Re: Open,SaveFileRequester default path parent locked [Resolved]

Posted: Thu Feb 11, 2010 10:25 am
by Kwai chang caine
Yes it's also another solution :roll:
The user certainly like this :lol:

Thanks UserOfPure 8)