]> jfr.im git - irc/weechat/qweechat.git/blob - qweechat/about.py
Ignore bandit security error about possible hardcoded password
[irc/weechat/qweechat.git] / qweechat / about.py
1 # -*- coding: utf-8 -*-
2 #
3 # about.py - about dialog box
4 #
5 # Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org>
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
23 """About dialog box."""
24
25 from PySide6 import QtCore, QtWidgets as QtGui
26
27 from qweechat.version import qweechat_version
28
29
30 class AboutDialog(QtGui.QDialog):
31 """About dialog."""
32
33 def __init__(self, app_name, author, weechat_site, *args):
34 QtGui.QDialog.__init__(*(self,) + args)
35 self.setModal(True)
36 self.setWindowTitle('About')
37
38 close_button = QtGui.QPushButton('Close')
39 close_button.pressed.connect(self.close)
40
41 hbox = QtGui.QHBoxLayout()
42 hbox.addStretch(1)
43 hbox.addWidget(close_button)
44 hbox.addStretch(1)
45
46 vbox = QtGui.QVBoxLayout()
47 messages = [
48 f'<b>{app_name}</b> {qweechat_version()}',
49 f'© 2011-2021 {author}',
50 '',
51 f'<a href="{weechat_site}">{weechat_site}</a>',
52 '',
53 ]
54 for msg in messages:
55 label = QtGui.QLabel(msg)
56 label.setAlignment(QtCore.Qt.AlignHCenter)
57 vbox.addWidget(label)
58 vbox.addLayout(hbox)
59
60 self.setLayout(vbox)
61 self.show()