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