Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] several fixes in config dialog
  • Loading branch information
alexbruy committed Sep 16, 2013
1 parent b1444bb commit 30a271c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions python/plugins/processing/gui/ConfigDialog.py
Expand Up @@ -88,7 +88,8 @@ def fillTree(self):
labelItem = QStandardItem(setting.description)
labelItem.setIcon(icon)
labelItem.setEditable(False)
groupItem.insertRow(0, [labelItem, SettingItem(setting)])
self.items[setting] = SettingItem(setting)
groupItem.insertRow(0, [labelItem, self.items[setting]])

if text != "":
self.tree.expand(groupItem.index())
Expand Down Expand Up @@ -116,7 +117,8 @@ def fillTree(self):
labelItem = QStandardItem(setting.description)
labelItem.setIcon(icon)
labelItem.setEditable(False)
groupItem.insertRow(0, [labelItem, SettingItem(setting)])
self.items[setting] = SettingItem(setting)
groupItem.insertRow(0, [labelItem, self.items[setting]])

providersItem.appendRow([groupItem, emptyItem])

Expand All @@ -126,9 +128,9 @@ def fillTree(self):
def accept(self):
for setting in self.items.keys():
if isinstance(setting.value, bool):
setting.value = (self.items[setting].checkState(1) == Qt.Checked)
setting.value = (self.items[setting].checkState() == Qt.Checked)
elif isinstance(setting.value, (float, int, long)):
value = str(self.items[setting].text(1))
value = str(self.items[setting].text())
try:
value = float(value)
setting.value = value
Expand All @@ -139,7 +141,7 @@ def accept(self):
)
return
else:
setting.value = str(self.items[setting].text(1))
setting.value = str(self.items[setting].text())
ProcessingConfig.addSetting(setting)
ProcessingConfig.saveSettings()
self.toolbox.updateTree()
Expand Down Expand Up @@ -177,7 +179,7 @@ def createEditor(self, parent, options, index):
return spnBox
elif isinstance(value, float):
spnBox = QDoubleSpinBox(parent)
spnBox.setRange(-999999999,999999, 999999999,999999)
spnBox.setRange(-999999999.999999, 999999999.999999)
spnBox.setDecimals(6)
return spnBox
elif isinstance(value, (str, unicode)):
Expand Down

0 comments on commit 30a271c

Please sign in to comment.