Пример #1
0
 def openResults(self):
     dlg = ResultsDialog()
     dlg.exec_()
Пример #2
0
    @staticmethod
    def handleAlgorithmResults(alg, showResults=True):
        htmlResults = False
        for out in alg.outputs:
            if out.hidden or not out.open:
                continue
            if isinstance(out, (OutputRaster, OutputVector, OutputTable)):
                try:
                    if out.value.startswith("memory:"):
                        layer = out.memoryLayer
                        QgsMapLayerRegistry.instance().addMapLayer(layer)
                    else:
                        if SextanteConfig.getSetting(
                                SextanteConfig.USE_FILENAME_AS_LAYER_NAME):
                            name = os.path.basename(out.value)
                        else:
                            name = out.description
                        QGisLayers.load(
                            out.value, name, alg.crs,
                            RenderingStyles.getStyle(alg.commandLineName(),
                                                     out.name))
                except Exception, e:
                    QMessageBox.critical(None, "Error", str(e))
            elif isinstance(out, OutputHTML):
                SextanteResults.addResult(out.description, out.value)
                htmlResults = True
        if showResults and htmlResults:
            QApplication.restoreOverrideCursor()
            dlg = ResultsDialog()
            dlg.exec_()