def OnApplyInputChanges(self): first, second = self._inputDialog.GetValues() if self._inputDialog.IsSimpleMode(): self.rasters['first'], self.rasters['second'] = first, second res1 = self.SetFirstRaster(name=self.rasters['first']) res2 = self.SetSecondRaster(name=self.rasters['second']) if not (res1 and res2) and first and second: message = '' if not res1: message += _("Map <%s> not found. ") % self.rasters[ 'first'] if not res2: message += _("Map <%s> not found.") % self.rasters[ 'second'] GError(parent=self, message=message) return self.ZoomToMap() else: LayerListToRendererConverter(self.GetFirstMap()).ConvertAll(first) LayerListToRendererConverter( self.GetSecondMap()).ConvertAll(second) self.SetRasterNames() if self.IsAutoRendered(): self.OnRender(event=None)
def _connectSimpleLmgr(self, lmgr, renderer): converter = LayerListToRendererConverter(renderer) lmgr.opacityChanged.connect(converter.ChangeLayerOpacity) lmgr.cmdChanged.connect(converter.ChangeLayerCmd) lmgr.layerAdded.connect(converter.AddLayer) lmgr.layerRemoved.connect(converter.RemoveLayer) lmgr.layerActivated.connect(converter.ChangeLayerActive) lmgr.layerMovedUp.connect(converter.MoveLayerUp) lmgr.layerMovedDown.connect(converter.MoveLayerDown) lmgr.anyChange.connect(self._simpleLmgrChanged) return converter