Skip to content

Commit b0ed56a

Browse files
author
volayaf
committedApr 18, 2012
some code cleaning
changed style of parameters dialog when called from toolbox added iterate buttons (functionality not yet implemented) git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@119 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
1 parent 8ef2082 commit b0ed56a

30 files changed

+399
-309
lines changed
 

‎src/sextante/about/AboutDialog.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,14 @@ def __init__(self):
1111
self.setupUi()
1212

1313
def setupUi(self):
14-
self.setObjectName("AboutDialog")
1514
self.resize(600, 500)
1615
self.webView = QtWebKit.QWebView()
17-
self.webView.setObjectName("webView")
1816
self.setWindowTitle("About SEXTANTE")
1917
self.verticalLayout= QtGui.QVBoxLayout()
2018
self.verticalLayout.setSpacing(2)
2119
self.verticalLayout.setMargin(0)
22-
self.verticalLayout.setObjectName("horizontalLayout")
2320
self.verticalLayout.addWidget(self.webView)
2421
self.closeButton = QtGui.QPushButton()
25-
self.closeButton.setObjectName("closeButton")
2622
self.closeButton.setText("Close")
2723
QObject.connect(self.closeButton, QtCore.SIGNAL("clicked()"), self.closeWindow)
2824
self.verticalLayout.addWidget(self.closeButton)

‎src/sextante/core/QGisLayers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ def getVectorLayers(shapetype=-1):
3030
for layer in layers:
3131
if layer.type() == layer.VectorLayer:
3232
if shapetype == QGisLayers.ALL_TYPES or layer.geometryType() == shapetype:
33-
#if os.path.exists(layer.source()):
34-
vector.append(layer)
33+
uri = str(layer.source())
34+
if not uri.endswith("csv") and not uri.endswith("dbf"):
35+
vector.append(layer)
3536
return vector
3637

3738
@staticmethod

‎src/sextante/gui/AutofillDialog.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@ def __init__(self,alg):
1515
self.verticalLayout = QtGui.QVBoxLayout(self)
1616
self.verticalLayout.setSpacing(40)
1717
self.verticalLayout.setMargin(20)
18-
self.verticalLayout.setObjectName("vLayout")
19-
2018
self.horizontalLayout = QtGui.QHBoxLayout(self)
2119
self.horizontalLayout.setSpacing(2)
2220
self.horizontalLayout.setMargin(0)
23-
self.horizontalLayout.setObjectName("hLayout")
2421
self.label = QtGui.QLabel("Autofill mode")
2522
self.horizontalLayout.addWidget(self.label)
2623
self.typeCombo = QtGui.QComboBox()
@@ -29,11 +26,9 @@ def __init__(self,alg):
2926
self.typeCombo.addItem("Fill with parameter values")
3027
self.horizontalLayout.addWidget(self.typeCombo)
3128
self.verticalLayout.addLayout(self.horizontalLayout)
32-
3329
self.horizontalLayout2 = QtGui.QHBoxLayout(self)
3430
self.horizontalLayout2.setSpacing(2)
3531
self.horizontalLayout2.setMargin(0)
36-
self.horizontalLayout2.setObjectName("hLayout2")
3732
self.label2 = QtGui.QLabel("Parameter to use")
3833
self.horizontalLayout2.addWidget(self.label2)
3934
self.fieldCombo = QtGui.QComboBox()
@@ -45,7 +40,6 @@ def __init__(self,alg):
4540
self.buttonBox = QtGui.QDialogButtonBox(self)
4641
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
4742
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
48-
self.buttonBox.setObjectName("buttonBox")
4943
QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), self.okPressed)
5044
QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), self.cancelPressed)
5145
self.verticalLayout.addWidget(self.buttonBox)

