63 lines
2.3 KiB
Python
63 lines
2.3 KiB
Python
from PyQt6.QtCore import Qt
|
|
from PyQt6.QtGui import QFont, QPixmap
|
|
from PyQt6.QtWidgets import *
|
|
|
|
|
|
class AboutDialog(QDialog):
|
|
"""Dialog for showing info about RavenLog"""
|
|
|
|
def __init__(self, parent=None):
|
|
super(AboutDialog, self).__init__(parent)
|
|
self.setWindowTitle(self.tr("About RavenLog"))
|
|
self.setModal(True)
|
|
|
|
self.layout = QVBoxLayout(self)
|
|
|
|
heading_app_name = QLabel("RavenLog")
|
|
heading_app_name.setAlignment(Qt.AlignmentFlag.AlignLeft)
|
|
heading_app_name.setFont(QFont("default", 25))
|
|
heading_app_name.setTextInteractionFlags(Qt.TextInteractionFlag.TextSelectableByMouse)
|
|
app_icon = QLabel()
|
|
app_icon.setPixmap(QPixmap("icon7.png"))
|
|
heading = QWidget(self)
|
|
hbox = QHBoxLayout(heading)
|
|
hbox.addWidget(app_icon)
|
|
hbox.addWidget(heading_app_name)
|
|
hbox.addSpacerItem(QSpacerItem(1, 1, hPolicy=QSizePolicy.Policy.Expanding))
|
|
|
|
heading.layout = hbox
|
|
self.layout.addWidget(heading)
|
|
|
|
tabs = QTabWidget()
|
|
tabs.addTab(self._about(), self.tr("About"))
|
|
tabs.addTab(self._license(), self.tr("License"))
|
|
|
|
self.layout.addWidget(tabs)
|
|
|
|
def _about(self) -> QWidget:
|
|
result = QWidget()
|
|
result.layout = QVBoxLayout(result)
|
|
|
|
download_url_lbl = QLabel(result)
|
|
download_url_lbl.setMouseTracking(True)
|
|
download_url_lbl.setAlignment(Qt.AlignmentFlag.AlignLeft)
|
|
download_url_lbl.setTextInteractionFlags(Qt.TextInteractionFlag.LinksAccessibleByMouse)
|
|
download_url_lbl.setOpenExternalLinks(True)
|
|
download_url_lbl.setText('<a href=%s>%s</a>' %
|
|
('https://www.opentext.com/',
|
|
self.tr("License: GNU Lesser General Public License v3")))
|
|
result.layout.addWidget(QLabel(self.tr("Log file viewer")))
|
|
result.layout.addWidget(QLabel(self.tr("(c) 2021 Open Text Corporation")))
|
|
result.layout.addWidget(QLabel(self.tr("Log file viewer")))
|
|
result.layout.addWidget(download_url_lbl)
|
|
return result
|
|
|
|
def _license(self) -> QWidget:
|
|
result = QWidget()
|
|
result.layout = QVBoxLayout(result)
|
|
|
|
result.layout.addWidget(QLabel(self.tr("* Qt 6.2.0 (LGPLv3)")))
|
|
result.layout.addWidget(QLabel(self.tr("* watchdog 2.16 (Apache)")))
|
|
|
|
return result
|