diff --git a/aboutdialog.py b/aboutdialog.py index f820445..781a741 100644 --- a/aboutdialog.py +++ b/aboutdialog.py @@ -1,7 +1,11 @@ +import textwrap + from PyQt6.QtCore import Qt from PyQt6.QtGui import QFont, QPixmap from PyQt6.QtWidgets import * +from label import Label + class AboutDialog(QDialog): """Dialog for showing info about RavenLog""" @@ -37,26 +41,19 @@ class AboutDialog(QDialog): 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('%s' % - ('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) + label = Label(self.tr(textwrap.dedent(""" + Log file viewer
+ (c) 2021 Open Text Corporation
+ License: to be decided"""))) + result.layout.addWidget(label) 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)"))) - + result.layout.addWidget(Label(self.tr(textwrap.dedent(""" + """)))) return result diff --git a/label.py b/label.py new file mode 100644 index 0000000..7cd7722 --- /dev/null +++ b/label.py @@ -0,0 +1,10 @@ +from PyQt6.QtWidgets import QLabel +from PyQt6.QtCore import Qt + + +class Label(QLabel): + def __init__(self, text: str): + super(Label, self).__init__(text) + self.setTextInteractionFlags(Qt.TextInteractionFlag.TextBrowserInteraction) + self.setTextInteractionFlags(Qt.TextInteractionFlag.LinksAccessibleByMouse) + self.setOpenExternalLinks(True) diff --git a/requirements.txt b/requirements.txt index 0441a57..d7bad32 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -PyQt6==6.2.0 -PyQt6-Qt6==6.2.0 +PyQt6==6.2.1 +PyQt6-Qt6==6.2.1 PyQt6-sip==13.1.0 six==1.16.0 urllib3==1.26.7