mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Unscuffed settings log page
This commit is contained in:
parent
e2b54edb2d
commit
25979d4535
2 changed files with 22 additions and 6 deletions
|
@ -5,6 +5,7 @@
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
namespace widgets {
|
namespace widgets {
|
||||||
namespace settingspages {
|
namespace settingspages {
|
||||||
|
|
||||||
EmotesPage::EmotesPage()
|
EmotesPage::EmotesPage()
|
||||||
: SettingsPage("Emotes", ":/images/emote.svg")
|
: SettingsPage("Emotes", ":/images/emote.svg")
|
||||||
{
|
{
|
||||||
|
@ -22,6 +23,7 @@ EmotesPage::EmotesPage()
|
||||||
|
|
||||||
layout->addStretch(1);
|
layout->addStretch(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace settingspages
|
} // namespace settingspages
|
||||||
} // namespace widgets
|
} // namespace widgets
|
||||||
} // namespace chatterino
|
} // namespace chatterino
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "logspage.hpp"
|
#include "logspage.hpp"
|
||||||
|
#include "singletons/pathmanager.hpp"
|
||||||
|
|
||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
@ -9,6 +10,16 @@ namespace chatterino {
|
||||||
namespace widgets {
|
namespace widgets {
|
||||||
namespace settingspages {
|
namespace settingspages {
|
||||||
|
|
||||||
|
inline QString CreateLink(const QString &url, bool file = false)
|
||||||
|
{
|
||||||
|
if (file) {
|
||||||
|
return QString("<a href=\"file:///" + url + "\"><span style=\"color: white;\">" + url +
|
||||||
|
"</span></a>");
|
||||||
|
}
|
||||||
|
|
||||||
|
return QString("<a href=\"" + url + "\"><span style=\"color: white;\">" + url + "</span></a>");
|
||||||
|
}
|
||||||
|
|
||||||
LogsPage::LogsPage()
|
LogsPage::LogsPage()
|
||||||
: SettingsPage("Logs", "")
|
: SettingsPage("Logs", "")
|
||||||
{
|
{
|
||||||
|
@ -16,13 +27,16 @@ LogsPage::LogsPage()
|
||||||
util::LayoutCreator<LogsPage> layoutCreator(this);
|
util::LayoutCreator<LogsPage> layoutCreator(this);
|
||||||
auto layout = layoutCreator.emplace<QVBoxLayout>().withoutMargin();
|
auto layout = layoutCreator.emplace<QVBoxLayout>().withoutMargin();
|
||||||
|
|
||||||
{
|
singletons::PathManager &pathManager = singletons::PathManager::getInstance();
|
||||||
auto form = layout.emplace<QFormLayout>();
|
auto logPath = pathManager.logsFolderPath;
|
||||||
|
|
||||||
// clang-format off
|
auto created = layout.emplace<QLabel>();
|
||||||
form->addRow("Enabled:", this->createCheckBox("Enable logging", settings.enableLogging));
|
created->setText("Logs are saved to " + CreateLink(logPath, true));
|
||||||
// clang-format on
|
created->setTextFormat(Qt::RichText);
|
||||||
}
|
created->setTextInteractionFlags(Qt::TextBrowserInteraction | Qt::LinksAccessibleByKeyboard |
|
||||||
|
Qt::LinksAccessibleByKeyboard);
|
||||||
|
created->setOpenExternalLinks(true);
|
||||||
|
layout.append(this->createCheckBox("Enable logging", settings.enableLogging));
|
||||||
|
|
||||||
layout->addStretch(1);
|
layout->addStretch(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue