Skip to content

Commit dade1eb

Browse files
author
gsherman
committed
Revert "Adding docking support to python console"
This reverts commit f371465e122e525e3e3b10038090bb29be0d0ab7. git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14996 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 24c2dd2 commit dade1eb

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

python/console.py

+14-11
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,31 @@
2424

2525
from PyQt4.QtCore import *
2626
from PyQt4.QtGui import *
27-
from qgis.utils import iface
2827
import sys
2928
import traceback
3029
import code
3130

3231

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

34+
3535
_console = None
3636

3737
def show_console():
3838
""" called from QGIS to open the console """
3939
global _console
4040
if _console is None:
4141
_console = PythonConsole()
42-
_console.setVisible(True)
42+
_console.show()
43+
_console.raise_()
44+
_console.setWindowState( _console.windowState() & ~Qt.WindowMinimized )
45+
_console.activateWindow()
46+
47+
4348

4449
_old_stdout = sys.stdout
4550
_console_output = None
4651

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

6670
sys.stdout = QgisOutputCatcher()
6771

68-
class PythonConsole(QDockWidget):
72+
73+
class PythonConsole(QWidget):
6974
def __init__(self, parent=None):
70-
QDockWidget.__init__(self, parent)
71-
72-
self.widget = QWidget()
73-
self.l = QVBoxLayout(self.widget)
75+
QWidget.__init__(self, parent)
76+
7477
self.edit = PythonEdit()
78+
self.l = QVBoxLayout()
7579
self.l.addWidget(self.edit)
76-
self.setWidget(self.widget)
77-
80+
self.setLayout(self.l)
7881
self.setWindowTitle(QCoreApplication.translate("PythonConsole", "Python Console"))
79-
iface.addDockWidget(Qt.BottomDockWidgetArea,self)
82+
8083
s = QSettings()
8184
self.restoreGeometry(s.value("/python/console/geometry").toByteArray())
8285

0 commit comments

Comments
 (0)