feat: checkpoint QML view migration

This commit is contained in:
dela
2026-07-15 11:57:34 +08:00
parent 3002adb7bf
commit b117bbf99e
133 changed files with 23964 additions and 17074 deletions
+14 -38
View File
@@ -2,52 +2,28 @@
#define PAGELOGS_H
#include "managepagebase.h"
#include <models/admin/adminmodels.h>
#include <qcorotask.h>
#include <optional>
class ElidedLabel;
class QLabel;
class QListWidget;
class QPlainTextEdit;
class QPushButton;
class LogsViewModel;
class QHideEvent;
class QScrollArea;
class QShowEvent;
class QuickPageHost;
// Compatibility shell retained until ManageView itself moves to QML.
class PageLogs : public ManagePageBase {
Q_OBJECT
Q_OBJECT
public:
explicit PageLogs(QEmbyCore* core, QWidget* parent = nullptr);
explicit PageLogs(QEmbyCore *core, QWidget *parent = nullptr);
QScrollArea *scrollArea() const { return m_scrollArea; }
protected:
void showEvent(QShowEvent* event) override;
void showEvent(QShowEvent *event) override;
void hideEvent(QHideEvent *event) override;
private:
QCoro::Task<void> loadFileList(bool isManual = false);
QCoro::Task<void> loadLogContent(QString logName);
QCoro::Task<void> downloadLogFile(QString logName);
QString rebuildFileList(const QString& preferredLogName);
void updateSelectionDetails(const QString& logName);
void setViewerPlaceholder(const QString& text);
QString currentSelectedLogName() const;
QPushButton* m_btnRefresh = nullptr;
QLabel* m_statsLabel = nullptr;
QListWidget* m_fileList = nullptr;
QPlainTextEdit* m_logViewer = nullptr;
QLabel* m_emptyLabel = nullptr;
QLabel* m_viewerPlaceholder = nullptr;
ElidedLabel* m_currentFileNameLabel = nullptr;
QLabel* m_currentFileMetaLabel = nullptr;
QList<LogFileInfo> m_logFiles;
QString m_currentLogName;
bool m_loaded = false;
bool m_isLoading = false;
std::optional<QCoro::Task<void>> m_pendingTask;
std::optional<QCoro::Task<void>> m_pendingDownloadTask;
QuickPageHost *m_quickHost = nullptr;
LogsViewModel *m_viewModel = nullptr;
QScrollArea *m_scrollArea = nullptr;
};
#endif
#endif // PAGELOGS_H