Skip to content

Commit

Permalink
Fix calls to createDialogByName.
Browse files Browse the repository at this point in the history
Refs #9756
  • Loading branch information
martyngigg committed Jun 30, 2014
1 parent c6fc975 commit e8b6857
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions Code/Mantid/MantidPlot/test/MantidPlotAlgorithmDialogTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ class MantidPlotAlgorithmDialogTest(unittest.TestCase):

def test_OpenDialog(self):
interface_manager = mantidqtpython.MantidQt.API.InterfaceManager()
dialog = threadsafe_call( interface_manager.createDialogFromName, self.__target_algorithm__, self.__clean_properties__)
parent = None
dialog = threadsafe_call( interface_manager.createDialogFromName, self.__target_algorithm__, parent, self.__clean_properties__)
is_instance_of_alg_dialog = isinstance(dialog, mantidqtpython.MantidQt.API.AlgorithmDialog)
self.assertEqual(is_instance_of_alg_dialog, True, "Did not get an AlgorithmDialog instance back.")
threadsafe_call( dialog.close )

def test_ScreenShotDialog(self):
interface_manager = mantidqtpython.MantidQt.API.InterfaceManager()
dialog = threadsafe_call( interface_manager.createDialogFromName, self.__target_algorithm__, self.__clean_properties__)
parent = None
dialog = threadsafe_call( interface_manager.createDialogFromName, self.__target_algorithm__, parent, self.__clean_properties__)
screenshotdir = tempfile.gettempdir();
filename = "CreateMDWorkspace_screenshot.png"
screenshot_to_dir(widget=dialog, filename=filename, screenshot_dir=screenshotdir)
Expand All @@ -36,4 +38,4 @@ def test_ScreenShotDialog(self):
mantidplottests.runTests(MantidPlotAlgorithmDialogTest)




2 changes: 1 addition & 1 deletion Code/Mantid/docs/sphinxext/mantiddoc/tools/screenshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def algorithm_screenshot(name, directory, version = -1, ext = ".png"):

iface_mgr = mantidqt.MantidQt.API.InterfaceManager()
# threadsafe_call required for MantidPlot
dlg = threadsafe_call(iface_mgr.createDialogFromName, name, version, True, None)
dlg = threadsafe_call(iface_mgr.createDialogFromName, name, version, None, True)

suffix = ("-v%d" % version) if version != -1 else ""
filename = "%s%s_dlg%s" % (name, suffix, ext)
Expand Down

0 comments on commit e8b6857

Please sign in to comment.