jessaskey/mhedit

Add 'last folder' memory in Open Dialogs

jessaskey opened this issue · 7 comments

MAINFORM: When the user opens/saves either a Maze or MazeCollection, the program should remember the last browsed to folder location so subsequent opens/saves default to that same folder. Use an app setting with a blank default. Upon Open/Save as long as the saved location (blank on first run) is valid (this should be checked with Directory.Exists() ) then that location will be the default.

I'm going to assume that you want it to remember the path through an app restart. Let me know if you were thinking differently.

Also, If we store the path over app restart there isn't a need to have default path code, It will just be the setting default value. Where would you like that default path to point?

Yeah, you can use the whole Properties.Settings.Default object which is used heavily in the DialogConfiguration. That ends up storing it in the users Application.config file so it keeps around from run to run.

Ah, good, I was wondering if you were using that subsystem somewhere. I could add a setting value for the default path. If I did that, I'd expect that to be chosen each time the app loads, and frankly that would seem to make more sense to me from a user standpoint.

And then on any of the 'OpenDialog' calls, if they click on 'OK', then that setting should be updated at that time... so essentially, they will always be where they left off, even after an app close as you mention.

So that's a bit different than I was thinking - modeling it off of an existing app like VS. In VS the setting is used each time the app boots, if someone changes the dir then that value is retained until app close and on restart the setting value is used. That feels more natural than updating the setting on OK.

For our situation you could set it to the template dir you always want and get the same results. In the future when there might be multiple template sub dirs this allows the setting to get the user to the parent every time the app starts.

Does that make sense?

Ok, give that change a shot and let me know if it's good or what you'd like changed.

So the changes I made so far just designate a default location for the Template ROMs. I still need to add a default location for Maze/Collection file storage on boot to the settings. Then use the last used during runtime.