all repos — mgba @ a816bd960b4cb4fcdf0a8811bccd036ae59a6b88

mGBA Game Boy Advance Emulator

src/platform/qt/LogView.h (view raw)

 1/* Copyright (c) 2013-2015 Jeffrey Pfau
 2 *
 3 * This Source Code Form is subject to the terms of the Mozilla Public
 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 6#ifndef QGBA_LOG_VIEW
 7#define QGBA_LOG_VIEW
 8
 9#include <QWidget>
10
11#include "ui_LogView.h"
12
13extern "C" {
14#include "gba/supervisor/thread.h"
15}
16
17namespace QGBA {
18
19class LogView : public QWidget {
20Q_OBJECT
21
22public:
23	LogView(QWidget* parent = nullptr);
24
25signals:
26	void levelsSet(int levels);
27	void levelsEnabled(int levels);
28	void levelsDisabled(int levels);
29
30public slots:
31	void postLog(int level, const QString& log);
32	void setLevels(int levels);
33	void clear();
34
35	void setLevelDebug(bool);
36	void setLevelStub(bool);
37	void setLevelInfo(bool);
38	void setLevelWarn(bool);
39	void setLevelError(bool);
40	void setLevelFatal(bool);
41	void setLevelGameError(bool);
42	void setLevelSWI(bool);
43	void setLevelStatus(bool);
44	void setLevelSIO(bool);
45
46	void setMaxLines(int);
47
48private:
49	static const int DEFAULT_LINE_LIMIT = 1000;
50
51	Ui::LogView m_ui;
52	int m_logLevel;
53	int m_lines;
54	int m_lineLimit;
55
56	static QString toString(int level);
57	void setLevel(int level);
58	void clearLevel(int level);
59
60	void clearLine();
61};
62
63}
64
65#endif