Skip to content
Permalink
Browse files
Fixed uninstalling redirection from python console
git-svn-id: http://svn.osgeo.org/qgis/trunk@8498 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed May 23, 2008
1 parent 31651d0 commit 3df2b97
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
@@ -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 3df2b97

Please sign in to comment.