‎src/sextante/gui/BatchInputSelectionPanel.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,14 @@ def __init__(self, param, row, col, batchDialog, parent = None):
1111
self.table = batchDialog.table
1212
self.row = row
1313
self.col = col
14-
self.setObjectName("inputPanel")
1514
self.horizontalLayout = QtGui.QHBoxLayout(self)
1615
self.horizontalLayout.setSpacing(2)
1716
self.horizontalLayout.setMargin(0)
18-
self.horizontalLayout.setObjectName("hLayout")
1917
self.text = QtGui.QLineEdit()
20-
self.text.setObjectName("text")
2118
self.text.setText("")
2219
self.text.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
2320
self.horizontalLayout.addWidget(self.text)
2421
self.pushButton = QtGui.QPushButton()
25-
self.pushButton.setObjectName("pushButton")
2622
self.pushButton.setText("...")
2723
self.pushButton.clicked.connect(self.showSelectionDialog)
2824
self.horizontalLayout.addWidget(self.pushButton)

‎src/sextante/gui/BatchOutputSelectionPanel.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,14 @@ def __init__(self, output, alg, row, col, batchDialog):
2020
self.output = output
2121
self.batchDialog = batchDialog
2222
self.table = batchDialog.table
23-
self.setObjectName("OSPanel")
2423
self.horizontalLayout = QtGui.QHBoxLayout(self)
2524
self.horizontalLayout.setSpacing(2)
2625
self.horizontalLayout.setMargin(0)
27-
self.horizontalLayout.setObjectName("hLayout")
2826
self.text = QtGui.QLineEdit()
29-
self.text.setObjectName("label")
3027
self.text.setText("")
3128
self.text.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
3229
self.horizontalLayout.addWidget(self.text)
3330
self.pushButton = QtGui.QPushButton()
34-
self.pushButton.setObjectName("pushButton")
3531
self.pushButton.setText("...")
3632
self.pushButton.clicked.connect(self.showSelectionDialog)
3733
self.horizontalLayout.addWidget(self.pushButton)

‎src/sextante/gui/BatchProcessingDialog.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,22 @@ def __init__(self, alg):
2323
self.setupUi()
2424

2525
def setupUi(self):
26-
self.setObjectName("Dialog")
2726
self.resize(800, 500)
2827
self.setWindowTitle("Batch Processing - " + self.alg.name)
2928
self.horizontalLayout = QtGui.QVBoxLayout(self)
3029
self.horizontalLayout.setSpacing(10)
3130
self.horizontalLayout.setMargin(10)
32-
self.horizontalLayout.setObjectName("hLayout")
3331
self.buttonBox = QtGui.QDialogButtonBox(self)
3432
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
3533
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
36-
self.buttonBox.setObjectName("buttonBox")
3734
self.addRowButton = QtGui.QPushButton()
38-
self.addRowButton.setObjectName("addRowButton")
3935
self.addRowButton.setText("Add row")
4036
self.buttonBox.addButton(self.addRowButton, QtGui.QDialogButtonBox.ActionRole)
4137
self.deleteRowButton = QtGui.QPushButton()
42-
self.deleteRowButton.setObjectName("deleteButton")
4338
self.deleteRowButton.setText("Delete row")
4439
self.buttonBox.addButton(self.addRowButton, QtGui.QDialogButtonBox.ActionRole)
4540
self.buttonBox.addButton(self.deleteRowButton, QtGui.QDialogButtonBox.ActionRole)
4641
self.table = QtGui.QTableWidget(self)
47-
self.table.setObjectName("table")
4842
self.table.setColumnCount(len(self.alg.parameters) + len(self.alg.outputs))
4943
self.setTableContent()
5044
self.table.horizontalHeader().setStretchLastSection(True)

‎src/sextante/gui/ConfigDialog.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,12 @@ def __init__(self, toolbox):
1111
self.setupUi()
1212

1313
def setupUi(self):
14-
self.setObjectName("ConfigDialog")
1514
self.resize(700, 500)
1615
self.setWindowTitle("SEXTANTE options")
1716
self.verticalLayout = QtGui.QVBoxLayout()
1817
self.verticalLayout.setSpacing(2)
1918
self.verticalLayout.setMargin(0)
20-
self.verticalLayout.setObjectName("verticalLayout")
2119
self.searchBox = QtGui.QLineEdit()
22-
self.searchBox.setObjectName("searchBox")
2320
self.searchBox.textChanged.connect(self.fillTree)
2421
self.verticalLayout.addWidget(self.searchBox)
2522
self.groupIcon = QtGui.QIcon()
@@ -38,7 +35,6 @@ def setupUi(self):
3835
self.buttonBox = QtGui.QDialogButtonBox()
3936
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
4037
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
41-
self.buttonBox.setObjectName("buttonBox")
4238
self.verticalLayout.addWidget(self.buttonBox)
4339
self.setLayout(self.verticalLayout)
4440
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), self.okPressed)

