Add a link to the log folder from the log window
This commit is contained in:
parent
cead69f8e3
commit
c5cfd3ebdc
@ -1,6 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import pathlib
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets, uic
|
||||
|
||||
@ -23,9 +24,11 @@ class QTextEditLogger(QtCore.QObject, logging.Handler):
|
||||
|
||||
|
||||
class ApplicationLogWindow(QtWidgets.QDialog):
|
||||
def __init__(self, log_handler: QTextEditLogger, parent: QtCore.QObject | None = None) -> None:
|
||||
def __init__(
|
||||
self, log_folder: pathlib.Path, log_handler: QTextEditLogger, parent: QtCore.QObject | None = None
|
||||
) -> None:
|
||||
super().__init__(parent)
|
||||
with (ui_path / "logwindow.ui").open(encoding="utf-8") as uifile:
|
||||
with (ui_path / "applicationlogwindow.ui").open(encoding="utf-8") as uifile:
|
||||
uic.loadUi(uifile, self)
|
||||
|
||||
self.log_handler = log_handler
|
||||
@ -37,6 +40,9 @@ class ApplicationLogWindow(QtWidgets.QDialog):
|
||||
self._button = QtWidgets.QPushButton(self)
|
||||
self._button.setText("Test Me")
|
||||
|
||||
self.log_folder = log_folder
|
||||
self.lblLogLocation.setText(f'Log Location: <a href="file://{log_folder}">{log_folder}</a>')
|
||||
|
||||
layout = self.layout()
|
||||
layout.addWidget(self._button)
|
||||
|
||||
|
@ -14,6 +14,16 @@
|
||||
<string>Log Window</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblLogLocation">
|
||||
<property name="text">
|
||||
<string>Log Location:</string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="textEdit">
|
||||
<property name="readOnly">
|
||||
|
Loading…
Reference in New Issue
Block a user