16
16
* *
17
17
***************************************************************************
18
18
"""
19
- from sextante .gui .SextantePostprocessing import SextantePostprocessing
20
-
21
19
__author__ = 'Victor Olaya'
22
20
__date__ = 'August 2012'
23
21
__copyright__ = '(C) 2012, Victor Olaya'
27
25
from PyQt4 import QtCore , QtGui
28
26
from PyQt4 .QtCore import *
29
27
from PyQt4 .QtGui import *
30
- from sextante .core .QGisLayers import QGisLayers
28
+ from sextante .gui .SextantePostprocessing import SextantePostprocessing
29
+ from sextante .parameters .ParameterFile import ParameterFile
30
+ from sextante .gui .FileSelectionPanel import FileSelectionPanel
31
31
from sextante .parameters .ParameterRaster import ParameterRaster
32
32
from sextante .parameters .ParameterTable import ParameterTable
33
33
from sextante .parameters .ParameterVector import ParameterVector
@@ -95,25 +95,27 @@ def headerDoubleClicked(self, col):
95
95
widgetValue = widget .currentIndex ()
96
96
for row in range (1 , self .table .rowCount ()):
97
97
self .table .cellWidget (row , col ).setCurrentIndex (widgetValue )
98
-
99
98
elif isinstance (widget , ExtentSelectionPanel ):
100
99
widgetValue = widget .getValue ()
101
100
for row in range (1 , self .table .rowCount ()):
102
101
if widgetValue != None :
103
102
self .table .cellWidget (row , col ).text .setText (widgetValue )
104
103
else :
105
104
self .table .cellWidget (row , col ).text .setText ("" )
106
-
107
105
elif isinstance (widget , CrsSelectionPanel ):
108
106
widgetValue = widget .getValue ()
109
107
for row in range (1 , self .table .rowCount ()):
110
108
self .table .cellWidget (row , col ).epsg = widgetValue
111
109
self .table .cellWidget (row , col ).setText ()
112
-
113
110
elif isinstance (widget , QtGui .QLineEdit ):
114
111
widgetValue = widget .text ()
112
+ for row in range (1 , self .table .rowCount ()):
113
+ self .table .cellWidget (row , col ).setText (widgetValue )
114
+ elif isinstance (widget , BatchInputSelectionPanel ):
115
+ widgetValue = widget .getText ()
115
116
for row in range (1 , self .table .rowCount ()):
116
117
self .table .cellWidget (row , col ).setText (widgetValue )
118
+
117
119
else :
118
120
pass
119
121
@@ -264,7 +266,10 @@ def finishAll(self):
264
266
265
267
def setParameterValueFromWidget (self , param , widget , alg = None ):
266
268
if isinstance (param , (ParameterRaster , ParameterVector , ParameterTable , ParameterMultipleInput )):
267
- return param .setValue (widget .getText ())
269
+ value = widget .getText ()
270
+ if unicode (value .strip ()) == "" :
271
+ value = None
272
+ return param .setValue (value )
268
273
elif isinstance (param , ParameterBoolean ):
269
274
return param .setValue (widget .currentIndex () == 0 )
270
275
elif isinstance (param , ParameterSelection ):
@@ -275,7 +280,7 @@ def setParameterValueFromWidget(self, param, widget, alg = None):
275
280
if alg != None :
276
281
widget .useNewAlg (alg )
277
282
return param .setValue (widget .getValue ())
278
- elif isinstance (param , ParameterCrs ):
283
+ elif isinstance (param , ( ParameterCrs , ParameterFile ) ):
279
284
return param .setValue (widget .getValue ())
280
285
else :
281
286
return param .setValue (widget .text ())
@@ -300,6 +305,8 @@ def getWidgetFromParameter(self, param, row, col):
300
305
item = ExtentSelectionPanel (self , self .alg , param .default )
301
306
elif isinstance (param , ParameterCrs ):
302
307
item = CrsSelectionPanel (param .default )
308
+ elif isinstance (param , ParameterFile ):
309
+ item = FileSelectionPanel (param .isFolder )
303
310
else :
304
311
item = QtGui .QLineEdit ()
305
312
try :
0 commit comments