|Anonymous | Login||2017-07-23 11:44 EDT|
|My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0010015||ParaView||Feature||public||2009-12-09 01:16||2016-08-12 09:57|
|Assigned To||Berk Geveci|
|Target Version||Fixed in Version|
|Summary||0010015: Enable ParaView to handle OpenDocuments/OpenFiles events on Mac OS X|
|Description||It would be nice if users of Mac OS X where able to double-click files to open them in ParaView. The patch maintained in|
implements the following:
- A function to handle the Carbon OpenDocuments event.
- A method that is injected into QCocoaApplicationDelegate to replace the application:openFiles: method to handle the Cocoa-event.
- The pqOpenFilesEvent event class which holds a QStringList with the names of all files the application should open which gets sent to the QApplication object by above two functions.
Further, for the ParaView application, an extended Info.plist file is added, associating many (I hope I got them all) file types with ParaView. For VTK and OpenFOAM files I also added icons in Common/DocumentIcons.
|Additional Information||On Mac OS X, if a user opens a file from the Finder (or uses the "open" command), the system sends an OpenDocuments event to the application (kAEOpenDocuments in Carbon) which gets translated into a call to the openFiles method of the application delegate if using Cocoa.|
Qt has its own event type for this (QFileOpenEvent), but unfortunately translates a single Apple-event with multiple files (i.e. the user opened multiple files at once) into multiple QFileOpenEvent's with a single file each. This makes it look like the user opened many files sequentially, making it impossible for the user to open e.g. a time-series of .vtk files.
For this reason it is necessary to change the default-behavior of Qt for this event. In the Carbon case, this is rather easily achieved by registering a different function for the kAEOpenDocuments event. If using Cocoa, however, there is only a single application-delegate object. When an event occurs, Cocoa calls a corresponding method of this object, allowing it to handle this event. Since this delegate-class is internal to Qt, one can't simply subclass it to override the application:openFiles: method. Either one has to re-implement the whole delegate class, or use the Objective-C runtime to inject a customized implementation into the class, replacing the original. For simplicity I chose the latter.
|Tags||No tags attached.|
Kitware Robot (administrator)
Resolving issue as `moved`.
This issue tracker is no longer used. Further discussion of this issue may take place in the current ParaView Issues page linked in the banner at the top of this page.
|2009-12-09 01:16||Michael Wild||New Issue|
|2009-12-09 10:39||Utkarsh Ayachit||Status||backlog => tabled|
|2009-12-09 10:39||Utkarsh Ayachit||Assigned To||=> Berk Geveci|
|2011-06-16 13:10||Zack Galbreath||Category||Feature Request => Feature|
|2016-08-12 09:57||Kitware Robot||Note Added: 0037756|
|2016-08-12 09:57||Kitware Robot||Status||expired => closed|
|2016-08-12 09:57||Kitware Robot||Resolution||open => moved|
|Copyright © 2000 - 2017 MantisBT Team|