-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCreateEditCollectionAction.py
More file actions
25 lines (21 loc) · 1.04 KB
/
Copy pathCreateEditCollectionAction.py
File metadata and controls
25 lines (21 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import os
from qgis.PyQt.QtGui import QIcon
from qgis.utils import iface
from processing.gui.ToolboxAction import ToolboxAction
from processing_workflow.WorkflowCollection import WorkflowCollection
from processing_workflow.CollectionCreatorDialog import CollectionCreatorDialog
class CreateEditCollectionAction(ToolboxAction):
def __init__(self, workflowProvider):
ToolboxAction.__init__(self)
self.name = self.tr("Create/edit collection", "CreateEditCollectionAction")
self.workflowProvider = workflowProvider
def getIcon(self):
return QIcon(os.path.dirname(__file__) + "/images/icon.png")
def execute(self):
dlg = CollectionCreatorDialog()
dlg.exec_()
if dlg.update and dlg.confFile:
# Load the new collection, activate it and update Processing Toolbox
workflowCollection = WorkflowCollection(iface, dlg.confFile, self.workflowProvider,
activate=True)
self.workflowProvider.addCollection(workflowCollection)