dolphin/Source/Core/DolphinQt/Config/LogWidget.h

55 lines
1.0 KiB
C
Raw Normal View History

// Copyright 2017 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <QDockWidget>
#include <mutex>
#include <queue>
#include <string>
#include "Common/Logging/LogManager.h"
class QCheckBox;
class QCloseEvent;
class QComboBox;
class QPlainTextEdit;
class QPushButton;
class QTimer;
class LogWidget final : public QDockWidget, LogListener
{
Q_OBJECT
public:
explicit LogWidget(QWidget* parent = nullptr);
~LogWidget();
protected:
void closeEvent(QCloseEvent*) override;
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;
QPlainTextEdit* m_log_text;
QTimer* m_timer;
using LogEntry = std::pair<std::string, LogTypes::LOG_LEVELS>;
std::mutex m_log_mutex;
std::queue<LogEntry> m_log_queue;
};