mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
[Processing] Fix when iface is None
This commit is contained in:
parent
46ff59bbfe
commit
e765bb6dd1
@ -386,6 +386,7 @@ class GeoAlgorithm:
|
|||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
from qgis.utils import iface
|
from qgis.utils import iface
|
||||||
|
if iface is not None:
|
||||||
self.crs = iface.mapCanvas().mapSettings().destinationCrs()
|
self.crs = iface.mapCanvas().mapSettings().destinationCrs()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
@ -385,6 +385,7 @@ class ModelerAlgorithm(GeoAlgorithm):
|
|||||||
if param.name in alg.params:
|
if param.name in alg.params:
|
||||||
value = self.resolveValue(alg.params[param.name])
|
value = self.resolveValue(alg.params[param.name])
|
||||||
else:
|
else:
|
||||||
|
if iface is not None:
|
||||||
iface.messageBar().pushMessage(self.tr("Warning"),
|
iface.messageBar().pushMessage(self.tr("Warning"),
|
||||||
self.tr("Parameter %s in algorithm %s in the model is run with default value! Edit the model to make sure that this is correct.") % (param.name, alg.name),
|
self.tr("Parameter %s in algorithm %s in the model is run with default value! Edit the model to make sure that this is correct.") % (param.name, alg.name),
|
||||||
QgsMessageBar.WARNING, 4)
|
QgsMessageBar.WARNING, 4)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user