Skip to content
Permalink
Browse files
remove item QgsInterface from import class menu in python console
since a369ed0 it is no longer necessary to import iface object
  • Loading branch information
slarosa committed Jan 12, 2013
1 parent 13bfb5e commit 8203effa726cc54d349da4034d7cf4e404a3205f
Showing with 3 additions and 21 deletions.
  1. +0 −15 python/console/console.py
  2. +1 −1 python/console/console_output.py
  3. +2 −5 python/console/console_sci.py
@@ -167,16 +167,6 @@ def __init__(self, parent=None):
self.loadSextanteButton.setIconVisibleInMenu(True)
self.loadSextanteButton.setToolTip(loadSextanteBt)
self.loadSextanteButton.setText(loadSextanteBt)
## Import QgisInterface class
loadIfaceBt = QCoreApplication.translate("PythonConsole", "Import QgisInterface class")
self.loadIfaceButton = QAction(parent)
self.loadIfaceButton.setCheckable(False)
self.loadIfaceButton.setEnabled(True)
self.loadIfaceButton.setIcon(QgsApplication.getThemeIcon("console/iconIfaceConsole.png"))
self.loadIfaceButton.setMenuRole(QAction.PreferencesRole)
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)
@@ -246,7 +236,6 @@ def __init__(self, parent=None):
self.toolBar.addAction(self.runButton)
## Menu Import Class
self.classMenu = QMenu(self)
self.classMenu.addAction(self.loadIfaceButton)
self.classMenu.addAction(self.loadSextanteButton)
self.classMenu.addAction(self.loadQtCoreButton)
self.classMenu.addAction(self.loadQtGuiButton)
@@ -293,7 +282,6 @@ def __init__(self, parent=None):

self.clearButton.triggered.connect(self.textEditOut.clearConsole)
self.optionsButton.triggered.connect(self.openSettings)
self.loadIfaceButton.triggered.connect(self.iface)
self.loadSextanteButton.triggered.connect(self.sextante)
self.loadQtCoreButton.triggered.connect(self.qtCore)
self.loadQtGuiButton.triggered.connect(self.qtGui)
@@ -307,9 +295,6 @@ def __init__(self, parent=None):
def sextante(self):
self.edit.commandConsole('sextante')

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

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

@@ -125,7 +125,7 @@ def __init__(self, parent=None):
def insertInitText(self):
txtInit = QCoreApplication.translate("PythonConsole",
"## To access Quantum GIS environment from this console\n"
"## iface object (instance of QgisInterface class). \n"
"## use iface object (instance of QgisInterface class). \n"
"## Type help(iface) for more info and list of methods.\n\n")
initText = self.setText(txtInit)

@@ -31,7 +31,7 @@
import code

_init_commands = ["from qgis.core import *", "import qgis.utils",
"from qgis.utils import iface"]
"from qgis.utils import iface"]
_historyFile = os.path.join(str(QDir.homePath()),".qgis","console_history.txt")

class PythonEdit(QsciScintilla, code.InteractiveInterpreter):
@@ -128,10 +128,7 @@ def commandConsole(self, command):
selCmdLenght = self.text(line).length()
self.setSelection(line, 4, line, selCmdLenght)
self.removeSelectedText()
if command == "iface":
# import QgisInterface class
self.append('from qgis.utils import iface')
elif command == "sextante":
if command == "sextante":
# import Sextante class
self.append('import sextante')
elif command == "qtCore":

0 comments on commit 8203eff

Please sign in to comment.