Skip to content

Commit

Permalink
some code cleaning
Browse files Browse the repository at this point in the history
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
  • Loading branch information
volayaf committed Apr 18, 2012
1 parent 8ef2082 commit b0ed56a
Show file tree
Hide file tree
Showing 30 changed files with 399 additions and 309 deletions.
4 changes: 0 additions & 4 deletions src/sextante/about/AboutDialog.py
Expand Up @@ -11,18 +11,14 @@ def __init__(self):
self.setupUi()

def setupUi(self):
self.setObjectName("AboutDialog")
self.resize(600, 500)
self.webView = QtWebKit.QWebView()
self.webView.setObjectName("webView")
self.setWindowTitle("About SEXTANTE")
self.verticalLayout= QtGui.QVBoxLayout()
self.verticalLayout.setSpacing(2)
self.verticalLayout.setMargin(0)
self.verticalLayout.setObjectName("horizontalLayout")
self.verticalLayout.addWidget(self.webView)
self.closeButton = QtGui.QPushButton()
self.closeButton.setObjectName("closeButton")
self.closeButton.setText("Close")
QObject.connect(self.closeButton, QtCore.SIGNAL("clicked()"), self.closeWindow)
self.verticalLayout.addWidget(self.closeButton)
Expand Down
5 changes: 3 additions & 2 deletions src/sextante/core/QGisLayers.py
Expand Up @@ -30,8 +30,9 @@ def getVectorLayers(shapetype=-1):
for layer in layers:
if layer.type() == layer.VectorLayer:
if shapetype == QGisLayers.ALL_TYPES or layer.geometryType() == shapetype:
#if os.path.exists(layer.source()):
vector.append(layer)
uri = str(layer.source())
if not uri.endswith("csv") and not uri.endswith("dbf"):
vector.append(layer)
return vector

@staticmethod
Expand Down
6 changes: 0 additions & 6 deletions src/sextante/gui/AutofillDialog.py
Expand Up @@ -15,12 +15,9 @@ def __init__(self,alg):
self.verticalLayout = QtGui.QVBoxLayout(self)
self.verticalLayout.setSpacing(40)
self.verticalLayout.setMargin(20)
self.verticalLayout.setObjectName("vLayout")

self.horizontalLayout = QtGui.QHBoxLayout(self)
self.horizontalLayout.setSpacing(2)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.setObjectName("hLayout")
self.label = QtGui.QLabel("Autofill mode")
self.horizontalLayout.addWidget(self.label)
self.typeCombo = QtGui.QComboBox()
Expand All @@ -29,11 +26,9 @@ def __init__(self,alg):
self.typeCombo.addItem("Fill with parameter values")
self.horizontalLayout.addWidget(self.typeCombo)
self.verticalLayout.addLayout(self.horizontalLayout)

self.horizontalLayout2 = QtGui.QHBoxLayout(self)
self.horizontalLayout2.setSpacing(2)
self.horizontalLayout2.setMargin(0)
self.horizontalLayout2.setObjectName("hLayout2")
self.label2 = QtGui.QLabel("Parameter to use")
self.horizontalLayout2.addWidget(self.label2)
self.fieldCombo = QtGui.QComboBox()
Expand All @@ -45,7 +40,6 @@ def __init__(self,alg):
self.buttonBox = QtGui.QDialogButtonBox(self)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), self.okPressed)
QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), self.cancelPressed)
self.verticalLayout.addWidget(self.buttonBox)
Expand Down
4 changes: 0 additions & 4 deletions src/sextante/gui/BatchInputSelectionPanel.py
Expand Up @@ -11,18 +11,14 @@ def __init__(self, param, row, col, batchDialog, parent = None):
self.table = batchDialog.table
self.row = row
self.col = col
self.setObjectName("inputPanel")
self.horizontalLayout = QtGui.QHBoxLayout(self)
self.horizontalLayout.setSpacing(2)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.setObjectName("hLayout")
self.text = QtGui.QLineEdit()
self.text.setObjectName("text")
self.text.setText("")
self.text.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
self.horizontalLayout.addWidget(self.text)
self.pushButton = QtGui.QPushButton()
self.pushButton.setObjectName("pushButton")
self.pushButton.setText("...")
self.pushButton.clicked.connect(self.showSelectionDialog)
self.horizontalLayout.addWidget(self.pushButton)
Expand Down
4 changes: 0 additions & 4 deletions src/sextante/gui/BatchOutputSelectionPanel.py
Expand Up @@ -20,18 +20,14 @@ def __init__(self, output, alg, row, col, batchDialog):
self.output = output
self.batchDialog = batchDialog
self.table = batchDialog.table
self.setObjectName("OSPanel")
self.horizontalLayout = QtGui.QHBoxLayout(self)
self.horizontalLayout.setSpacing(2)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.setObjectName("hLayout")
self.text = QtGui.QLineEdit()
self.text.setObjectName("label")
self.text.setText("")
self.text.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
self.horizontalLayout.addWidget(self.text)
self.pushButton = QtGui.QPushButton()
self.pushButton.setObjectName("pushButton")
self.pushButton.setText("...")
self.pushButton.clicked.connect(self.showSelectionDialog)
self.horizontalLayout.addWidget(self.pushButton)
Expand Down
6 changes: 0 additions & 6 deletions src/sextante/gui/BatchProcessingDialog.py
Expand Up @@ -23,28 +23,22 @@ def __init__(self, alg):
self.setupUi()

