Closed thanneken closed 5 years ago
If no prefs file is detected, the new one created for users will have the default values.
As for defaulting with a relative path for the preferences that are directories, we could do that and if bundled those default values would work. In the logic, the tests for those variables are
while(prefVar.equals("") || !prefFile.exists()) {
OpenDialog dialog2 = new OpenDialog("Locate File");
if(null==dialog2.getPath()){
//@userHitCancel
WindowManager.closeAllWindows();
IJ.error("You must provide the file location to continue. Exiting...");
throw new Throwable("You must provide the file location to continue.");
}
prefVar = dialog2.getPath();
prefFile = new File(prefVar);
}
so if we provide a default that does not exist OR use a blank, the plugin will know to ask for it when and while it needs it. I am leaving those directory preferences blank by default for now.
I also notice that when I brought the preferences functionality over, it always assumed the preference file was in the base fiji folder.
We can move detection into the project folder so that each project can have its own preference file if that is desirable.
Reviewed and fixed some behavior, check and see if this works closer to how you want.
I deleted the old prefs file before running. I think it works well now. I'll add a bit more explanation to the documentation.
Every new user will start with no prefs file. In this circumstance the Consult Preferences dialog shows no default values. At least some should be easy. Some of these are already defaulted at other points, but the user won't know that and might try to find and complete all these fields before proceeding.
JP2 compressor. Will it accept a relative path if we bundle it? It would have to know whether it is running on Windows, Mac, Ubuntu, or Centos. JP2 arguments: The default values offered elsewhere should be offered here. HSH Fitter: We can bundle this too, although I think it will only work smoothly on Windows. JPEG Quality: Can we use a slider rather than a text box? People don't seem to agree whether the scale goes to 10 or 100. Let's set the default (whether slider or field) to 90. HSH Order: Default to 3 (candidate for removing other options) HSH Threads: Default to 16 (candidate for removing other options) WebRTI Maker: This too can be bundled, only simple on Windows.
I don't see any tooltips or help buttons. I think this would be a good place to explain (or link to an explanation) of what these are, when they are necessary, and how to get them.
It writes the following prefs file (Windows):
The forward slashes in preferredCompress don't seem fatal, but the lack of any kind of separators in preferredFitter can't be good. It should be: