2017-06-25 11:40:01 -06:00
|
|
|
// Copyright 2017 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QDockWidget>
|
|
|
|
|
|
|
|
#include <mutex>
|
|
|
|
#include <queue>
|
|
|
|
|
|
|
|
#include "Common/Logging/LogManager.h"
|
|
|
|
|
|
|
|
class QCheckBox;
|
2017-09-20 05:18:36 -06:00
|
|
|
class QCloseEvent;
|
2017-06-25 11:40:01 -06:00
|
|
|
class QComboBox;
|
2019-08-30 15:55:40 -06:00
|
|
|
class QPlainTextEdit;
|
2017-06-25 11:40:01 -06:00
|
|
|
class QPushButton;
|
|
|
|
class QTimer;
|
|
|
|
|
2017-08-27 16:10:06 -06:00
|
|
|
class LogWidget final : public QDockWidget, LogListener
|
2017-06-25 11:40:01 -06:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2017-08-27 16:10:06 -06:00
|
|
|
explicit LogWidget(QWidget* parent = nullptr);
|
|
|
|
~LogWidget();
|
2017-06-25 11:40:01 -06:00
|
|
|
|
2017-09-20 05:18:36 -06:00
|
|
|
protected:
|
|
|
|
void closeEvent(QCloseEvent*) override;
|
|
|
|
|
2017-06-25 11:40:01 -06:00
|
|
|
private:
|
|
|
|
void UpdateLog();
|
|
|
|
void UpdateFont();
|
|
|
|
void CreateWidgets();
|
|
|
|
void ConnectWidgets();
|
|
|
|
void LoadSettings();
|
|
|
|
void SaveSettings();
|
|
|
|
|
|
|
|
void Log(LogTypes::LOG_LEVELS level, const char* text) override;
|
|
|
|
|
|
|
|
// Log
|
|
|
|
QCheckBox* m_log_wrap;
|
|
|
|
QComboBox* m_log_font;
|
|
|
|
QPushButton* m_log_clear;
|
2019-08-30 15:55:40 -06:00
|
|
|
QPlainTextEdit* m_log_text;
|
2017-06-25 11:40:01 -06:00
|
|
|
|
|
|
|
QTimer* m_timer;
|
|
|
|
|
|
|
|
std::mutex m_log_mutex;
|
|
|
|
std::queue<QString> m_log_queue;
|
|
|
|
};
|