[Paraview] Standard OpenFile Dialogs

Mike Jackson imikejackson at gmail.com
Sun Jul 15 17:18:56 EDT 2007


Clinton
--  
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services


On Jul 14, 2007, at 12:10 PM, Clinton Stimpson wrote:

> Mike Jackson wrote:
>> A while back during a ParaView training I asked the same questions  
>> and got the same response. I agree with the reasoning. I am on OS  
>> X and one of the features that a native file dialog has are all my  
>> shortcuts that I am used to in the "Finder". During that same  
>> training one of the trainers asked me if I knew how to get that  
>> list. At the time I did not but now I do. Who should I work with  
>> or where do I add into the ParaView code to allow your file dialog  
>> to display this list? I see that by default my home folder is  
>> prepopulated in the list.
>>
>>   The concept/code is simple. You just have to parse a .plist file  
>> located at ~/Library/Preferences/com.apple.sidebarlists.plist.  
>> This list is binary so some Apple APIs will be needed to parse the  
>> list.
> In ParaView3/Servers/Common/vtkPVFileInformation.cxx, the  
> GetSpecialDirectories() can be implemented for Mac OS X.
> Both client and server side file browsing use that.
> Sounds like it should be pretty simple.  You can make a bug tracker  
> item and if you implement it, attach the patch.
>
> Clint

Clinton
    I spent some time getting to know CoreFoundation this weekend and  
I came up with some code that will display what the user has in their  
"sidebar" in the finder in the ParaView File Dialogs. The code was  
taken mostly from Apple examples and is long and tedious. I did not  
do much more that write it and test it on OS X 10.4.10 Intel. The  
code is almost 200 lines long. I was not sure about how ParaView's  
design philosophy is but I was tempted to break all this mac code out  
into its own source file. Maybe we could do the same for windows? I  
did add two new private methods for OS X only that help break up what  
I am trying to do. I am attaching the two files as I have never used  
diff and now is not a good time to learn. I started out with the  
ParaView 3.1.0 July Snap shot.

I also have a small qualm about the ParaView File Dialog. In the  
Filter drop down list, the list is as wide as my monitor because  
ParaView seems to want to make one giant string out of all the  
extensions. I can patch the file easy enough but we should discuss  
what is the "correct" thing to do on OS X.

Lastly, if the method void vtkPVFileInformation::GetDirectoryListing 
() I also patched so that on OS X hidden directories are not listed,  
as this is the default user experience on OS X.

Thanks for the help with where to patch into the code. I hope this  
code can make it into the next branch/release of ParaView.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkPVFileInformation.cxx
Type: application/octet-stream
Size: 33050 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/paraview/attachments/20070715/119b3193/vtkPVFileInformation-0002.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkPVFileInformation.h
Type: application/octet-stream
Size: 3586 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/paraview/attachments/20070715/119b3193/vtkPVFileInformation-0003.obj
-------------- next part --------------

-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services



More information about the ParaView mailing list