Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[processing] added box with console commands for gdal/ogr algs
- Loading branch information
Showing
49 changed files
with
172 additions
and
117 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
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
58 changes: 58 additions & 0 deletions
58
python/plugins/processing/algs/gdal/GdalAlgorithmDialog.py
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,58 @@ | ||
|
||
from PyQt4.QtGui import * | ||
from processing.gui.AlgorithmDialog import AlgorithmDialog | ||
from processing.gui.AlgorithmDialogBase import AlgorithmDialogBase | ||
from processing.gui.ParametersPanel import ParametersPanel | ||
|
||
class GdalAlgorithmDialog(AlgorithmDialog): | ||
|
||
def __init__(self, alg): | ||
AlgorithmDialogBase.__init__(self, alg) | ||
|
||
self.alg = alg | ||
|
||
self.mainWidget = GdalParametersPanel(self, alg) | ||
self.setMainWidget() | ||
self.mainWidget.parametersHaveChanged() | ||
|
||
class GdalParametersPanel(ParametersPanel): | ||
|
||
def __init__(self, parent, alg): | ||
ParametersPanel.__init__(self, parent, alg) | ||
|
||
w = QWidget() | ||
layout = QVBoxLayout() | ||
layout.setMargin(9) | ||
layout.setSpacing(6) | ||
label = QLabel() | ||
label.setText("GDAL/OGR console call") | ||
layout.addWidget(label) | ||
self.text = QPlainTextEdit() | ||
self.text.setEnabled(False) | ||
layout.addWidget(self.text) | ||
w.setLayout(layout) | ||
self.layout().addWidget(w) | ||
|
||
self.connectParameterSignals() | ||
self.parametersHaveChanged() | ||
|
||
def connectParameterSignals(self): | ||
for w in self.widgets.values(): | ||
if isinstance(w, QLineEdit): | ||
w.textChanged.connect(self.parametersHaveChanged) | ||
elif isinstance(w, QComboBox): | ||
w.currentIndexChanged.connect(self.parametersHaveChanged) | ||
elif isinstance(w, QCheckBox): | ||
w.stateChanged.connect(self.parametersHaveChanged) | ||
|
||
def parametersHaveChanged(self): | ||
try: | ||
self.parent.setParamValues() | ||
for output in self.alg.outputs: | ||
if output.value is None: | ||
output.value = "[temporary file]" | ||
commands = self.alg.getConsoleCommands() | ||
commands = [c for c in commands if c not in ['cmd.exe', '/C ']] | ||
self.text.setPlainText(" ".join(commands)) | ||
except: | ||
self.text.setPlainText("") |
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
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
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
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
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
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
Oops, something went wrong.