[QGIS Commit] r10044 - trunk/qgis/python/plugins/ftools/tools
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Thu Jan 29 13:50:25 EST 2009
Author: cfarmer
Date: 2009-01-29 13:50:25 -0500 (Thu, 29 Jan 2009)
New Revision: 10044
Modified:
trunk/qgis/python/plugins/ftools/tools/doVectorGrid.py
trunk/qgis/python/plugins/ftools/tools/frmVectorGrid.py
trunk/qgis/python/plugins/ftools/tools/frmVectorGrid.ui
Log:
fix error in adding output to mapcanvas & ability to create grid
coverage of current zoom level
Modified: trunk/qgis/python/plugins/ftools/tools/doVectorGrid.py
===================================================================
--- trunk/qgis/python/plugins/ftools/tools/doVectorGrid.py 2009-01-29 16:48:17 UTC (rev 10043)
+++ trunk/qgis/python/plugins/ftools/tools/doVectorGrid.py 2009-01-29 18:50:25 UTC (rev 10044)
@@ -43,7 +43,8 @@
QObject.connect(self.toolOut, SIGNAL("clicked()"), self.outFile)
QObject.connect(self.spnX, SIGNAL("valueChanged(double)"), self.offset)
#QObject.connect(self.inShape, SIGNAL("currentIndexChanged(QString)"), self.updateInput)
- QObject.connect(self.btnUpdate, SIGNAL("clicked()"), self.updateInput)
+ QObject.connect(self.btnUpdate, SIGNAL("clicked()"), self.updateLayer)
+ QObject.connect(self.btnCanvas, SIGNAL("clicked()"), self.updateCanvas)
self.setWindowTitle("Vector grid")
self.xMin.setValidator(QDoubleValidator(self.xMin))
self.xMax.setValidator(QDoubleValidator(self.xMax))
@@ -58,13 +59,17 @@
if self.chkLock.isChecked():
self.spnY.setValue(value)
- def updateInput( self ):
+ def updateLayer( self ):
mLayerName = self.inShape.currentText()
if not mLayerName == "":
mLayer = self.getMapLayerByName( unicode( mLayerName ) )
- self.inLayer = mLayer
boundBox = mLayer.extent()
self.updateExtents( boundBox )
+
+ def updateCanvas( self ):
+ canvas = self.iface.mapCanvas()
+ boundBox = canvas.extent()
+ self.updateExtents( boundBox )
def updateExtents( self, boundBox ):
self.xMin.setText( unicode( boundBox.xMinimum() ) )
@@ -93,7 +98,7 @@
self.outShape.clear()
self.compute( boundBox, xSpace, ySpace, polygon )
addToTOC = QMessageBox.question(self,
- "Generate Vector Grid", "Created output Shapefile:\n" + outPath
+ "Generate Vector Grid", "Created output Shapefile:\n" + self.shapefileName
+ "\nNote: Layer has no associated coordinate system, please use "
+ "the Projection Management Tool to specify spatial reference system."
+ "\n\nWould you like to add the new layer to the TOC?",
Modified: trunk/qgis/python/plugins/ftools/tools/frmVectorGrid.py
===================================================================
--- trunk/qgis/python/plugins/ftools/tools/frmVectorGrid.py 2009-01-29 16:48:17 UTC (rev 10043)
+++ trunk/qgis/python/plugins/ftools/tools/frmVectorGrid.py 2009-01-29 18:50:25 UTC (rev 10044)
@@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'frmVectorGrid.ui'
#
-# Created: Tue Jan 27 23:10:42 2009
+# Created: Thu Jan 29 18:39:47 2009
# by: PyQt4 UI code generator 4.3.3
#
# WARNING! All changes made in this file will be lost!
@@ -25,16 +25,19 @@
self.gridlayout1 = QtGui.QGridLayout(self.groupBox)
self.gridlayout1.setObjectName("gridlayout1")
- spacerItem = QtGui.QSpacerItem(80,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum)
- self.gridlayout1.addItem(spacerItem,1,0,1,1)
+ self.inShape = QtGui.QComboBox(self.groupBox)
+ self.inShape.setObjectName("inShape")
+ self.gridlayout1.addWidget(self.inShape,0,0,1,2)
self.btnUpdate = QtGui.QToolButton(self.groupBox)
self.btnUpdate.setMinimumSize(QtCore.QSize(0,30))
self.btnUpdate.setObjectName("btnUpdate")
- self.gridlayout1.addWidget(self.btnUpdate,1,1,1,2)
+ self.gridlayout1.addWidget(self.btnUpdate,1,0,1,1)
- spacerItem1 = QtGui.QSpacerItem(79,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum)
- self.gridlayout1.addItem(spacerItem1,1,3,1,1)
+ self.btnCanvas = QtGui.QToolButton(self.groupBox)
+ self.btnCanvas.setMinimumSize(QtCore.QSize(0,30))
+ self.btnCanvas.setObjectName("btnCanvas")
+ self.gridlayout1.addWidget(self.btnCanvas,1,1,1,1)
self.hboxlayout = QtGui.QHBoxLayout()
self.hboxlayout.setObjectName("hboxlayout")
@@ -48,7 +51,7 @@
self.xMin.setEnabled(True)
self.xMin.setObjectName("xMin")
self.hboxlayout.addWidget(self.xMin)
- self.gridlayout1.addLayout(self.hboxlayout,2,0,1,2)
+ self.gridlayout1.addLayout(self.hboxlayout,2,0,1,1)
self.hboxlayout1 = QtGui.QHBoxLayout()
self.hboxlayout1.setObjectName("hboxlayout1")
@@ -62,7 +65,7 @@
self.yMin.setEnabled(True)
self.yMin.setObjectName("yMin")
self.hboxlayout1.addWidget(self.yMin)
- self.gridlayout1.addLayout(self.hboxlayout1,2,2,1,2)
+ self.gridlayout1.addLayout(self.hboxlayout1,2,1,1,1)
self.hboxlayout2 = QtGui.QHBoxLayout()
self.hboxlayout2.setObjectName("hboxlayout2")
@@ -76,7 +79,7 @@
self.xMax.setEnabled(True)
self.xMax.setObjectName("xMax")
self.hboxlayout2.addWidget(self.xMax)
- self.gridlayout1.addLayout(self.hboxlayout2,3,0,1,2)
+ self.gridlayout1.addLayout(self.hboxlayout2,3,0,1,1)
self.hboxlayout3 = QtGui.QHBoxLayout()
self.hboxlayout3.setObjectName("hboxlayout3")
@@ -90,11 +93,7 @@
self.yMax.setEnabled(True)
self.yMax.setObjectName("yMax")
self.hboxlayout3.addWidget(self.yMax)
- self.gridlayout1.addLayout(self.hboxlayout3,3,2,1,2)
-
- self.inShape = QtGui.QComboBox(self.groupBox)
- self.inShape.setObjectName("inShape")
- self.gridlayout1.addWidget(self.inShape,0,0,1,4)
+ self.gridlayout1.addLayout(self.hboxlayout3,3,1,1,1)
self.gridlayout.addWidget(self.groupBox,0,0,1,2)
self.gridBox = QtGui.QGroupBox(Dialog)
@@ -103,8 +102,8 @@
self.gridlayout2 = QtGui.QGridLayout(self.gridBox)
self.gridlayout2.setObjectName("gridlayout2")
- spacerItem2 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum)
- self.gridlayout2.addItem(spacerItem2,0,0,1,1)
+ spacerItem = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum)
+ self.gridlayout2.addItem(spacerItem,0,0,1,1)
self.label_7 = QtGui.QLabel(self.gridBox)
self.label_7.setObjectName("label_7")
@@ -123,11 +122,11 @@
self.chkLock.setObjectName("chkLock")
self.gridlayout2.addWidget(self.chkLock,0,3,2,1)
- spacerItem3 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum)
- self.gridlayout2.addItem(spacerItem3,0,4,1,1)
+ spacerItem1 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum)
+ self.gridlayout2.addItem(spacerItem1,0,4,1,1)
- spacerItem4 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum)
- self.gridlayout2.addItem(spacerItem4,1,0,1,1)
+ spacerItem2 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum)
+ self.gridlayout2.addItem(spacerItem2,1,0,1,1)
self.label_8 = QtGui.QLabel(self.gridBox)
self.label_8.setEnabled(False)
@@ -200,6 +199,7 @@
Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Generate Regular Points", None, QtGui.QApplication.UnicodeUTF8))
self.groupBox.setTitle(QtGui.QApplication.translate("Dialog", "Grid extent", None, QtGui.QApplication.UnicodeUTF8))
self.btnUpdate.setText(QtGui.QApplication.translate("Dialog", "Update extents from layer", None, QtGui.QApplication.UnicodeUTF8))
+ self.btnCanvas.setText(QtGui.QApplication.translate("Dialog", "Update extents from canvas", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("Dialog", "X Min", None, QtGui.QApplication.UnicodeUTF8))
self.label_4.setText(QtGui.QApplication.translate("Dialog", "Y Min", None, QtGui.QApplication.UnicodeUTF8))
self.label_3.setText(QtGui.QApplication.translate("Dialog", "X Max", None, QtGui.QApplication.UnicodeUTF8))
Modified: trunk/qgis/python/plugins/ftools/tools/frmVectorGrid.ui
===================================================================
--- trunk/qgis/python/plugins/ftools/tools/frmVectorGrid.ui 2009-01-29 16:48:17 UTC (rev 10043)
+++ trunk/qgis/python/plugins/ftools/tools/frmVectorGrid.ui 2009-01-29 18:50:25 UTC (rev 10044)
@@ -25,20 +25,10 @@
<string>Grid extent</string>
</property>
<layout class="QGridLayout" name="gridLayout" >
- <item row="1" column="0" >
- <spacer name="horizontalSpacer" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0" >
- <size>
- <width>80</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
+ <item row="0" column="0" colspan="2" >
+ <widget class="QComboBox" name="inShape" />
</item>
- <item row="1" column="1" colspan="2" >
+ <item row="1" column="0" >
<widget class="QToolButton" name="btnUpdate" >
<property name="minimumSize" >
<size>
@@ -51,20 +41,20 @@
</property>
</widget>
</item>
- <item row="1" column="3" >
- <spacer name="horizontalSpacer_2" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0" >
+ <item row="1" column="1" >
+ <widget class="QToolButton" name="btnCanvas" >
+ <property name="minimumSize" >
<size>
- <width>79</width>
- <height>20</height>
+ <width>0</width>
+ <height>30</height>
</size>
</property>
- </spacer>
+ <property name="text" >
+ <string>Update extents from canvas</string>
+ </property>
+ </widget>
</item>
- <item row="2" column="0" colspan="2" >
+ <item row="2" column="0" >
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label" >
@@ -91,7 +81,7 @@
</item>
</layout>
</item>
- <item row="2" column="2" colspan="2" >
+ <item row="2" column="1" >
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_4" >
@@ -118,7 +108,7 @@
</item>
</layout>
</item>
- <item row="3" column="0" colspan="2" >
+ <item row="3" column="0" >
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_3" >
@@ -145,7 +135,7 @@
</item>
</layout>
</item>
- <item row="3" column="2" colspan="2" >
+ <item row="3" column="1" >
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_5" >
@@ -172,9 +162,6 @@
</item>
</layout>
</item>
- <item row="0" column="0" colspan="4" >
- <widget class="QComboBox" name="inShape" />
- </item>
</layout>
</widget>
</item>
@@ -360,12 +347,6 @@
</widget>
</item>
</layout>
- <zorder>groupBox</zorder>
- <zorder>gridBox</zorder>
- <zorder>label_2</zorder>
- <zorder>progressBar</zorder>
- <zorder>buttonBox_2</zorder>
- <zorder>inShape</zorder>
</widget>
<resources/>
<connections>
More information about the QGIS-commit
mailing list