]>
Commit | Line | Data |
---|---|---|
7dcf23b1 SH |
1 | # -*- coding: utf-8 -*- |
2 | # | |
e836cfb0 SH |
3 | # debug.py - debug window |
4 | # | |
8335009d | 5 | # Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org> |
7dcf23b1 SH |
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 | ||
1fe88536 SH |
23 | """Debug window.""" |
24 | ||
f3da694d SH |
25 | from PySide6 import QtWidgets |
26 | ||
0ee7d2e9 AR |
27 | from qweechat.chat import ChatTextEdit |
28 | from qweechat.input import InputLineEdit | |
7dcf23b1 SH |
29 | |
30 | ||
8e15c19f | 31 | class DebugDialog(QtWidgets.QDialog): |
7dcf23b1 SH |
32 | """Debug dialog.""" |
33 | ||
34 | def __init__(self, *args): | |
8e15c19f | 35 | QtWidgets.QDialog.__init__(*(self,) + args) |
d69429b9 | 36 | self.resize(1024, 768) |
7dcf23b1 SH |
37 | self.setWindowTitle('Debug console') |
38 | ||
3a5ec0c1 | 39 | self.chat = ChatTextEdit(debug=True) |
7dcf23b1 SH |
40 | self.input = InputLineEdit(self.chat) |
41 | ||
8e15c19f | 42 | vbox = QtWidgets.QVBoxLayout() |
7dcf23b1 SH |
43 | vbox.addWidget(self.chat) |
44 | vbox.addWidget(self.input) | |
45 | ||
46 | self.setLayout(vbox) | |
cc80cd81 SH |
47 | self.show() |
48 | ||
49 | def display_lines(self, lines): | |
50 | for line in lines: | |
51 | self.chat.display(*line[0], **line[1]) |