Skip to content

Commit

Permalink
[processing] some refactoring. Removed old-style signals connection
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Oct 6, 2013
1 parent 17f3f79 commit acbd165
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 27 deletions.
1 change: 0 additions & 1 deletion python/plugins/processing/gui/EditScriptAction.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@


from processing.gui.ContextAction import ContextAction from processing.gui.ContextAction import ContextAction
from processing.gui.ScriptEditorDialog import ScriptEditorDialog from processing.gui.ScriptEditorDialog import ScriptEditorDialog

from processing.r.RAlgorithm import RAlgorithm from processing.r.RAlgorithm import RAlgorithm
from processing.script.ScriptAlgorithm import ScriptAlgorithm from processing.script.ScriptAlgorithm import ScriptAlgorithm


Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/ExtentSelectionPanel.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __init__(self, dialog, alg, default):
canvas = interface.iface.mapCanvas() canvas = interface.iface.mapCanvas()
self.prevMapTool = canvas.mapTool() self.prevMapTool = canvas.mapTool()
self.tool = RectangleMapTool(canvas) self.tool = RectangleMapTool(canvas)
self.connect(self.tool, SIGNAL('rectangleCreated()'), self.fillCoords) self.tool.rectangleCreated.connect(self.fillCoords)


def canUseAutoExtent(self): def canUseAutoExtent(self):
for param in self.params: for param in self.params:
Expand Down
14 changes: 5 additions & 9 deletions python/plugins/processing/gui/FixedTableDialog.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -75,14 +75,10 @@ def setupUi(self):
self.horizontalLayout.addWidget(self.table) self.horizontalLayout.addWidget(self.table)
self.horizontalLayout.addWidget(self.buttonBox) self.horizontalLayout.addWidget(self.buttonBox)
self.setLayout(self.horizontalLayout) self.setLayout(self.horizontalLayout)
QObject.connect(self.buttonBox, QtCore.SIGNAL('accepted()'), self.buttonBox.accepted.connect(self.okPressed)
self.okPressed) self.buttonBox.rejected.connect(self.cancelPressed)
QObject.connect(self.buttonBox, QtCore.SIGNAL('rejected()'), self.addRowButton.clicked.connect(self.addRow)
self.cancelPressed) self.removeRowButton.clicked.connect(self.removeRow)
QObject.connect(self.addRowButton, QtCore.SIGNAL('clicked()'),
self.addRow)
QObject.connect(self.removeRowButton, QtCore.SIGNAL('clicked()'),
self.removeRow)
QtCore.QMetaObject.connectSlotsByName(self) QtCore.QMetaObject.connectSlotsByName(self)


def setTableContent(self): def setTableContent(self):
Expand Down Expand Up @@ -112,4 +108,4 @@ def addRow(self):
self.table.setRowHeight(self.table.rowCount() - 1, 22) self.table.setRowHeight(self.table.rowCount() - 1, 22)
for i in range(self.table.columnCount()): for i in range(self.table.columnCount()):
self.table.setItem(self.table.rowCount() - 1, i, self.table.setItem(self.table.rowCount() - 1, i,
QtGui.QTableWidgetItem('0')) QtGui.QTableWidgetItem('0'))
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/FixedTablePanel.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


__revision__ = '$Format:%H$' __revision__ = '$Format:%H$'


from PyQt4 import QtCore, QtGui from PyQt4 import QtGui
from processing.gui.FixedTableDialog import FixedTableDialog from processing.gui.FixedTableDialog import FixedTableDialog




Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/MultipleInputDialog.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ def toggleSelection(self):
break break
for i in range(len(self.options)): for i in range(len(self.options)):
widget = self.tblLayers.cellWidget(i, 0) widget = self.tblLayers.cellWidget(i, 0)
widget.setChecked(checked) widget.setChecked(checked)
15 changes: 1 addition & 14 deletions python/plugins/processing/gui/MultipleInputPanel.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -57,20 +57,7 @@ def setSelectedItems(self, selected):
+ ' elements selected') + ' elements selected')


def showSelectionDialog(self): def showSelectionDialog(self):
# =====================================================================
# #If there is a datatype, we use it to create the list of options
# if self.datatype is not None:
# if self.datatype == ParameterMultipleInput.TYPE_RASTER:
# options = dataobjects.getRasterLayers()
# elif self.datatype == ParameterMultipleInput.TYPE_VECTOR_ANY:
# options = dataobjects.getVectorLayers()
# else:
# options = dataobjects.getVectorLayers(self.datatype)
# opts = []
# for opt in options:
# opts.append(opt.name())
# self.options = opts
# =====================================================================
dlg = MultipleInputDialog(self.options, self.selectedoptions) dlg = MultipleInputDialog(self.options, self.selectedoptions)
dlg.exec_() dlg.exec_()
if dlg.selectedoptions is not None: if dlg.selectedoptions is not None:
Expand Down

0 comments on commit acbd165

Please sign in to comment.