-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed GRASS bug when using v.* algorithms git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@135 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
- Loading branch information
volayaf
committed
Apr 20, 2012
1 parent
66e027a
commit 319e082
Showing
8 changed files
with
100 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from PyQt4.QtCore import * | ||
from PyQt4.QtGui import * | ||
from qgis.core import * | ||
from qgis.gui import * | ||
|
||
class CrsSelectionDialog(QDialog): | ||
|
||
def __init__(self): | ||
QDialog.__init__(self) | ||
self.epsg = None | ||
layout = QVBoxLayout() | ||
self.selector = QgsProjectionSelector(self) | ||
buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Close) | ||
layout.addWidget(self.selector) | ||
layout.addWidget(buttonBox) | ||
self.setLayout(layout) | ||
|
||
self.connect(buttonBox, SIGNAL("accepted()"), self.okPressed) | ||
self.connect(buttonBox, SIGNAL("rejected()"), self.cancelPressed) | ||
|
||
def okPressed(self): | ||
self.epsg = self.selector.selectedEpsg() | ||
self.close() | ||
|
||
def cancelPressed(self): | ||
self.epsg = None | ||
self.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from PyQt4 import QtGui, QtCore | ||
from sextante.core.SextanteUtils import SextanteUtils | ||
from sextante.gui.CrsSelectionDialog import CrsSelectionDialog | ||
|
||
class CrsSelectionPanel(QtGui.QWidget): | ||
|
||
def __init__(self, default): | ||
super(CrsSelectionPanel, self).__init__(None) | ||
self.epsg = default | ||
self.horizontalLayout = QtGui.QHBoxLayout(self) | ||
self.horizontalLayout.setSpacing(2) | ||
self.horizontalLayout.setMargin(0) | ||
self.text = QtGui.QLineEdit() | ||
self.text.setEnabled(False) | ||
self.text.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) | ||
self.horizontalLayout.addWidget(self.text) | ||
self.pushButton = QtGui.QPushButton() | ||
self.pushButton.setText("...") | ||
self.pushButton.clicked.connect(self.showSelectionDialog) | ||
self.horizontalLayout.addWidget(self.pushButton) | ||
self.setLayout(self.horizontalLayout) | ||
self.setText() | ||
|
||
def showSelectionDialog(self): | ||
dialog = CrsSelectionDialog() | ||
dialog.exec_() | ||
if dialog.epsg: | ||
self.epsg = str(dialog.epsg) | ||
self.setText() | ||
|
||
def setText(self): | ||
self.text.setText("EPSG:" + str(self.epsg)) | ||
|
||
def getValue(self): | ||
return self.epsg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from sextante.parameters.Parameter import Parameter | ||
|
||
class ParameterCrs(Parameter): | ||
|
||
def __init__(self, name="", description="", default = "4326"): | ||
'''The values is the EPSG code of the CRS''' | ||
self.name = name | ||
self.description = description | ||
self.value = None | ||
self.default = default | ||
|
||
def getValueAsCommandLineParameter(self): | ||
return "\"" + str(self.value) + "\"" | ||
|
||
def serialize(self): | ||
return self.__module__.split(".")[-1] + "|" + self.name + "|" + self.description +\ | ||
"|" + str(self.default) | ||
|
||
def deserialize(self, s): | ||
tokens = s.split("|") | ||
return ParameterCrs(tokens[0], tokens[1], tokens[2]) | ||
|
||
def getAsScriptCode(self): | ||
return "##" + self.name + "=crs " + str(self.default) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters