Skip to content
Permalink
Browse files

Merge pull request #272 from slarosa/master

Fix #6458
  • Loading branch information
brushtyler committed Oct 5, 2012
2 parents 94bc415 + c212e91 commit ae70f3030071d3ae82c0639c0f32c8d6170f9841
Binary file not shown.
Binary file not shown.
@@ -475,6 +475,8 @@
<file>console/iconSextanteConsole.png</file>
<file>console/iconScriptConsole.png</file>
<file>console/iconIfaceConsole.png</file>
<file>console/iconQtCoreConsole.png</file>
<file>console/iconQtGuiConsole.png</file>
<file>console/iconRunConsole.png</file>
</qresource>
<qresource prefix="/images/tips">
@@ -134,7 +134,7 @@ def __init__(self, parent=None):
self.actionScript.setToolTip(actionScriptBt)
self.actionScript.setText(actionScriptBt)
## Import Sextante class
loadSextanteBt = QCoreApplication.translate("PythonConsole", "Import sextante class")
loadSextanteBt = QCoreApplication.translate("PythonConsole", "Import Sextante class")
self.loadSextanteButton = QAction(parent)
self.loadSextanteButton.setCheckable(False)
self.loadSextanteButton.setEnabled(True)
@@ -144,7 +144,7 @@ def __init__(self, parent=None):
self.loadSextanteButton.setToolTip(loadSextanteBt)
self.loadSextanteButton.setText(loadSextanteBt)
## Import QgisInterface class
loadIfaceBt = QCoreApplication.translate("PythonConsole", "Import iface class")
loadIfaceBt = QCoreApplication.translate("PythonConsole", "Import QgisInterface class")
self.loadIfaceButton = QAction(parent)
self.loadIfaceButton.setCheckable(False)
self.loadIfaceButton.setEnabled(True)
@@ -153,6 +153,26 @@ def __init__(self, parent=None):
self.loadIfaceButton.setIconVisibleInMenu(True)
self.loadIfaceButton.setToolTip(loadIfaceBt)
self.loadIfaceButton.setText(loadIfaceBt)
## Import QtCore class
loadQtCoreBt = QCoreApplication.translate("PythonConsole", "Import PyQt.QtCore class")
self.loadQtCoreButton = QAction(parent)
self.loadQtCoreButton.setCheckable(False)
self.loadQtCoreButton.setEnabled(True)
self.loadQtCoreButton.setIcon(QIcon(":/images/console/iconQtCoreConsole.png"))
self.loadQtCoreButton.setMenuRole(QAction.PreferencesRole)
self.loadQtCoreButton.setIconVisibleInMenu(True)
self.loadQtCoreButton.setToolTip(loadQtCoreBt)
self.loadQtCoreButton.setText(loadQtCoreBt)
## Import QtGui class
loadQtGuiBt = QCoreApplication.translate("PythonConsole", "Import PyQt.QtGui class")
self.loadQtGuiButton = QAction(parent)
self.loadQtGuiButton.setCheckable(False)
self.loadQtGuiButton.setEnabled(True)
self.loadQtGuiButton.setIcon(QIcon(":/images/console/iconQtGuiConsole.png"))
self.loadQtGuiButton.setMenuRole(QAction.PreferencesRole)
self.loadQtGuiButton.setIconVisibleInMenu(True)
self.loadQtGuiButton.setToolTip(loadQtGuiBt)
self.loadQtGuiButton.setText(loadQtGuiBt)
## Action for Open File
openFileBt = QCoreApplication.translate("PythonConsole", "Open script file")
self.openFileButton = QAction(parent)
@@ -203,6 +223,8 @@ def __init__(self, parent=None):
self.classMenu = QMenu(self)
self.classMenu.addAction(self.loadIfaceButton)
self.classMenu.addAction(self.loadSextanteButton)
self.classMenu.addAction(self.loadQtCoreButton)
self.classMenu.addAction(self.loadQtGuiButton)
cM = self.toolBar.widgetForAction(self.actionClass)
cM.setMenu(self.classMenu)
cM.setPopupMode(QToolButton.InstantPopup)
@@ -229,6 +251,8 @@ def __init__(self, parent=None):
#self.currentLayerButton.triggered.connect(self.cLayer)
self.loadIfaceButton.triggered.connect(self.iface)
self.loadSextanteButton.triggered.connect(self.sextante)
self.loadQtCoreButton.triggered.connect(self.qtCore)
self.loadQtGuiButton.triggered.connect(self.qtGui)
self.runButton.triggered.connect(self.edit.entered)
self.openFileButton.triggered.connect(self.openScriptFile)
self.saveFileButton.triggered.connect(self.saveScriptFile)
@@ -245,6 +269,12 @@ def sextante(self):

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

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

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

