#pragma once #include #include "page.h" class QComboBox; class QLineEdit; class QTextEdit; // Journal viewer. Two sources share the screen: the application's own journal — // every operation and event, including the raw output of the commands that ran, // so it reads like a hand-run terminal session — and the raw /var/log/pacman.log. // Both are filtered in memory so typing stays instant even with a multi-megabyte // file (the core/journal reads it, the page keeps a copy). class LogsPage : public Page { Q_OBJECT public: explicit LogsPage(AppCore* core, QWidget* parent = nullptr); QString navTitle() const override { return QStringLiteral("Logs"); } QString navSubtitle() const override { return QStringLiteral("Journal de l'application et journal pacman"); } void refresh() override; private: void load(); void applyFilter(); // True when the selector points at the application's own journal. bool viewingAppLog() const; QComboBox* m_source = nullptr; QLineEdit* m_filter = nullptr; QTextEdit* m_text = nullptr; QString m_raw; };