Skip to content

Commit

Permalink
Merge pull request #3726 from arnaud-morvan/processing_various_fixes
Browse files Browse the repository at this point in the history
[processing] small fixes
  • Loading branch information
volaya authored Nov 8, 2016
2 parents db35b38 + 4a62699 commit 7c4e66b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/qgis/ui/FieldsMappingPanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
from collections import OrderedDict

from qgis.PyQt import uic
from qgis.PyQt.QtGui import QBrush, QIcon, QSpacerItem
from qgis.PyQt.QtWidgets import QComboBox, QHeaderView, QLineEdit, QMessageBox, QSpinBox, QStyledItemDelegate
from qgis.PyQt.QtGui import QBrush, QIcon
from qgis.PyQt.QtWidgets import QComboBox, QHeaderView, QLineEdit, QSpacerItem, QMessageBox, QSpinBox, QStyledItemDelegate
from qgis.PyQt.QtCore import QItemSelectionModel, QAbstractTableModel, QModelIndex, QVariant, Qt, pyqtSlot

from qgis.core import QgsExpression, QgsExpressionContextUtils, QgsApplication, QgsFeature
Expand Down
10 changes: 7 additions & 3 deletions python/plugins/processing/gui/BatchOutputSelectionPanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import os
import re

from qgis.core import QgsMapLayer
from qgis.PyQt.QtWidgets import QWidget, QPushButton, QLineEdit, QHBoxLayout, QSizePolicy, QFileDialog
from qgis.PyQt.QtCore import QSettings

Expand Down Expand Up @@ -113,9 +114,12 @@ def showSelectionDialog(self):
if isinstance(param, (ParameterRaster,
ParameterVector, ParameterTable,
ParameterMultipleInput)):
s = str(widget.getText())
s = os.path.basename(s)
s = os.path.splitext(s)[0]
v = widget.value()
if isinstance(v, QgsMapLayer):
s = v.name()
else:
s = os.path.basename(v)
s = os.path.splitext(s)[0]
elif isinstance(param, ParameterBoolean):
s = str(widget.currentIndex() == 0)
elif isinstance(param, ParameterSelection):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ def value(self):
except:
return self.widget.getValue()
elif self.dialogType == DIALOG_BATCH:
return self.widget.getText()
return self.widget.value()
else:
def validator(v):
return bool(v) or self.param.optional
Expand Down

0 comments on commit 7c4e66b

Please sign in to comment.