Files
flares/src/window/about.py
T

51 lines
1.5 KiB
Python

"""
Filename: about.py
Description: About window
Note: Compliant with pylance strict type checking
Author: Tyler de Zeeuw
License: GPL-3.0
"""
# External library imports
from PySide6.QtWidgets import QWidget, QVBoxLayout, QLabel
from PySide6.QtCore import Qt
from src.shared.shareddata import APP_NAME, APP_NAME_EXPANDED, CURRENT_VERSION
from src.shared.inspiration import get_quote
class AboutWindow(QWidget):
"""
Simple About window displaying basic application information.
Args:
parent (QWidget, optional): Parent widget of this window. Defaults to None.
"""
def __init__(self, parent: QWidget | None = None) -> None:
super().__init__(parent, Qt.WindowType.Window)
self.setWindowTitle(f"About {APP_NAME.upper()}")
self.resize(250, 100)
layout = QVBoxLayout()
label = QLabel(f"About {APP_NAME.upper()}", self)
label2 = QLabel(f"{APP_NAME_EXPANDED}", self)
label3 = QLabel(
f'{APP_NAME.upper()} is licensed under the GPL-3.0 licence. '
'For more information, visit '
'<a href="https://www.gnu.org/licenses/gpl-3.0.en.html">'
'GNU GPL-3.0</a>',
self,
)
label3.setOpenExternalLinks(True)
label4 = QLabel(f"Version v{CURRENT_VERSION}")
label5 = QLabel(f"{get_quote()}", self)
layout.addWidget(label)
layout.addWidget(label2)
layout.addWidget(label3)
layout.addWidget(label4)
layout.addWidget(label5)
self.setLayout(layout)