With this XML I can specify a file name attribute for a plugin:
<StringVectorProperty name="AttributesFile" label="Attributes File" command="SetAttributesFile" number_of_elements="1"> <FileListDomain name="files"/> <Documentation> Specify a CSV file that contains the attributes to be assigned </Documentation> </StringVectorProperty>
ParaView will automatically generate the required widgets and functionality to allow the user to select a file.
What I like to achieve: Once the user has selected a filename with path, the program “remembers” it in the settings and presents it again if the plugin filter is used again, also after a program restart.
Saving to the settings can be achieved if I do it in the filter itself: In that case the saving occurs only if the user not only selects a file, but also presses “Apply” - which is ok.
However, for restoring the file name I see so far only one way: write my own property widget. I have done that many times, but I was asking myself if there isn’t a way that I can do that in a more simple way, like with some settings or code in the XML. Is there such a “secret trick”?