diff --git a/Code/Mantid/scripts/Interface/reduction_gui/reduction/sans/eqsans_data_proxy.py b/Code/Mantid/scripts/Interface/reduction_gui/reduction/sans/eqsans_data_proxy.py index 2a4ec50242e3de6966f8572b63502563c81b7a35..b302fba19428f0b63e80a8377fbcee9dc7f7d1a5 100755 --- a/Code/Mantid/scripts/Interface/reduction_gui/reduction/sans/eqsans_data_proxy.py +++ b/Code/Mantid/scripts/Interface/reduction_gui/reduction/sans/eqsans_data_proxy.py @@ -19,13 +19,17 @@ class DataProxy(object): def __init__(self, data_file, workspace_name=None): self.errors = [] if HAS_MANTID: - print "loading", data_file try: if workspace_name is None: self.data_ws = "__raw_data_file" else: self.data_ws = str(workspace_name) - LoadEventNexus(Filename=data_file, OutputWorkspace=workspace_name) + try: + LoadEventNexus(Filename=data_file, OutputWorkspace=workspace_name) + except: + self.errors.append("Error loading data file as Nexus event file:\n%s" % sys.exc_value) + LoadNexus(Filename=data_file, OutputWorkspace=workspace_name) + self.errors = [] except: self.data_ws = None self.errors.append("Error loading data file:\n%s" % sys.exc_value) diff --git a/Code/Mantid/scripts/Interface/reduction_gui/widgets/base_widget.py b/Code/Mantid/scripts/Interface/reduction_gui/widgets/base_widget.py index 17606b813fa43e2a2b48ee868fa81d272dda23c2..7f6af0ebd00c3a54bce4d5429190876a4f30be7e 100644 --- a/Code/Mantid/scripts/Interface/reduction_gui/widgets/base_widget.py +++ b/Code/Mantid/scripts/Interface/reduction_gui/widgets/base_widget.py @@ -160,7 +160,7 @@ class BaseWidget(QtGui.QWidget): # Check that the file exists. if not os.path.exists(file_name): - QtGui.QMessageBox.warning(self.widgets[0], "File Not Found", "The supplied mask file can't be found on the file system") + QtGui.QMessageBox.warning(self, "File Not Found", "The supplied mask file can't be found on the file system") if self._data_proxy is not None: proxy = self._data_proxy(file_name, workspace) @@ -169,8 +169,8 @@ class BaseWidget(QtGui.QWidget): MaskDetectors(proxy.data_ws, DetectorList=mask) _show_ws_instrument(proxy.data_ws) else: - QtGui.QMessageBox.warning(self.widgets[0], "Mask Error", "Mantid doesn't know how to load this file") + QtGui.QMessageBox.warning(self, "Mask Error", "Mantid doesn't know how to load this file") else: - QtGui.QMessageBox.warning(self.widgets[0], "Mask Error", "Mantid doesn't know how to load this file") + QtGui.QMessageBox.warning(self, "Mask Error", "Mantid doesn't know how to load this file")