pages/ was a flat row of eight screens, so a change to one meant scanning the whole folder to see what else was in it. The screens now sit in packages/ (browse, cleanup), overview/ (dashboard, history), system/ (logs, settings) and extensions/ (plugins), with the scaffolding they all build on — the Page base and the shared widgets — in base/.
39 lines
1.1 KiB
C++
39 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <QString>
|
|
|
|
#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;
|
|
};
|