From beddac26e189cf3f4e270bd55617138f6e5ae9b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 14 Nov 2021 09:50:01 +0100 Subject: [PATCH] Update info displayed in about dialog --- qweechat/about.py | 13 +++++++++++-- qweechat/qweechat.py | 15 +++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/qweechat/about.py b/qweechat/about.py index 5faa4c7..73872ea 100644 --- a/qweechat/about.py +++ b/qweechat/about.py @@ -24,14 +24,16 @@ from PySide6 import QtCore, QtWidgets as QtGui +from qweechat.version import qweechat_version + class AboutDialog(QtGui.QDialog): """About dialog.""" - def __init__(self, name, messages, *args): + def __init__(self, app_name, author, weechat_site, *args): QtGui.QDialog.__init__(*(self,) + args) self.setModal(True) - self.setWindowTitle(name) + self.setWindowTitle(app_name) close_button = QtGui.QPushButton('Close') close_button.pressed.connect(self.close) @@ -42,6 +44,13 @@ class AboutDialog(QtGui.QDialog): hbox.addStretch(1) vbox = QtGui.QVBoxLayout() + messages = [ + f'{app_name} {qweechat_version()}', + f'© 2011-2021 {author}', + '', + f'{weechat_site}', + '', + ] for msg in messages: label = QtGui.QLabel(msg) label.setAlignment(QtCore.Qt.AlignHCenter) diff --git a/qweechat/qweechat.py b/qweechat/qweechat.py index f8de4ea..1888d6d 100644 --- a/qweechat/qweechat.py +++ b/qweechat/qweechat.py @@ -46,12 +46,10 @@ from qweechat.connection import ConnectionDialog from qweechat.buffer import BufferListWidget, Buffer from qweechat.debug import DebugDialog from qweechat.about import AboutDialog -from qweechat.version import qweechat_version -NAME = 'QWeeChat' +APP_NAME = 'QWeeChat' AUTHOR = 'Sébastien Helleu' -AUTHOR_MAIL = 'flashcode@flashtux.org' WEECHAT_SITE = 'https://weechat.org/' # number of lines in buffer for debug window @@ -67,7 +65,7 @@ class MainWindow(QtWidgets.QMainWindow): self.config = config.read() self.resize(1000, 600) - self.setWindowTitle(NAME) + self.setWindowTitle(APP_NAME) self.debug_dialog = None self.debug_lines = [] @@ -245,14 +243,7 @@ class MainWindow(QtWidgets.QMainWindow): def open_about_dialog(self): """Open a dialog with info about QWeeChat.""" - messages = ['%s %s' % (NAME, qweechat_version()), - '© 2011-2020 %s <%s>' - % (AUTHOR, AUTHOR_MAIL, AUTHOR_MAIL), - '', - 'WeeChat site: %s' - % (WEECHAT_SITE, WEECHAT_SITE), - ''] - self.about_dialog = AboutDialog(NAME, messages, self) + self.about_dialog = AboutDialog(APP_NAME, AUTHOR, WEECHAT_SITE, self) def open_connection_dialog(self): """Open a dialog with connection settings."""