Import 2017-06-07 23:51:09: master 1c10718f

Author Committer Branch Timestamp Parent
jcfr jcfr master 2014-08-30 22:45:34 master cc7e6208
Changeset

BUG: EditBox: Ensure state variable are initialized before calling "create()"

This commit fixes regression introduced by r23636.

The following tests are now passing:

  • py_StandaloneEditorWidgetTest
  • py_ThresholdThreadingTest
  • py_NeurosurgicalPlanningTutorialMarkupsSelfTest

The associated error was:

Traceback (most recent call last):
File "/path/to/Slicer-build/lib/Slicer-4.3/qt-scripted-modules/Editor.py", line 244, in setup
self.createEditBox()
File "/path/to/Slicer-build/lib/Slicer-4.3/qt-scripted-modules/Editor.py", line 280, in createEditBox
self.toolsBox = EditorLib.EditBox(self.editBoxFrame, optionsFrame=self.effectOptionsFrame)
File "/path/to/Slicer-build/lib/Slicer-4.3/qt-scripted-modules/EditorLib/EditBox.py", line 74, in init
self.create()
File "/path/to/Slicer-build/lib/Slicer-4.3/qt-scripted-modules/EditorLib/EditBox.py", line 289, in create
self._onParameterNodeModified(self.editUtil.getParameterNode())
File "/path/to/Slicer-build/lib/Slicer-4.3/qt-scripted-modules/EditorLib/EditBox.py", line 105, in _onParameterNodeModified
self._onEffectChanged(caller.GetParameter("effect"))
File "/path/to/Slicer-build/lib/Slicer-4.3/qt-scripted-modules/EditorLib/EditBox.py", line 336, in _onEffectChanged
if self.currentOption:
AttributeError: 'EditBox' object has no attribute 'currentOption'

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

mod - Modules/Scripted/EditorLib/EditBox.py Diff File