Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1197 #1207

Merged
merged 5 commits into from
Apr 9, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Packages/vcs/Lib/Canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,8 @@ def savecontinentstype(self,value):
self._savedcontinentstype = value

def onClosing( self, cell ):
if self.configurator:
self.endconfigure()
self.backend.onClosing( cell )

def _reconstruct_tv(self, arglist, keyargs):
Expand Down Expand Up @@ -3843,6 +3845,8 @@ def clear(self, *args, **kargs):
"""
if self.animate.created():
self.animate.close()
if self.configurator is not None:
self.configurator.stop_animating()
self.animate_info=[]
self.animate.update_animate_display_list( )
self.backend.clear(*args,**kargs)
Expand Down Expand Up @@ -3879,7 +3883,8 @@ def close(self, *args, **kargs):
#if (self.canvas_gui is not None):
# self.canvas_gui.dialog.dialog.withdraw() # just withdraw the GUI for later
# gui_canvas_closed = 0

if self.configurator:
self.endconfigure()
# Close the VCS Canvas
a = self.backend.close(*args,**kargs)

Expand Down
3 changes: 3 additions & 0 deletions Packages/vcs/Lib/configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ def update(self):
display._template_origin = new_template.name

def detach(self):
if self.interactor is None:
return

if self.animation_timer is not None:
self.stop_animating()

Expand Down
4 changes: 4 additions & 0 deletions testing/vcs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -511,4 +511,8 @@ cdat_add_test(vcs_test_taylor_2_quads
)
endif()

cdat_add_test(vcs_test_endconfigure
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_endconfigure.py
)
add_subdirectory(vtk_ui)
37 changes: 37 additions & 0 deletions testing/vcs/test_vcs_endconfigure.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import vcs, sys

class FakeConfigurator(object):
def __init__(self):
self.detached = False

def detach(self):
self.detached = True

x = vcs.init()

fake = FakeConfigurator()

x.configurator = fake
x.close()

if x.configurator is not None:
print "x.close() did not end configuration"
sys.exit(1)

if fake.detached == False:
print "x.close() did not detach configurator"
sys.exit(1)

fake = FakeConfigurator()
x.configurator = fake
x.onClosing(None)

if x.configurator is not None:
print "x.onClosing did not end configuration"
sys.exit(1)

if fake.detached == False:
print "x.onClosing() did not detach configurator"
sys.exit(1)

sys.exit(0)