File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
python/plugins/processing/modeler Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 26
26
__revision__ = '$Format:%H$'
27
27
28
28
from qgis .PyQt .QtCore import QCoreApplication
29
- from qgis .core import QgsApplication , QgsProcessingModelAlgorithm
29
+ from qgis .core import QgsApplication , QgsProcessingModelAlgorithm , QgsMessageLog
30
30
from processing .gui .ContextAction import ContextAction
31
31
from processing .modeler .ModelerDialog import ModelerDialog
32
+ from qgis .core import Qgis
33
+ from qgis .utils import iface
32
34
33
35
34
36
class EditModelAction (ContextAction ):
@@ -41,9 +43,13 @@ def isEnabled(self):
41
43
42
44
def execute (self ):
43
45
alg = self .itemData
44
- dlg = ModelerDialog (alg )
45
- dlg .update_model .connect (self .updateModel )
46
- dlg .show ()
46
+ ok , msg = alg .canExecute ()
47
+ if not ok :
48
+ iface .messageBar ().pushMessage ("Cannot edit model:" , msg , level = Qgis .Warning )
49
+ else :
50
+ dlg = ModelerDialog (alg )
51
+ dlg .update_model .connect (self .updateModel )
52
+ dlg .show ()
47
53
48
54
def updateModel (self ):
49
55
QgsApplication .processingRegistry ().providerById ('model' ).refreshAlgorithms ()
You can’t perform that action at this time.
0 commit comments