Index: src/sas/qtgui/Utilities/TabbedModelEditor.py
===================================================================
--- src/sas/qtgui/Utilities/TabbedModelEditor.py	(revision 8b480d271418f2fa35e0597730c97807da3140d6)
+++ src/sas/qtgui/Utilities/TabbedModelEditor.py	(revision 3790f7fca48b8c6a203f8b2edcf944d422d7f003)
@@ -5,4 +5,5 @@
 import numpy as np
 import logging
+import traceback
 
 from PyQt5 import QtWidgets
@@ -75,5 +76,5 @@
         # signals from tabs
         self.editor_widget.modelModified.connect(self.editorModelModified)
-        self.plugin_widget.modelModified.connect(self.pluginModelModified)
+        self.plugin_widget.txtName.editingFinished.connect(self.pluginTitleSet)
 
     def setPluginActive(self, is_active=True):
@@ -169,8 +170,9 @@
         self.is_modified = True
 
-    def pluginModelModified(self):
-        """
-        User modified the model in the Plugin Editor.
-        Show that the model is changed.
+    def pluginTitleSet(self):
+        """
+        User modified the model name.
+        Display the model name in the window title
+        and allow for model save.
         """
         # Ensure plugin name is non-empty
@@ -179,10 +181,13 @@
             self.setWindowTitle(self.window_title + " - " + model['filename'])
             self.setTabEdited(True)
-            # Enable editor
-            self.editor_widget.setEnabled(True)
             self.buttonBox.button(QtWidgets.QDialogButtonBox.Apply).setEnabled(True)
             self.is_modified = True
         else:
+            # the model name is empty - disable Apply and clear the editor
             self.buttonBox.button(QtWidgets.QDialogButtonBox.Apply).setEnabled(False)
+            self.editor_widget.blockSignals(True)
+            self.editor_widget.txtEditor.setPlainText('')
+            self.editor_widget.blockSignals(False)
+            self.editor_widget.setEnabled(False)
 
     def setTabEdited(self, is_edited):
@@ -228,12 +233,23 @@
         model_str = self.generateModel(model, full_path)
         self.writeFile(full_path, model_str)
-        # TODO:
-        # Temporarily disable model check -
-        # unittest.suite() gives weird results in qt5.
-        # needs investigating
-        #try:
-        #    _, msg = self.checkModel(full_path), None
-        #except Exception as ex:
-        #    result, msg = None, "Error building model: "+ str(ex)
+
+        # test the model
+
+        # Run the model test in sasmodels
+        try:
+            _ = self.checkModel(full_path)
+        except Exception as ex:
+            msg = "Error building model: "+ str(ex)
+            logging.error(msg)
+            #print three last lines of the stack trace
+            # this will point out the exact line failing
+            last_lines = traceback.format_exc().split('\n')[-4:]
+            traceback_to_show = '\n'.join(last_lines)
+            logging.error(traceback_to_show)
+
+            self.parent.communicate.statusBarUpdateSignal.emit("Model check failed")
+            return
+
+        self.editor_widget.setEnabled(True)
 
         # Update the editor here.
@@ -248,4 +264,9 @@
         # Notify listeners
         self.parent.communicate.customModelDirectoryChanged.emit()
+
+        # Notify the user
+        msg = "Custom model "+filename + " successfully created."
+        self.parent.communicate.statusBarUpdateSignal.emit(msg)
+        logging.info(msg)
 
     def updateFromEditor(self):
@@ -261,5 +282,9 @@
         # Update the tab title
         self.setTabEdited(False)
-        
+        # notify the user
+        msg = self.filename + " successfully saved."
+        self.parent.communicate.statusBarUpdateSignal.emit(msg)
+        logging.info(msg)
+
     def canWriteModel(self, model=None, full_path=""):
         """
@@ -395,4 +420,9 @@
         # check the model's unit tests run
         from sasmodels.model_test import run_one
+        # TestSuite module in Qt5 now deletes tests in the suite after running,
+        # so suite[0] in run_one() in sasmodels/model_test.py will contain [None] and
+        # test.info.tests will raise.
+        # Not sure how to change the behaviour here, most likely sasmodels will have to
+        # be modified
         result = run_one(path)
 