def setupUi(self):
self.setObjectName("Dialog")
self.resize(800, 500)
self.setWindowTitle("Batch Processing - " + self.alg.name)
self.horizontalLayout = QtGui.QVBoxLayout(self)
self.horizontalLayout.setSpacing(10)
self.horizontalLayout.setMargin(10)
self.horizontalLayout.setObjectName("hLayout")
self.buttonBox = QtGui.QDialogButtonBox(self)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.addRowButton = QtGui.QPushButton()
self.addRowButton.setObjectName("addRowButton")
self.addRowButton.setText("Add row")
self.buttonBox.addButton(self.addRowButton, QtGui.QDialogButtonBox.ActionRole)
self.deleteRowButton = QtGui.QPushButton()
self.deleteRowButton.setObjectName("deleteButton")
self.deleteRowButton.setText("Delete row")
self.buttonBox.addButton(self.addRowButton, QtGui.QDialogButtonBox.ActionRole)
self.buttonBox.addButton(self.deleteRowButton, QtGui.QDialogButtonBox.ActionRole)
self.table = QtGui.QTableWidget(self)
self.table.setObjectName("table")
self.table.setColumnCount(len(self.alg.parameters) + len(self.alg.outputs))
self.setTableContent()
self.table.horizontalHeader().setStretchLastSection(True)
Expand Down
4 changes: 0 additions & 4 deletions src/sextante/gui/ConfigDialog.py
Expand Up @@ -11,15 +11,12 @@ def __init__(self, toolbox):
self.setupUi()

def setupUi(self):
self.setObjectName("ConfigDialog")
self.resize(700, 500)
self.setWindowTitle("SEXTANTE options")
self.verticalLayout = QtGui.QVBoxLayout()
self.verticalLayout.setSpacing(2)
self.verticalLayout.setMargin(0)
self.verticalLayout.setObjectName("verticalLayout")
self.searchBox = QtGui.QLineEdit()
self.searchBox.setObjectName("searchBox")
self.searchBox.textChanged.connect(self.fillTree)
self.verticalLayout.addWidget(self.searchBox)
self.groupIcon = QtGui.QIcon()
Expand All @@ -38,7 +35,6 @@ def setupUi(self):
self.buttonBox = QtGui.QDialogButtonBox()
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.verticalLayout.addWidget(self.buttonBox)
self.setLayout(self.verticalLayout)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), self.okPressed)
Expand Down
3 changes: 0 additions & 3 deletions src/sextante/gui/EditRenderingStylesDialog.py
Expand Up @@ -20,23 +20,20 @@ def setupUi(self):
self.buttonBox = QtGui.QDialogButtonBox()
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.tableWidget = QtGui.QTableWidget()
self.tableWidget.setSelectionMode(QtGui.QAbstractItemView.NoSelection)
self.tableWidget.setColumnCount(2)
self.tableWidget.setColumnWidth(0, 300)
self.tableWidget.setColumnWidth(1, 300)
self.tableWidget.setHorizontalHeaderItem(0, QtGui.QTableWidgetItem("Output"))
self.tableWidget.setHorizontalHeaderItem(1, QtGui.QTableWidgetItem("Style"))
self.tableWidget.setObjectName("tableWidget")
self.tableWidget.verticalHeader().setVisible(False)
self.tableWidget.horizontalHeader().setResizeMode(QtGui.QHeaderView.Stretch)
self.setTableContent()
self.setWindowTitle(self.alg.name)
self.verticalLayout = QtGui.QVBoxLayout()
self.verticalLayout.setSpacing(2)
self.verticalLayout.setMargin(0)
self.verticalLayout.setObjectName("vLayout")
self.verticalLayout.addWidget(self.tableWidget)
self.verticalLayout.addWidget(self.buttonBox)
self.setLayout(self.verticalLayout)
Expand Down
4 changes: 0 additions & 4 deletions src/sextante/gui/ExtentSelectionPanel.py
Expand Up @@ -10,18 +10,14 @@ class ExtentSelectionPanel(QtGui.QWidget):
def __init__(self, dialog, default):
super(ExtentSelectionPanel, self).__init__(None)
self.dialog = dialog
self.setObjectName("ESPanel")
self.horizontalLayout = QtGui.QHBoxLayout(self)
self.horizontalLayout.setSpacing(2)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.setObjectName("hLayout")
self.text = QtGui.QLineEdit()
self.text.setObjectName("label")
self.text.setText(default)
self.text.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
self.horizontalLayout.addWidget(self.text)
self.pushButton = QtGui.QPushButton()
self.pushButton.setObjectName("pushButton")
self.pushButton.setText("...")
self.pushButton.clicked.connect(self.buttonPushed)
self.horizontalLayout.addWidget(self.pushButton)
Expand Down
6 changes: 0 additions & 6 deletions src/sextante/gui/FixedTableDialog.py
Expand Up @@ -13,19 +13,15 @@ def __init__(self, param, table):
self.rettable = None

