2020-09-16 00:35:12 +01:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2009-2010 Volker Lanz <vl@fidra.de>
|
|
|
|
SPDX-FileCopyrightText: 2014-2020 Andrius Štikonas <andrius@stikonas.eu>
|
|
|
|
SPDX-FileCopyrightText: 2019 Yuri Chornoivan <yurchor@ukr.net>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*/
|
2009-04-22 13:41:30 +01:00
|
|
|
|
2017-09-11 16:27:51 +01:00
|
|
|
#if !defined(TREELOG_H)
|
2009-04-22 13:41:30 +01:00
|
|
|
|
2017-09-11 16:27:51 +01:00
|
|
|
#define TREELOG_H
|
2009-04-22 13:41:30 +01:00
|
|
|
|
|
|
|
#include "ui_treelogbase.h"
|
|
|
|
|
2016-01-12 00:12:49 +00:00
|
|
|
#include <util/globallog.h>
|
2009-04-22 13:41:30 +01:00
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
class QTreeWidget;
|
|
|
|
|
2010-05-18 23:27:30 +01:00
|
|
|
/** A tree for formatted log output.
|
2015-07-13 15:17:41 +01:00
|
|
|
@author Volker Lanz <vl@fidra.de>
|
2009-04-22 13:41:30 +01:00
|
|
|
*/
|
2016-01-06 13:56:32 +00:00
|
|
|
class TreeLog: public QWidget, public Ui::TreeLogBase
|
2009-04-22 13:41:30 +01:00
|
|
|
{
|
2015-07-13 15:17:41 +01:00
|
|
|
Q_DISABLE_COPY(TreeLog)
|
|
|
|
|
|
|
|
public:
|
2019-12-09 16:33:04 +00:00
|
|
|
explicit TreeLog(QWidget* parent = nullptr);
|
2015-07-13 15:17:41 +01:00
|
|
|
~TreeLog();
|
|
|
|
|
|
|
|
public:
|
|
|
|
void init();
|
2016-05-18 22:23:59 +01:00
|
|
|
void onNewLogMessage(Log::Level logLevel, const QString& s);
|
2015-07-13 15:17:41 +01:00
|
|
|
|
|
|
|
void onClearLog();
|
|
|
|
void onSaveLog();
|
|
|
|
|
|
|
|
QTreeWidget& treeLog() {
|
|
|
|
Q_ASSERT(m_TreeLog);
|
|
|
|
return *m_TreeLog;
|
|
|
|
}
|
2016-07-02 12:12:56 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void onHeaderContextMenu(const QPoint& pos);
|
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
const QTreeWidget& treeLog() const {
|
|
|
|
Q_ASSERT(m_TreeLog);
|
|
|
|
return *m_TreeLog;
|
|
|
|
}
|
|
|
|
|
|
|
|
void loadConfig();
|
|
|
|
void saveConfig() const;
|
|
|
|
|
|
|
|
private:
|
2009-04-22 13:41:30 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|