Bug fix re profile loading if no registry keys found#1056
Bug fix re profile loading if no registry keys found#1056lansalot wants to merge 4 commits intoAgOpenGPS-Official:developfrom
Conversation
| if (RegistrySettings.vehicleFileName == "") | ||
| { | ||
| Log.EventWriter("No profile selected, prompt to create a new one"); | ||
| if (!Directory.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "agOpenGPS"))) |
There was a problem hiding this comment.
We should probably use RegistrySettings.baseDirectory here (or RegistrySettings.vehiclesDirectory)
There was a problem hiding this comment.
Sorry, I didn't mean line 530, I meant line 532. You shouldn't have to explicitly check for an "agOpenGPS" folder in "Documents", because that could be different.
|
@richardklasens: I did not yet approve this PR, because there is still an open comment. |
|
Seems there are a couple scenarios. One is there are no profiles to choose from, and second there are some however the registry says default. There also happens to be 2 forms, one for loading a profile, and one for making a new profile Every time the program is run, the first thing that occurs is if there are no registry keys, they are created again - so we know at the very least they are there. If not, the program stops anyway. So just as a suggestion, you can grab the vehicles directory from settings - no matter what is there - and then check if there are existing profiles there or if empty. If empty - up poops the new form Depending on the form about to arrive to them, throw up a message box. That might work, and you also won't be hardcoding directory names that may change or have been previously set to another directory. |
There is still an open comment that should be resolved.
Fixes #1055