def setupUi(self):
self.setObjectName("Dialog")
self.resize(600, 350)
self.setWindowTitle("Fixed Table")
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setSpacing(2)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.buttonBox = QtGui.QDialogButtonBox()
self.buttonBox.setOrientation(QtCore.Qt.Vertical)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.table = QtGui.QTableWidget()
self.table.setObjectName("table")
self.table.setColumnCount(len(self.param.cols))
for i in range(len(self.param.cols)):
self.table.setColumnWidth(i,380 / len(self.param.cols))
Expand All @@ -36,11 +32,9 @@ def setupUi(self):
self.table.setRowHeight(i,22)
self.table.verticalHeader().setVisible(False)
self.addRowButton = QtGui.QPushButton()
self.addRowButton.setObjectName("addRowButton")
self.addRowButton.setText("Add row")
self.addRowButton.setEnabled(not self.param.fixedNumOfRows)
self.removeRowButton = QtGui.QPushButton()
self.removeRowButton.setObjectName("removeRowButton")
self.removeRowButton.setText("Remove row")
self.removeRowButton.setEnabled(not self.param.fixedNumOfRows)
self.buttonBox.addButton(self.addRowButton, QtGui.QDialogButtonBox.ActionRole)
Expand Down
4 changes: 0 additions & 4 deletions src/sextante/gui/FixedTablePanel.py
Expand Up @@ -16,18 +16,14 @@ def __init__(self, param, parent = None):
self.table.append(list())
for j in range(len(param.cols)):
self.table[i].append("0")
self.setObjectName(_fromUtf8("MSPanel"))
self.horizontalLayout = QtGui.QHBoxLayout(self)
self.horizontalLayout.setSpacing(2)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.setObjectName(_fromUtf8("hLayout"))
self.label = QtGui.QLabel()
self.label.setObjectName(_fromUtf8("label"))
self.label.setText("Fixed table " + str(len(param.cols)) + " X " + str(param.numRows))
self.label.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
self.horizontalLayout.addWidget(self.label)
self.pushButton = QtGui.QPushButton()
self.pushButton.setObjectName(_fromUtf8("pushButton"))
self.pushButton.setText("...")
self.pushButton.clicked.connect(self.showFixedTableDialog)
self.horizontalLayout.addWidget(self.pushButton)
Expand Down
3 changes: 0 additions & 3 deletions src/sextante/gui/HTMLViewerDialog.py
Expand Up @@ -11,15 +11,12 @@ def __init__(self, filename):
self.setupUi()

def setupUi(self):
self.setObjectName("AboutDialog")
self.resize(600, 500)
self.webView = QtWebKit.QWebView()
self.webView.setObjectName("webView")
self.setWindowTitle("")
self.horizontalLayout= QtGui.QHBoxLayout()
self.horizontalLayout.setSpacing(2)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.horizontalLayout.addWidget(self.webView)
self.setLayout(self.horizontalLayout)
try:
Expand Down
4 changes: 0 additions & 4 deletions src/sextante/gui/HistoryDialog.py
Expand Up @@ -10,12 +10,10 @@ def __init__(self):
self.setupUi()

