From d43f1a2823b0f73bc10d0352dae487d3f34feeca Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Wed, 18 Jul 2018 07:35:41 +1000 Subject: [PATCH] [processing] Allow models to have no group name set This is supported by the toolbox now, so relax the requirement that all models have a compulsory group name. If no group is set, the model is shown directly under the Models node in the toolbox. Also switch a warning from message box to message bar --- python/plugins/processing/modeler/ModelerDialog.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/python/plugins/processing/modeler/ModelerDialog.py b/python/plugins/processing/modeler/ModelerDialog.py index 36297249ec6..abcbba0aa85 100644 --- a/python/plugins/processing/modeler/ModelerDialog.py +++ b/python/plugins/processing/modeler/ModelerDialog.py @@ -621,10 +621,9 @@ class ModelerDialog(BASE, WIDGET): self.bar.pushMessage("", self.tr("Model was correctly exported as python script"), level=Qgis.Success, duration=5) def saveModel(self, saveAs): - if str(self.textGroup.text()).strip() == '' \ - or str(self.textName.text()).strip() == '': - QMessageBox.warning( - self, self.tr('Warning'), self.tr('Please enter group and model names before saving') + if str(self.textName.text()).strip() == '': + self.bar.pushWarning( + "", self.tr('Please a enter model name before saving') ) return self.model.setName(str(self.textName.text()))