‎src/sextante/gui/EditRenderingStylesDialog.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,20 @@ def setupUi(self):
2020
self.buttonBox = QtGui.QDialogButtonBox()
2121
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
2222
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok)
23-
self.buttonBox.setObjectName("buttonBox")
2423
self.tableWidget = QtGui.QTableWidget()
2524
self.tableWidget.setSelectionMode(QtGui.QAbstractItemView.NoSelection)
2625
self.tableWidget.setColumnCount(2)
2726
self.tableWidget.setColumnWidth(0, 300)
2827
self.tableWidget.setColumnWidth(1, 300)
2928
self.tableWidget.setHorizontalHeaderItem(0, QtGui.QTableWidgetItem("Output"))
3029
self.tableWidget.setHorizontalHeaderItem(1, QtGui.QTableWidgetItem("Style"))
31-
self.tableWidget.setObjectName("tableWidget")
3230
self.tableWidget.verticalHeader().setVisible(False)
3331
self.tableWidget.horizontalHeader().setResizeMode(QtGui.QHeaderView.Stretch)
3432
self.setTableContent()
3533
self.setWindowTitle(self.alg.name)
3634
self.verticalLayout = QtGui.QVBoxLayout()
3735
self.verticalLayout.setSpacing(2)
3836
self.verticalLayout.setMargin(0)
39-
self.verticalLayout.setObjectName("vLayout")
4037
self.verticalLayout.addWidget(self.tableWidget)
4138
self.verticalLayout.addWidget(self.buttonBox)
4239
self.setLayout(self.verticalLayout)

‎src/sextante/gui/ExtentSelectionPanel.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,14 @@ class ExtentSelectionPanel(QtGui.QWidget):
1010
def __init__(self, dialog, default):
1111
super(ExtentSelectionPanel, self).__init__(None)
1212
self.dialog = dialog
13-
self.setObjectName("ESPanel")
1413
self.horizontalLayout = QtGui.QHBoxLayout(self)
1514
self.horizontalLayout.setSpacing(2)
1615
self.horizontalLayout.setMargin(0)
17-
self.horizontalLayout.setObjectName("hLayout")
1816
self.text = QtGui.QLineEdit()
19-
self.text.setObjectName("label")
2017
self.text.setText(default)
2118
self.text.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
2219
self.horizontalLayout.addWidget(self.text)
2320
self.pushButton = QtGui.QPushButton()
24-
self.pushButton.setObjectName("pushButton")
2521
self.pushButton.setText("...")
2622
self.pushButton.clicked.connect(self.buttonPushed)
2723
self.horizontalLayout.addWidget(self.pushButton)

‎src/sextante/gui/FixedTableDialog.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,15 @@ def __init__(self, param, table):
1313
self.rettable = None
1414

1515
def setupUi(self):
16-
self.setObjectName("Dialog")
1716
self.resize(600, 350)
1817
self.setWindowTitle("Fixed Table")
1918
self.horizontalLayout = QtGui.QHBoxLayout()
2019
self.horizontalLayout.setSpacing(2)
2120
self.horizontalLayout.setMargin(0)
22-
self.horizontalLayout.setObjectName("horizontalLayout")
2321
self.buttonBox = QtGui.QDialogButtonBox()
2422
self.buttonBox.setOrientation(QtCore.Qt.Vertical)
2523
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
26-
self.buttonBox.setObjectName("buttonBox")
2724
self.table = QtGui.QTableWidget()
28-
self.table.setObjectName("table")
2925
self.table.setColumnCount(len(self.param.cols))
3026
for i in range(len(self.param.cols)):
3127
self.table.setColumnWidth(i,380 / len(self.param.cols))
@@ -36,11 +32,9 @@ def setupUi(self):
3632
self.table.setRowHeight(i,22)
3733
self.table.verticalHeader().setVisible(False)
3834
self.addRowButton = QtGui.QPushButton()
39-
self.addRowButton.setObjectName("addRowButton")
4035
self.addRowButton.setText("Add row")
4136
self.addRowButton.setEnabled(not self.param.fixedNumOfRows)
4237
self.removeRowButton = QtGui.QPushButton()
43-
self.removeRowButton.setObjectName("removeRowButton")
4438
self.removeRowButton.setText("Remove row")
4539
self.removeRowButton.setEnabled(not self.param.fixedNumOfRows)
4640
self.buttonBox.addButton(self.addRowButton, QtGui.QDialogButtonBox.ActionRole)

