Environment Variables in Statefile Data paths, Missing data visual indicator, scroll long lists
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
PROBLEM: Saved state files are written with full data paths, requiring adjustment if moved. No visible indication if reloaded data paths are valid. If 10+ data files in state file, list becomes too long for screen size, no scrolling facility.
SOLUTION: Add environment variable support in data path names, making state files portable. Add visual RED/GREEN indicated for valid data paths, add Qt scrollbar.
PATCH: patched files: pqFixStateFilenamesDialog.[h,cxx], vtkSMStateLoader.cxx action: copy pqFixStateFilenamesDialog to ParaView-3.14.0\Qt\Components copy vtkSMStateLoader to ParaView-3.14.0\ParaViewCore\ServerManager
DESCRIPTION: State files with filenames often require to be updated with locations of used files on new machine. Our
patch makes this process easier and faster by allowing pathnames to contain environment variables and by adding
indicators to "Fix Paths in State File" dialog about missing filename or directory. Also, scrolling area is added
to the dialog to handle cases if there is large number of input files specified in state file. In case of environment
variables, supported syntax is %VAR_NAME%, ${VAR_NAME} and $VAR_NAME. In the latest case ($VAR_NAME), VAR_NAME must be
from [a-zA-Z0-9_-]+ language. Beside each filename box in "Fis Paths in State File" dialog is added indicator which
when its green, currently specified file / directory is found on current machine. If it is yellow, it should be checked
because algorithm was unable to check if it is semantically correct, and if it is red, user shoud double-check and
possibly replace content of appropriate text-box. Also, if environment variables are present, they are replaced with
its content (value).
CHANGES: To make this patch, following changes were made (ParaView source patch):
- QMap<pqFileChooserWidget*, QLabel*> IndicatorsMappings parameters is added to pqFixStateFilenamesDialog
class declaration in pqFixStateFilenamesDialog.h,
- QMap, pqFileChooserWidget and QLabel classes are included at the beginning of pqFixStateFilenamesDialog.h,
- At the beginning of the file pqFixStateFilenamesDialog.cxx, new function is added SetIndicator() which
initializes indicator's color for passed content of text-box,
- At the beginning of the file pqFixStateFilenamesDialog.cxx, new function is added ResolveEnvironmentVariables()
which replaces environment variables from input strings with environment variable's contents,
- In pqFixStateFilenamesDialog class constructor, ResolveEnvironmentVariables() is called to resolve environment
variables in every path,
- In pqFixStateFilenamesDialog class constructor, QScrollArea is added and populated by group-boxes,
- In pqFixStateFilenamesDialog class constructor, IndicatorsMappings table is populated and indicators are
initialized and
- In pqFixStateFilenamesDialog::onFileNamesChanged() is added logic for setting indicator green if file exists
or red if file doesn't exist.
- Added ResolveEnvironmentVariables() and TraverseTree() routines at the beginning of vtkSMStateLoader.cxx. Also
added calling of TraverseTree() in vtkSMStateLoader::LoadStateInternal() routine.