fix: add explanation for the logging feature under moderation (#6514)

This commit is contained in:
Niko
2025-10-05 09:39:57 -03:00
committed by GitHub
parent 5e3aefb836
commit 2c44a2efd2
2 changed files with 11 additions and 3 deletions
+10 -3
View File
@@ -83,9 +83,15 @@ ModerationPage::ModerationPage()
auto logsPathLabel = logs.emplace<QLabel>();
QString logExplanation =
"<span style=\"color:#bbb\"> They are saved as plain "
"text files per channel, containing the messages with "
"timestamps.</span>";
// Logs (copied from LoggingMananger)
getSettings()->logPath.connect(
[logsPathLabel](const QString &logPath, auto) mutable {
[logsPathLabel, logExplanation](const QString &logPath,
auto) mutable {
QString pathOriginal =
logPath.isEmpty() ? getApp()->getPaths().messageLogDirectory
: logPath;
@@ -93,10 +99,11 @@ ModerationPage::ModerationPage()
QString pathShortened =
"Logs are saved at <a href=\"file:///" + pathOriginal +
R"("><span style="color: white;">)" +
shortenString(pathOriginal, 50) + "</span></a>";
shortenString(pathOriginal, 50) + ".</span></a>";
logsPathLabel->setText(pathShortened);
logsPathLabel->setText(pathShortened + logExplanation);
logsPathLabel->setToolTip(pathOriginal);
logsPathLabel->setWordWrap(true);
});
logsPathLabel->setTextFormat(Qt::RichText);