Skip to content
Permalink
Browse files

Fixed uninstalling redirection from python console

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8498 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed May 23, 2008
1 parent 05c7ae3 commit be58c264cf042108f0073ce83c01797c72465b9a
Showing with 14 additions and 5 deletions.
  1. +9 −1 src/app/qgspythondialog.cpp
  2. +5 −0 src/app/qgspythondialog.h
  3. +0 −4 src/app/qgspythonutils.cpp
@@ -17,6 +17,8 @@
#include "qgspythondialog.h"
#include "qgspythonutils.h"

#include <QCloseEvent>

QgsPythonDialog::QgsPythonDialog(QgisInterface* pIface, QWidget *parent)
: QDialog(parent)
{
@@ -28,7 +30,6 @@ QgsPythonDialog::QgsPythonDialog(QgisInterface* pIface, QWidget *parent)

QgsPythonDialog::~QgsPythonDialog()
{
QgsPythonUtils::uninstallConsoleHooks();
}

QString QgsPythonDialog::escapeHtml(QString text)
@@ -72,3 +73,10 @@ void QgsPythonDialog::on_edtCmdLine_returnPressed()
txtHistory->moveCursor(QTextCursor::End);
txtHistory->ensureCursorVisible();
}

void QgsPythonDialog::closeEvent(QCloseEvent* event)
{
QgsPythonUtils::uninstallConsoleHooks();

QDialog::closeEvent(event);
}
@@ -20,6 +20,7 @@
#include "ui_qgspythondialog.h"

class QgisInterface;
class QCloseEvent;

class QgsPythonDialog : public QDialog, private Ui::QgsPythonDialog
{
@@ -36,6 +37,10 @@ class QgsPythonDialog : public QDialog, private Ui::QgsPythonDialog

void on_edtCmdLine_returnPressed();

protected:

void closeEvent(QCloseEvent* event);

private:

QgisInterface* mIface;
@@ -150,10 +150,6 @@ void QgsPythonUtils::uninstallConsoleHooks()
{
runString("sys.displayhook = sys.__displayhook__");
runString("sys.stdout = _old_stdout");

// TODO: uninstalling stdout redirection doesn't work

//installErrorHook();
}


0 comments on commit be58c26

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