Skip to content
Permalink
Browse files

[processing] more work on parameter wrappers

  • Loading branch information
volaya committed Oct 5, 2016
1 parent e353d22 commit bc06600871ea02d26eedc4b3512b93777ce20e95
Showing with 36 additions and 2 deletions.
  1. +13 −2 python/plugins/processing/core/parameters.py
  2. +23 −0 python/plugins/processing/gui/wrappers.py
@@ -106,8 +106,10 @@ class Parameter:
take as input.
"""

default_metadata = {}

default_metadata = {
'widget_wrapper': 'processing.gui.wrappers.BasicWidgetWrapper'
}

def __init__(self, name='', description='', default=None, optional=False,
metadata={}):
self.name = name
@@ -870,6 +872,11 @@ def getValueAsCommandLineParameter(self):


class ParameterRange(Parameter):

default_metadata = {
'widget_wrapper': 'processing.gui.wrappers.BasicWidgetWrapper'
}


def __init__(self, name='', description='', default=None, optional=False):
Parameter.__init__(self, name, description, default, optional)
@@ -1461,6 +1468,10 @@ def fromScriptCode(self, line):

class ParameterGeometryPredicate(Parameter):

default_metadata = {
'widget_wrapper': 'processing.gui.wrappers.BasicWidgetWrapper'
}

predicates = ('intersects',
'contains',
'disjoint',
@@ -17,6 +17,7 @@
* *
***************************************************************************
"""
from gui.GeometryPredicateSelectionPanel import GeometryPredicateSelectionPanel

__author__ = 'Arnaud Morvan'
__date__ = 'May 2016'
@@ -131,6 +132,17 @@ def postInitialize(self, wrappers):
def refresh(self):
pass

class BasicWidgetWrapper(WidgetWrapper):

def createWidget(self):
return QLineEdit()

def setValue(self, value):
self.widget.setText(value)

def value(self):
return self.widget.text()


class BooleanWidgetWrapper(WidgetWrapper):

@@ -792,3 +804,14 @@ def anotherParameterWidgetHasChanged(self,wrapper):
self.widget.addItem(self.tr(self.NOT_SET))
self.widget.addItems(self.getFields(layer, wrapper.param.datatype))


def GeometryPredicateWidgetWrapper(WidgetWrapper):

def createWidget(self):
return GeometryPredicateSelectionPanel()

def setValue(self, value):
self.widget.setValue(value)

def value(self):
return self.widget.value()

0 comments on commit bc06600

Please sign in to comment.
You can’t perform that action at this time.