]> jfr.im git - irc/weechat/qweechat.git/commitdiff
Update info displayed in about dialog
authorSébastien Helleu <redacted>
Sun, 14 Nov 2021 08:50:01 +0000 (09:50 +0100)
committerSébastien Helleu <redacted>
Sun, 14 Nov 2021 08:50:01 +0000 (09:50 +0100)
qweechat/about.py
qweechat/qweechat.py

index 5faa4c798ad6362bb0df915f8e29f788cf7e42fc..73872ea95433ac18205b094415e8d3f12a9a0d8e 100644 (file)
 
 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'<b>{app_name}</b> {qweechat_version()}',
+            f'© 2011-2021 {author}',
+            '',
+            f'<a href="{weechat_site}">{weechat_site}</a>',
+            '',
+        ]
         for msg in messages:
             label = QtGui.QLabel(msg)
             label.setAlignment(QtCore.Qt.AlignHCenter)
index f8de4ea7f4ab2344b155a3a0f62053a3bd89ebc8..1888d6d876633c77d83d492fdea05e7ca1a1d905 100644 (file)
@@ -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 = ['<b>%s</b> %s' % (NAME, qweechat_version()),
-                    '&copy; 2011-2020 %s &lt;<a href="mailto:%s">%s</a>&gt;'
-                    % (AUTHOR, AUTHOR_MAIL, AUTHOR_MAIL),
-                    '',
-                    'WeeChat site: <a href="%s">%s</a>'
-                    % (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."""