Files
FWS-PacManage/pages/logs-page.h
T
BlackAngelTV f0b37bbb44 feat(ui): show the application journal in the Logs screen
The Logs screen only offered /var/log/pacman.log, which is unreadable
without root and says nothing about what the app itself did. Let the user
switch between that file and the new application journal, refresh it live
while an operation runs, and record navigation and dialog events so the
screen tells the whole story.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-09-27 18:18:59 +02:00

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;
};