X-Git-Url: https://jfr.im/git/irc/weechat/qweechat.git/blobdiff_plain/7dcf23b19547e37dbadd98aaed99ce4656471dbe..2a0b6adc578705e924fb35648144f6480e2cda3a:/src/qweechat/debug.py diff --git a/src/qweechat/debug.py b/src/qweechat/debug.py index c6ce37f..e14cdab 100644 --- a/src/qweechat/debug.py +++ b/src/qweechat/debug.py @@ -1,7 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright (C) 2011 Sebastien Helleu +# debug.py - debug window +# +# Copyright (C) 2011-2013 Sebastien Helleu # # This file is part of QWeeChat, a Qt remote GUI for WeeChat. # @@ -19,10 +21,6 @@ # along with QWeeChat. If not, see . # -# -# Debug window. -# - import qt_compat QtGui = qt_compat.import_module('QtGui') from chat import ChatTextEdit @@ -33,11 +31,11 @@ class DebugDialog(QtGui.QDialog): """Debug dialog.""" def __init__(self, *args): - apply(QtGui.QDialog.__init__, (self,) + args) + QtGui.QDialog.__init__(*(self,) + args) self.resize(640, 480) self.setWindowTitle('Debug console') - self.chat = ChatTextEdit() + self.chat = ChatTextEdit(debug=True) self.input = InputLineEdit(self.chat) vbox = QtGui.QVBoxLayout() @@ -45,3 +43,8 @@ class DebugDialog(QtGui.QDialog): vbox.addWidget(self.input) self.setLayout(vbox) + self.show() + + def display_lines(self, lines): + for line in lines: + self.chat.display(*line[0], **line[1])