class Debugger: def __init__(self,showLineNumbers=True): title = _("Debug") self.debugWidget = QWidget() self.traceback = DebugContainer(self.debugWidget,showLineNumbers) l = QVBoxLayout(self.debugWidget) l.addWidget(self.traceback) self.window = Dialog(title,self.debugWidget,None,extraButtons=True) self.window.resize(500,400) self.aspect = DebuggerAspect(self) def showWindow(self): self.window.show() def log(self,log,type=1): self.traceback.add(QString(log),type)
class Debugger: def __init__(self,showTimeStamp=True): title = _("Debugging Console") self.debugWidget = QtGui.QWidget() self.debugShortCut = QtGui.QShortcut(QtGui.QKeySequence(Qt.Key_F2),self.debugWidget) QObject.connect(self.debugShortCut, SIGNAL("activated()"), self.toggleDebug) self.traceback = DebugContainer(self.debugWidget,showTimeStamp) self.loglevel = QtGui.QComboBox(self.debugWidget) self.loglevel.addItem("0: Developer Messages") self.loglevel.addItem("1: All Messages") QObject.connect(self.loglevel, SIGNAL("currentIndexChanged(int)"),self.loglevelChanged) l = QtGui.QVBoxLayout(self.debugWidget) l.addWidget(self.loglevel) l.addWidget(self.traceback) self.window = Dialog(title,self.debugWidget) self.window.resize(500,400) self.aspect = DebuggerAspect(self) def loglevelChanged(self,newLevel): self.traceback.level = newLevel def showWindow(self): self.window.show() def hideWindow(self): self.window.hide() def isVisible(self): return self.window.isVisible() def toggleDebug(self): if self.isVisible(): self.hideWindow() else: self.showWindow() def log(self,log,type=0,indent=0): if ctx.debugEnabled and not log == '': self.traceback.add(unicode(log),type,indent)
def showReleaseNotes(self): # make a release notes dialog r = GUIRelNotes.Widget(self) d = Dialog(_("Release Notes"), r, self) d.resize(500,400) d.show()