2011-12-06 20:27:09 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
2013-02-04 09:29:51 +00:00
|
|
|
# debug.py - debug window
|
|
|
|
#
|
2021-01-15 19:42:06 +00:00
|
|
|
# Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org>
|
2011-12-06 20:27:09 +00:00
|
|
|
#
|
|
|
|
# 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/>.
|
|
|
|
#
|
|
|
|
|
2021-11-13 15:49:32 +00:00
|
|
|
from PySide6 import QtWidgets
|
|
|
|
|
2021-06-01 04:16:22 +00:00
|
|
|
from qweechat.chat import ChatTextEdit
|
|
|
|
from qweechat.input import InputLineEdit
|
2011-12-06 20:27:09 +00:00
|
|
|
|
|
|
|
|
2021-06-05 17:09:48 +00:00
|
|
|
class DebugDialog(QtWidgets.QDialog):
|
2011-12-06 20:27:09 +00:00
|
|
|
"""Debug dialog."""
|
|
|
|
|
|
|
|
def __init__(self, *args):
|
2021-06-05 17:09:48 +00:00
|
|
|
QtWidgets.QDialog.__init__(*(self,) + args)
|
2011-12-06 20:27:09 +00:00
|
|
|
self.resize(640, 480)
|
|
|
|
self.setWindowTitle('Debug console')
|
|
|
|
|
2011-12-23 19:18:57 +00:00
|
|
|
self.chat = ChatTextEdit(debug=True)
|
2011-12-06 20:27:09 +00:00
|
|
|
self.input = InputLineEdit(self.chat)
|
|
|
|
|
2021-06-05 17:09:48 +00:00
|
|
|
vbox = QtWidgets.QVBoxLayout()
|
2011-12-06 20:27:09 +00:00
|
|
|
vbox.addWidget(self.chat)
|
|
|
|
vbox.addWidget(self.input)
|
|
|
|
|
|
|
|
self.setLayout(vbox)
|
2011-12-10 09:11:36 +00:00
|
|
|
self.show()
|
|
|
|
|
|
|
|
def display_lines(self, lines):
|
|
|
|
for line in lines:
|
|
|
|
self.chat.display(*line[0], **line[1])
|