Skip to content
Permalink
Browse files
added delete model action (#5392)
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@112 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
volayaf committed Apr 17, 2012
1 parent 24ea829 commit 511ffb2e314fe464d1fb1d42df33b66ab4bd493a
Showing with 17 additions and 1 deletion.
  1. +15 −0 src/sextante/modeler/DeleteModelAction.py
  2. +2 −1 src/sextante/modeler/ModelerAlgorithmProvider.py
@@ -0,0 +1,15 @@
from sextante.gui.ContextAction import ContextAction
from sextante.modeler.ModelerAlgorithm import ModelerAlgorithm
import os

class DeleteModelAction(ContextAction):

def __init__(self):
self.name="Delete model"

def isEnabled(self):
return isinstance(self.alg, ModelerAlgorithm)

def execute(self):
os.remove(self.alg.descriptionFile)
self.toolbox.updateTree()
@@ -10,13 +10,14 @@
from sextante.modeler.CreateNewModelAction import CreateNewModelAction
from sextante.core.AlgorithmProvider import AlgorithmProvider
from PyQt4 import QtGui
from sextante.modeler.DeleteModelAction import DeleteModelAction

class ModelerAlgorithmProvider(AlgorithmProvider):

def __init__(self):
AlgorithmProvider.__init__(self)
self.actions = [CreateNewModelAction()]
self.contextMenuActions = [EditModelAction()]
self.contextMenuActions = [EditModelAction(), DeleteModelAction()]

def initializeSettings(self):
AlgorithmProvider.initializeSettings(self)

0 comments on commit 511ffb2

Please sign in to comment.