def openScriptFile(self):
settings = QSettings()
@@ -151,6 +151,14 @@ def commandConsole(self, command):
"""Retrieve current Layer from map camvas"""
self.append('cLayer = iface.mapCanvas().currentLayer()')
self.move_cursor_to_end()
elif command == "qtCore":
"""Import QtCore class"""
self.append('from PyQt4.QtCore import *')
self.move_cursor_to_end()
elif command == "qtGui":
"""Import QtGui class"""
self.append('from PyQt4.QtGui import *')
self.move_cursor_to_end()
self.setFocus()

def setLexers(self, lexer):
@@ -93,13 +93,23 @@ <h4 id="toolbar">Toolbar</h4>
<tr>
<td><img src="qrc:/images/console/iconClassConsole.png" /></td>
<td><img src="qrc:/images/console/iconIfaceConsole.png" /></td>
<td><span id="toolbarIfaceClass">Tool to import iface class</span></td>
<td><span id="toolbarIfaceClass">Tool to import QgisInterface class</span></td>
</tr>
<tr>
<td></td>
<td><img src="qrc:/images/console/iconSextanteConsole.png" /></td>
<td><span id="toolbarSextClass">Tool to import Sextante class</span></td>
</tr>
<tr>
<td></td>
<td><img src="qrc:/images/console/iconQtCoreConsole.png" /></td>
<td><span id="toolbarQtCoreClass">Tool to import PyQt4.QtCore class</span></td>
</tr>
<tr>
<td></td>
<td><img src="qrc:/images/console/iconQtGuiConsole.png" /></td>
<td><span id="toolbarQtGuiClass">Tool to import PyQt4.QtGui class</span></td>
</tr>
<tr>
<td><img src="qrc:/images/console/iconScriptConsole.png" /></td>
<td><img src="qrc:/images/console/iconOpenConsole.png" /></td>
@@ -20,6 +20,8 @@ i18n_dict = {
"toolbar.clear" : "Tool to clear python console",
"toolbar.iface" : "Tool to import iface class",
"toolbar.sextante" : "Tool to import Sextante class",
"toolbar.qtcore" : "Tool to import PyQt4.QtCore class",
"toolbar.qtgui" : "Tool to import PyQt4.QtGui class",
"toolbar.script.open" : "Tool to open a python script and load in console",
"toolbar.script.save" : "Tool to save a python script",
"toolbar.help" : "Help",
@@ -20,6 +20,8 @@ i18n_dict = {
"toolbar.clear" : "Strumento per pulire la console",
"toolbar.iface" : "Strumento per importare la classe iface, per accedere all'ambiente QGIS",
"toolbar.sextante" : "Strumento per importare la classe Sextante",
"toolbar.qtcore" : "Strumento per importare la classe PyQt4.QtCore",
"toolbar.qtgui" : "Strumento per importare la classe PyQt4.QtGui",
"toolbar.script.open" : "Strumento per aprire un script python da eseguire in console",
"toolbar.script.save" : "Strumento per salvare uno script python sul disco",
"toolbar.help" : "Aiuto",
@@ -15,6 +15,8 @@ $('span#toolbarTitle').text($.i18n._('toolbar.title'));
$('span#toolbarClear').text($.i18n._('toolbar.clear'));
$('span#toolbarIfaceClass').text($.i18n._('toolbar.iface'));
$('span#toolbarSextClass').text($.i18n._('toolbar.sextante'));
$('span#toolbarQtCoreClass').text($.i18n._('toolbar.qtcore'));
$('span#toolbarQtGuiClass').text($.i18n._('toolbar.qtgui'));
$('span#toolbarScriptOpen').text($.i18n._('toolbar.script.open'));
$('span#toolbarScriptSave').text($.i18n._('toolbar.script.save'));
$('span#toolbarHelp').text($.i18n._('toolbar.help'));

0 comments on commit ae70f30

Please sign in to comment.
You can’t perform that action at this time.