all repos — mgba @ e9a2b2a57c4f478fb3600fe9d87e1b97804d73de

mGBA Game Boy Advance Emulator

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

 1/* Copyright (c) 2013-2014 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-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
44	void setMaxLines(int);
45
46private:
47	static const int DEFAULT_LINE_LIMIT = 1000;
48
49	Ui::LogView m_ui;
50	int m_logLevel;
51	int m_lines;
52	int m_lineLimit;
53
54	static QString toString(int level);
55	void setLevel(int level);
56	void clearLevel(int level);
57
58	void clearLine();
59};
60
61}
62
63#endif