Пример #1
0
 def execute(self):
     filePath = ScriptUtils.findAlgorithmSource(self.itemData.name())
     if filePath is not None:
         dlg = ScriptEditorDialog(filePath, iface.mainWindow())
         dlg.show()
     else:
         QMessageBox.warning(
             None, self.tr("Edit Script"),
             self.tr("Can not find corresponding script file."))
Пример #2
0
 def execute(self):
     filePath = ScriptUtils.findAlgorithmSource(self.itemData.name())
     if filePath is not None:
         dlg = ScriptEditorDialog(filePath, iface.mainWindow())
         dlg.show()
     else:
         QMessageBox.warning(None,
                             self.tr("Edit Script"),
                             self.tr("Can not find corresponding script file.")
                             )
Пример #3
0
 def execute(self):
     reply = QMessageBox.question(
         None, self.tr("Delete Script"),
         self.tr("Are you sure you want to delete this script?"),
         QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
     if reply == QMessageBox.Yes:
         filePath = ScriptUtils.findAlgorithmSource(self.itemData.name())
         if filePath is not None:
             os.remove(filePath)
             QgsApplication.processingRegistry().providerById(
                 "script").refreshAlgorithms()
         else:
             QMessageBox.warning(
                 None, self.tr("Delete Script"),
                 self.tr("Can not find corresponding script file."))
Пример #4
0
 def execute(self):
     reply = QMessageBox.question(None,
                                  self.tr("Delete Script"),
                                  self.tr("Are you sure you want to delete this script?"),
                                  QMessageBox.Yes | QMessageBox.No,
                                  QMessageBox.No)
     if reply == QMessageBox.Yes:
         filePath = ScriptUtils.findAlgorithmSource(self.itemData.__class__.__name__)
         if filePath is not None:
             os.remove(filePath)
             QgsApplication.processingRegistry().providerById("script").refreshAlgorithms()
         else:
             QMessageBox.warning(None,
                                 self.tr("Delete Script"),
                                 self.tr("Can not find corresponding script file.")
                                 )