def setupUi(self):
self.setObjectName("HistoryDialog")
self.resize(650, 505)
self.verticalLayout = QtGui.QVBoxLayout()
self.verticalLayout.setSpacing(2)
self.verticalLayout.setMargin(0)
self.verticalLayout.setObjectName("verticalLayout")
self.tree = QtGui.QTreeWidget()
self.tree.setHeaderHidden(True)
self.tree.doubleClicked.connect(self.executeAlgorithm)
Expand All @@ -31,10 +29,8 @@ def setupUi(self):
self.fillTree()
self.text = QtGui.QTextEdit()
self.verticalLayout.addWidget(self.text)
self.text.setObjectName("text")
self.text.setReadOnly(True)
self.closeButton = QtGui.QPushButton()
self.closeButton.setObjectName("closeButton")
self.closeButton.setText("Close")
QObject.connect(self.closeButton, QtCore.SIGNAL("clicked()"), self.closeWindow)
self.verticalLayout.addWidget(self.closeButton)
Expand Down
5 changes: 0 additions & 5 deletions src/sextante/gui/InputLayerSelectorPanel.py
Expand Up @@ -4,20 +4,15 @@ class InputLayerSelectorPanel(QtGui.QWidget):

def __init__(self, options):
super(InputLayerSelectorPanel, self).__init__(None)
self.setObjectName("ILSPanel")
self.horizontalLayout = QtGui.QHBoxLayout(self)
self.horizontalLayout.setSpacing(2)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.setObjectName("hLayout")
self.text = QtGui.QComboBox()
#self.text.setEditable(True)
for name, value in options:
self.text.addItem(name, value)
self.text.setObjectName("label")
self.text.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
self.horizontalLayout.addWidget(self.text)
self.pushButton = QtGui.QPushButton()
self.pushButton.setObjectName("pushButton")
self.pushButton.setText("...")
self.pushButton.clicked.connect(self.showSelectionDialog)
self.horizontalLayout.addWidget(self.pushButton)
Expand Down
5 changes: 0 additions & 5 deletions src/sextante/gui/MultipleInputDialog.py
Expand Up @@ -12,26 +12,21 @@ def __init__(self, options, selectedoptions):
self.selectedoptions = None

def setupUi(self):
self.setObjectName("Dialog")
self.resize(381, 320)
self.setWindowTitle("Multiple selection")
self.horizontalLayout = QtGui.QHBoxLayout(self)
self.horizontalLayout.setSpacing(2)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.setObjectName("hLayout")
self.buttonBox = QtGui.QDialogButtonBox()
self.buttonBox.setOrientation(QtCore.Qt.Vertical)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.table = QtGui.QTableWidget()
self.table.setObjectName("table")
self.table.setColumnCount(1)
self.table.setColumnWidth(0,270)
self.table.verticalHeader().setVisible(False)
self.table.horizontalHeader().setVisible(False)
self.table.horizontalHeader().setResizeMode(QtGui.QHeaderView.Stretch)
self.selectAllButton = QtGui.QPushButton()
self.selectAllButton.setObjectName("selectAllButton")
self.selectAllButton.setText("(de)Select all")
self.setTableContent()
self.buttonBox.addButton(self.selectAllButton, QtGui.QDialogButtonBox.ActionRole)
Expand Down
4 changes: 0 additions & 4 deletions src/sextante/gui/MultipleInputPanel.py
Expand Up @@ -12,18 +12,14 @@ def __init__(self, options, parent = None):
super(MultipleInputPanel, self).__init__(parent)
self.options = options
self.selectedoptions = []
self.setObjectName(_fromUtf8("MSPanel"))
self.horizontalLayout = QtGui.QHBoxLayout(self)
self.horizontalLayout.setSpacing(2)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.setObjectName(_fromUtf8("hLayout"))
self.label = QtGui.QLabel()
self.label.setObjectName(_fromUtf8("label"))
self.label.setText("0 elements selected")
self.label.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
self.horizontalLayout.addWidget(self.label)
self.pushButton = QtGui.QPushButton()
self.pushButton.setObjectName(_fromUtf8("pushButton"))
self.pushButton.setText("...")
self.pushButton.clicked.connect(self.showSelectionDialog)
self.horizontalLayout.addWidget(self.pushButton)
Expand Down
3 changes: 0 additions & 3 deletions src/sextante/gui/NumberInputDialog.py
Expand Up @@ -13,12 +13,10 @@ def __init__(self):
self.value = None

def setupUi(self):
self.setObjectName("Parameters")
self.resize(500, 350)
self.buttonBox = QtGui.QDialogButtonBox()
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.label = QtGui.QLabel()
self.label.setText("Enter expression in the text field.\nDouble click on elements in the tree to add their values to the expression.")
self.tree = QtGui.QTreeWidget()
Expand All @@ -31,7 +29,6 @@ def setupUi(self):
self.verticalLayout = QtGui.QVBoxLayout()
self.verticalLayout.setSpacing(2)
self.verticalLayout.setMargin(0)
self.verticalLayout.setObjectName("hLayout")
self.verticalLayout.addWidget(self.label)
self.verticalLayout.addWidget(self.tree)
self.verticalLayout.addWidget(self.formulaText)
Expand Down

0 comments on commit b0ed56a

Please sign in to comment.