Skip to content
Permalink
Browse files
Revert "Adding docking support to python console"
This reverts commit f371465e122e525e3e3b10038090bb29be0d0ab7.

git-svn-id: http://svn.osgeo.org/qgis/trunk@14996 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
gsherman committed Jan 5, 2011
1 parent 33c809b commit e8e8bd607ad8230e0a21c6cbdc5968eb5555982d
Showing with 14 additions and 11 deletions.
  1. +14 −11 python/console.py
@@ -24,27 +24,31 @@

from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.utils import iface
import sys
import traceback
import code


_init_commands = ["from qgis.core import *", "import qgis.utils"]


_console = None

def show_console():
""" called from QGIS to open the console """
global _console
if _console is None:
_console = PythonConsole()
_console.setVisible(True)
_console.show()
_console.raise_()
_console.setWindowState( _console.windowState() & ~Qt.WindowMinimized )
_console.activateWindow()



_old_stdout = sys.stdout
_console_output = None


# hook for python console so all output will be redirected
# and then shown in console
def console_displayhook(obj):
@@ -65,18 +69,17 @@ def flush(self):

sys.stdout = QgisOutputCatcher()

class PythonConsole(QDockWidget):

class PythonConsole(QWidget):
def __init__(self, parent=None):
QDockWidget.__init__(self, parent)

self.widget = QWidget()
self.l = QVBoxLayout(self.widget)
QWidget.__init__(self, parent)

self.edit = PythonEdit()
self.l = QVBoxLayout()
self.l.addWidget(self.edit)
self.setWidget(self.widget)

self.setLayout(self.l)
self.setWindowTitle(QCoreApplication.translate("PythonConsole", "Python Console"))
iface.addDockWidget(Qt.BottomDockWidgetArea,self)

s = QSettings()
self.restoreGeometry(s.value("/python/console/geometry").toByteArray())

0 comments on commit e8e8bd6

Please sign in to comment.