Verifies the stimulus before closing, warns user with a
        dialog if there are any problems

def closeEvent(self, event):
        """Verifies the stimulus before closing, warns user with a
        dialog if there are any problems"""
        self.ok.setText("Checking...")
        QtGui.QApplication.processEvents()
        self.model().cleanComponents()
        self.model().purgeAutoSelected()
        msg = self.model().verify()
        if not msg:
            msg = self.model().warning()
        if msg:
            warnBox = QtGui.QMessageBox( QtGui.QMessageBox.Warning, 'Warning - Invalid Settings', '{}. Do you want to change this?'.format(msg) )
            yesButton = warnBox.addButton(self.tr('Edit'), QtGui.QMessageBox.YesRole)
            noButton = warnBox.addButton(self.tr('Ignore'), QtGui.QMessageBox.NoRole)
            warnBox.exec_()
            if warnBox.clickedButton() == yesButton:
                event.ignore()
        self.ok.setText("OK")