Slicer: 2145-support-for-installing-extension-from-file 35b30817

Author Committer Branch Timestamp Parent
finetjul finetjul 2145-support-for-installing-extension-from-file 2013-04-29 10:12:03 2145-support-for-installing-extension-from-file c4a16fba
Affected Issues 0003081: when dragging and dropping a dicom file or folder into slicer, the dicom widget should be invoked by default
Changeset

ENH: Add qSlicerScriptedFileDialog

  • Add qSlicerFileDialog::description
  • Add input dialog to select reader when multiple readers accept the same mime data

How to create a FileDialog in python?

+class XYZFileDialog:

  • def init(self, parent):
  • self.parent = parent
  • parent.fileType = 'XYZ'
  • parent.description = 'XYZ'
  • parent.action = slicer.qSlicerFileDialog.Read
  • def isMimeDataAccepted(self):
  • accept = self.parent.mimeData().hasFormat("text/uri-list")
  • self.parent.acceptMimeData(accept)
  • def dropEvent(self):
  • self.parent.dropEvent().accept()
  • def execDialog(self):
  • print 'exec'

How to order the list (make the module reader by default):
Make the module depend on "Data" -> instantiated after "Data" module
def init(self, parent):

  • parent.dependencies = ["Data"]

Issue 0003081

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21951 3bd1e089-480b-0410-8dfb-8563597acbee

mod - Base/QTCore/qSlicerCoreApplication.cxx Diff File
mod - Base/QTGUI/CMakeLists.txt Diff File
mod - Base/QTGUI/qSlicerDataDialog.cxx Diff File
mod - Base/QTGUI/qSlicerDataDialog.h Diff File
mod - Base/QTGUI/qSlicerFileDialog.cxx Diff File
mod - Base/QTGUI/qSlicerFileDialog.h Diff File
mod - Base/QTGUI/qSlicerIOManager.cxx Diff File
mod - Base/QTGUI/qSlicerModelsDialog.cxx Diff File
mod - Base/QTGUI/qSlicerModelsDialog.h Diff File
mod - Base/QTGUI/qSlicerSaveDataDialog.cxx Diff File
mod - Base/QTGUI/qSlicerSaveDataDialog.h Diff File
add - Base/QTGUI/qSlicerScriptedFileDialog.cxx Diff File
add - Base/QTGUI/qSlicerScriptedFileDialog.h Diff File
mod - Base/QTGUI/qSlicerScriptedLoadableModule.cxx Diff File
mod - Base/QTGUI/qSlicerScriptedLoadableModule.h Diff File