]> jfr.im git - irc/weechat/qweechat.git/blame - src/qweechat/debug.py
Add icon "document-save.png" for entry "Save connection" in File menu
[irc/weechat/qweechat.git] / src / qweechat / debug.py
CommitLineData
7dcf23b1
SH
1#!/usr/bin/python
2# -*- coding: utf-8 -*-
3#
e836cfb0
SH
4# debug.py - debug window
5#
e17d5dc0 6# Copyright (C) 2011-2013 Sebastien Helleu <flashcode@flashtux.org>
7dcf23b1
SH
7#
8# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
9#
10# QWeeChat is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation; either version 3 of the License, or
13# (at your option) any later version.
14#
15# QWeeChat is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
21# along with QWeeChat. If not, see <http://www.gnu.org/licenses/>.
22#
23
7dcf23b1
SH
24import qt_compat
25QtGui = qt_compat.import_module('QtGui')
26from chat import ChatTextEdit
27from input import InputLineEdit
28
29
30class DebugDialog(QtGui.QDialog):
31 """Debug dialog."""
32
33 def __init__(self, *args):
67ae3204 34 QtGui.QDialog.__init__(*(self,) + args)
7dcf23b1
SH
35 self.resize(640, 480)
36 self.setWindowTitle('Debug console')
37
3a5ec0c1 38 self.chat = ChatTextEdit(debug=True)
7dcf23b1
SH
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)
cc80cd81
SH
46 self.show()
47
48 def display_lines(self, lines):
49 for line in lines:
50 self.chat.display(*line[0], **line[1])