Open,SaveFileRequester default path parent locked [Resolved]

Just starting out? Need help? Post your questions and find answers here.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Open,SaveFileRequester default path parent locked [Resolved]

Post 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
Last edited by Kwai chang caine on Wed Feb 10, 2010 6:18 pm, edited 1 time in total.
ImageThe happiness is a road...
Not a destination
y3an
User
User
Posts: 56
Joined: Sun Mar 09, 2008 6:06 am

Re: Open or SaveFileRequester default path parent locked

Post 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.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Open or SaveFileRequester default path parent locked

Post by Kwai chang caine »

:lol: :lol:
It's a good idea :D
ImageThe happiness is a road...
Not a destination
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Open or SaveFileRequester default path parent locked

Post 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?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Open or SaveFileRequester default path parent locked

Post 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)
ImageThe happiness is a road...
Not a destination
UserOfPure
Enthusiast
Enthusiast
Posts: 469
Joined: Sun Mar 16, 2008 9:18 am

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

Post 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. :)
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

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

Post by Kwai chang caine »

Yes it's also another solution :roll:
The user certainly like this :lol:

Thanks UserOfPure 8)
ImageThe happiness is a road...
Not a destination
Post Reply