You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.5 KiB
Python

13 years ago
# -*- coding: utf-8 -*-
#
# debug.py - debug window
#
# Copyright (C) 2011-2022 Sébastien Helleu <flashcode@flashtux.org>
13 years ago
#
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
#
# QWeeChat is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# QWeeChat is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with QWeeChat. If not, see <http://www.gnu.org/licenses/>.
#
"""Debug window."""
2 years ago
from PyQt5 import QtWidgets
from qweechat.chat import ChatTextEdit
from qweechat.input import InputLineEdit
13 years ago
class DebugDialog(QtWidgets.QDialog):
13 years ago
"""Debug dialog."""
def __init__(self, *args):
QtWidgets.QDialog.__init__(*(self,) + args)
self.resize(1024, 768)
13 years ago
self.setWindowTitle('Debug console')
self.chat = ChatTextEdit(debug=True)
13 years ago
self.input = InputLineEdit(self.chat)
vbox = QtWidgets.QVBoxLayout()
13 years ago
vbox.addWidget(self.chat)
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])