‎src/sextante/gui/FixedTablePanel.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,14 @@ def __init__(self, param, parent = None):
1616
self.table.append(list())
1717
for j in range(len(param.cols)):
1818
self.table[i].append("0")
19-
self.setObjectName(_fromUtf8("MSPanel"))
2019
self.horizontalLayout = QtGui.QHBoxLayout(self)
2120
self.horizontalLayout.setSpacing(2)
2221
self.horizontalLayout.setMargin(0)
23-
self.horizontalLayout.setObjectName(_fromUtf8("hLayout"))
2422
self.label = QtGui.QLabel()
25-
self.label.setObjectName(_fromUtf8("label"))
2623
self.label.setText("Fixed table " + str(len(param.cols)) + " X " + str(param.numRows))
2724
self.label.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
2825
self.horizontalLayout.addWidget(self.label)
2926
self.pushButton = QtGui.QPushButton()
30-
self.pushButton.setObjectName(_fromUtf8("pushButton"))
3127
self.pushButton.setText("...")
3228
self.pushButton.clicked.connect(self.showFixedTableDialog)
3329
self.horizontalLayout.addWidget(self.pushButton)

‎src/sextante/gui/HTMLViewerDialog.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,12 @@ def __init__(self, filename):
1111
self.setupUi()
1212

1313
def setupUi(self):
14-
self.setObjectName("AboutDialog")
1514
self.resize(600, 500)
1615
self.webView = QtWebKit.QWebView()
17-
self.webView.setObjectName("webView")
1816
self.setWindowTitle("")
1917
self.horizontalLayout= QtGui.QHBoxLayout()
2018
self.horizontalLayout.setSpacing(2)
2119
self.horizontalLayout.setMargin(0)
22-
self.horizontalLayout.setObjectName("horizontalLayout")
2320
self.horizontalLayout.addWidget(self.webView)
2421
self.setLayout(self.horizontalLayout)
2522
try:

‎src/sextante/gui/HistoryDialog.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ def __init__(self):
1010
self.setupUi()
1111

1212
def setupUi(self):
13-
self.setObjectName("HistoryDialog")
1413
self.resize(650, 505)
1514
self.verticalLayout = QtGui.QVBoxLayout()
1615
self.verticalLayout.setSpacing(2)
1716
self.verticalLayout.setMargin(0)
18-
self.verticalLayout.setObjectName("verticalLayout")
1917
self.tree = QtGui.QTreeWidget()
2018
self.tree.setHeaderHidden(True)
2119
self.tree.doubleClicked.connect(self.executeAlgorithm)
@@ -31,10 +29,8 @@ def setupUi(self):
3129
self.fillTree()
3230
self.text = QtGui.QTextEdit()
3331
self.verticalLayout.addWidget(self.text)
34-
self.text.setObjectName("text")
3532
self.text.setReadOnly(True)
3633
self.closeButton = QtGui.QPushButton()
37-
self.closeButton.setObjectName("closeButton")
3834
self.closeButton.setText("Close")
3935
QObject.connect(self.closeButton, QtCore.SIGNAL("clicked()"), self.closeWindow)
4036
self.verticalLayout.addWidget(self.closeButton)

‎src/sextante/gui/InputLayerSelectorPanel.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,15 @@ class InputLayerSelectorPanel(QtGui.QWidget):
44

