]> jfr.im git - irc/weechat/qweechat.git/blob - qweechat/debug.py
Update copyright dates
[irc/weechat/qweechat.git] / qweechat / debug.py
1 # -*- coding: utf-8 -*-
2 #
3 # debug.py - debug window
4 #
5 # Copyright (C) 2011-2018 Sébastien Helleu <flashcode@flashtux.org>
6 #
7 # This file is part of QWeeChat, a Qt remote GUI for WeeChat.
8 #
9 # QWeeChat is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 3 of the License, or
12 # (at your option) any later version.
13 #
14 # QWeeChat is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with QWeeChat. If not, see <http://www.gnu.org/licenses/>.
21 #
22
23 import qt_compat
24 from chat import ChatTextEdit
25 from input import InputLineEdit
26
27 QtGui = qt_compat.import_module('QtGui')
28
29
30 class DebugDialog(QtGui.QDialog):
31 """Debug dialog."""
32
33 def __init__(self, *args):
34 QtGui.QDialog.__init__(*(self,) + args)
35 self.resize(640, 480)
36 self.setWindowTitle('Debug console')
37
38 self.chat = ChatTextEdit(debug=True)
39 self.input = InputLineEdit(self.chat)
40
41 vbox = QtGui.QVBoxLayout()
42 vbox.addWidget(self.chat)
43 vbox.addWidget(self.input)
44
45 self.setLayout(vbox)
46 self.show()
47
48 def display_lines(self, lines):
49 for line in lines:
50 self.chat.display(*line[0], **line[1])