Skip to content
Permalink
Browse files

Show Python error stack trace when in blocking dialog

  • Loading branch information
NathanW2 committed Oct 1, 2015
1 parent e263e9e commit 28196684af8cf0bc2257111eb3775477178dd7b5
Showing with 4 additions and 2 deletions.
  1. +4 −2 python/utils.py
@@ -29,7 +29,7 @@
"""

from PyQt4.QtCore import QCoreApplication, QLocale
from PyQt4.QtGui import QPushButton
from PyQt4.QtGui import QPushButton, QApplication
from qgis.core import QGis, QgsExpression, QgsMessageLog, qgsfunction, QgsMessageOutput
from qgis.gui import QgsMessageBar

@@ -74,7 +74,9 @@ def showException(type, value, tb, msg, messagebar=False):
title = QCoreApplication.translate('Python', 'Python error')
QgsMessageLog.logMessage(logmessage, title)

if messagebar and iface:
blockingdialog = QApplication.instance().activeModalWidget()

if messagebar and iface and not blockingdialog:
item = iface.messageBar().currentItem()
if item and item.property("Error") == msg:
# Return of we already have a message with the same error message

3 comments on commit 2819668

@slarosa

This comment has been minimized.

Copy link
Member

@slarosa slarosa replied Oct 4, 2015

@NathanW2 this is good change, but might to happen that the user misses the messagebar whether the mapcanvas is behind some dialog (e.g the DBManager window), especially with small screen.

How we can pop up the error stacktrace for some window like DBManager?

@NathanW2

This comment has been minimized.

Copy link
Member Author

@NathanW2 NathanW2 replied Oct 4, 2015

@slarosa

This comment has been minimized.

Copy link
Member

@slarosa slarosa replied Oct 5, 2015

thanks.

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