2021-11-18 14:58:01 +00:00
|
|
|
#ifndef DUST3D_APPLICATION_LOG_BROWSER_H_
|
|
|
|
#define DUST3D_APPLICATION_LOG_BROWSER_H_
|
|
|
|
|
2018-04-07 08:44:39 +00:00
|
|
|
#include <QObject>
|
2020-04-07 23:15:20 +00:00
|
|
|
#include <cstdio>
|
2018-04-07 08:44:39 +00:00
|
|
|
|
|
|
|
class LogBrowserDialog;
|
|
|
|
|
2022-10-18 09:35:04 +00:00
|
|
|
class LogBrowser : public QObject {
|
2018-04-07 08:44:39 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2022-10-18 09:35:04 +00:00
|
|
|
explicit LogBrowser(QObject* parent = 0);
|
2018-04-07 08:44:39 +00:00
|
|
|
~LogBrowser();
|
|
|
|
|
|
|
|
public slots:
|
2022-10-18 09:35:04 +00:00
|
|
|
void outputMessage(QtMsgType type, const QString& msg, const QString& source, int line);
|
2018-04-10 07:59:20 +00:00
|
|
|
void showDialog();
|
|
|
|
void hideDialog();
|
|
|
|
bool isDialogVisible();
|
2018-04-07 08:44:39 +00:00
|
|
|
|
|
|
|
signals:
|
2022-10-18 09:35:04 +00:00
|
|
|
void sendMessage(QtMsgType type, const QString& msg, const QString& source, int line);
|
2018-04-07 08:44:39 +00:00
|
|
|
|
|
|
|
private:
|
2022-10-18 09:35:04 +00:00
|
|
|
LogBrowserDialog* m_browserDialog = nullptr;
|
|
|
|
FILE* m_outputTo = nullptr;
|
2020-04-07 23:15:20 +00:00
|
|
|
static bool m_enableOutputToFile;
|
2018-04-07 08:44:39 +00:00
|
|
|
};
|
|
|
|
|
2021-11-18 14:58:01 +00:00
|
|
|
#endif
|