55
def __init__(self, options):
66
super(InputLayerSelectorPanel, self).__init__(None)
7-
self.setObjectName("ILSPanel")
87
self.horizontalLayout = QtGui.QHBoxLayout(self)
98
self.horizontalLayout.setSpacing(2)
109
self.horizontalLayout.setMargin(0)
11-
self.horizontalLayout.setObjectName("hLayout")
1210
self.text = QtGui.QComboBox()
13-
#self.text.setEditable(True)
1411
for name, value in options:
1512
self.text.addItem(name, value)
16-
self.text.setObjectName("label")
1713
self.text.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
1814
self.horizontalLayout.addWidget(self.text)
1915
self.pushButton = QtGui.QPushButton()
20-
self.pushButton.setObjectName("pushButton")
2116
self.pushButton.setText("...")
2217
self.pushButton.clicked.connect(self.showSelectionDialog)
2318
self.horizontalLayout.addWidget(self.pushButton)

‎src/sextante/gui/MultipleInputDialog.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,21 @@ def __init__(self, options, selectedoptions):
1212
self.selectedoptions = None
1313

1414
def setupUi(self):
15-
self.setObjectName("Dialog")
1615
self.resize(381, 320)
1716
self.setWindowTitle("Multiple selection")
1817
self.horizontalLayout = QtGui.QHBoxLayout(self)
1918
self.horizontalLayout.setSpacing(2)
2019
self.horizontalLayout.setMargin(0)
21-
self.horizontalLayout.setObjectName("hLayout")
2220
self.buttonBox = QtGui.QDialogButtonBox()
2321
self.buttonBox.setOrientation(QtCore.Qt.Vertical)
2422
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
25-
self.buttonBox.setObjectName("buttonBox")
2623
self.table = QtGui.QTableWidget()
27-
self.table.setObjectName("table")
2824
self.table.setColumnCount(1)
2925
self.table.setColumnWidth(0,270)
3026
self.table.verticalHeader().setVisible(False)
3127
self.table.horizontalHeader().setVisible(False)
3228
self.table.horizontalHeader().setResizeMode(QtGui.QHeaderView.Stretch)
3329
self.selectAllButton = QtGui.QPushButton()
34-
self.selectAllButton.setObjectName("selectAllButton")
3530
self.selectAllButton.setText("(de)Select all")
3631
self.setTableContent()
3732
self.buttonBox.addButton(self.selectAllButton, QtGui.QDialogButtonBox.ActionRole)

‎src/sextante/gui/MultipleInputPanel.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,14 @@ def __init__(self, options, parent = None):
1212
super(MultipleInputPanel, self).__init__(parent)
1313
self.options = options
1414
self.selectedoptions = []
15-
self.setObjectName(_fromUtf8("MSPanel"))
1615
self.horizontalLayout = QtGui.QHBoxLayout(self)
1716
self.horizontalLayout.setSpacing(2)
1817
self.horizontalLayout.setMargin(0)
19-
self.horizontalLayout.setObjectName(_fromUtf8("hLayout"))
2018
self.label = QtGui.QLabel()
21-
self.label.setObjectName(_fromUtf8("label"))
2219
self.label.setText("0 elements selected")
2320
self.label.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
2421
self.horizontalLayout.addWidget(self.label)
2522
self.pushButton = QtGui.QPushButton()
26-
self.pushButton.setObjectName(_fromUtf8("pushButton"))
2723
self.pushButton.setText("...")
2824
self.pushButton.clicked.connect(self.showSelectionDialog)
2925
self.horizontalLayout.addWidget(self.pushButton)

‎src/sextante/gui/NumberInputDialog.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ def __init__(self):
1313
self.value = None
1414

1515
def setupUi(self):
16-
self.setObjectName("Parameters")
1716
self.resize(500, 350)
1817
self.buttonBox = QtGui.QDialogButtonBox()
1918
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
2019
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
21-
self.buttonBox.setObjectName("buttonBox")
2220
self.label = QtGui.QLabel()
2321
self.label.setText("Enter expression in the text field.\nDouble click on elements in the tree to add their values to the expression.")
2422
self.tree = QtGui.QTreeWidget()
@@ -31,7 +29,6 @@ def setupUi(self):
3129
self.verticalLayout = QtGui.QVBoxLayout()
3230
self.verticalLayout.setSpacing(2)
3331
self.verticalLayout.setMargin(0)
34-
self.verticalLayout.setObjectName("hLayout")
3532
self.verticalLayout.addWidget(self.label)
3633
self.verticalLayout.addWidget(self.tree)
3734
self.verticalLayout.addWidget(self.formulaText)

0 commit comments

Comments
 (0)
Please sign in to comment.