Skip to content
Permalink
Browse files

Merge pull request #1052 from Oslandia/processing_gui_set_values

[processing] set droplists if parameter values are already set
  • Loading branch information
volaya committed Mar 25, 2014
2 parents 44a054d + af55e98 commit ec0c820a8184aad9acc6481125d589cc75e26b7e
Showing with 8 additions and 0 deletions.
  1. +8 −0 python/plugins/processing/gui/ParametersPanel.py
@@ -213,6 +213,10 @@ def getWidgetFromParameter(self, param):
items.append((self.NOT_SELECTED, None))
for layer in layers:
items.append((self.getExtendedLayerName(layer), layer))
# if already set, put first in list
for i,(name,layer) in enumerate(items):
if layer and layer.source() == param.value:
items.insert(0, items.pop(i))
item = InputLayerSelectorPanel(items)
elif isinstance(param, ParameterTable):
if self.somethingDependsOnThisParameter(param):
@@ -231,6 +235,10 @@ def getWidgetFromParameter(self, param):
items.append((self.NOT_SELECTED, None))
for layer in layers:
items.append((layer.name(), layer))
# if already set, put first in list
for i,(name,layer) in enumerate(items):
if layer and layer.source() == param.value:
items.insert(0, items.pop(i))
item = InputLayerSelectorPanel(items)
elif isinstance(param, ParameterBoolean):
item = QtGui.QComboBox()

0 comments on commit ec0c820

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