Skip to content

Commit

Permalink
added action to import sextante class
Browse files Browse the repository at this point in the history
  • Loading branch information
slarosa committed Sep 13, 2012
1 parent cd36650 commit 315e0c0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
16 changes: 15 additions & 1 deletion python/console.py
Expand Up @@ -112,7 +112,16 @@ def __init__(self, parent=None):
# self.currentLayerButton.setIcon(QIcon("icon/iconTempConsole.png"))
# self.currentLayerButton.setMenuRole(QAction.PreferencesRole)
# self.currentLayerButton.setIconVisibleInMenu(True)
##
## Import Sextante class
self.loadSextanteButton = QAction(parent)
self.loadSextanteButton.setCheckable(False)
self.loadSextanteButton.setEnabled(True)
self.loadSextanteButton.setIcon(QIcon(os.path.dirname(__file__) + "iconConsole/iconSextanteConsole.png"))
self.loadSextanteButton.setMenuRole(QAction.PreferencesRole)
self.loadSextanteButton.setIconVisibleInMenu(True)
self.loadSextanteButton.setToolTip('Import sextante class')
self.loadSextanteButton.setText('Import sextante class')
## Import QgisInterface class
self.loadIfaceButton = QAction(parent)
self.loadIfaceButton.setCheckable(False)
self.loadIfaceButton.setEnabled(True)
Expand Down Expand Up @@ -161,6 +170,7 @@ def __init__(self, parent=None):
self.toolBar.addAction(self.clearButton)
#self.toolBar.addAction(self.currentLayerButton)
self.toolBar.addAction(self.loadIfaceButton)
self.toolBar.addAction(self.loadSextanteButton)
self.toolBar.addAction(self.openFileButton)
self.toolBar.addAction(self.saveFileButton)
self.toolBar.addAction(self.helpButton)
Expand All @@ -180,6 +190,7 @@ def __init__(self, parent=None):
self.clearButton.triggered.connect(self.edit.clearConsole)
#self.currentLayerButton.triggered.connect(self.cLayer)
self.loadIfaceButton.triggered.connect(self.iface)
self.loadSextanteButton.activated.connect(self.sextante)
self.runButton.triggered.connect(self.edit.entered)
self.openFileButton.triggered.connect(self.openScriptFile)
self.saveFileButton.triggered.connect(self.saveScriptFile)
Expand All @@ -190,6 +201,9 @@ def __init__(self, parent=None):

def cLayer(self):
self.edit.commandConsole('cLayer')

def sextante(self):
self.edit.commandConsole('sextante')

def iface(self):
self.edit.commandConsole('iface')
Expand Down
4 changes: 4 additions & 0 deletions python/console_sci.py
Expand Up @@ -132,6 +132,10 @@ def commandConsole(self, command):
"""Import QgisInterface class"""
self.append('from qgis.utils import iface')
self.move_cursor_to_end()
elif command == "sextante":
"""Import Sextante class"""
self.append('from sextante.core.Sextante import Sextante')
self.move_cursor_to_end()
elif command == "cLayer":
"""Retrive current Layer from map camvas"""
self.append('cLayer = iface.mapCanvas().currentLayer()')
Expand Down
1 change: 1 addition & 0 deletions python/iconConsole/CMakeLists.txt
Expand Up @@ -3,6 +3,7 @@ iconClearConsole.png
iconOpenConsole.png
iconRunConsole.png
iconTempConsole.png
iconSextanteConsole.png
iconSaveConsole.png
iconHelpConsole.png
imgHelpDialog.png
Expand Down
Binary file added python/iconConsole/iconSextanteConsole.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 315e0c0

Please sign in to comment.