2015-02-07 00:32:25 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* Copyright (C) 2008, 2009 by Volker Lanz <vl@fidra.de> *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or *
|
|
|
|
* modify it under the terms of the GNU General Public License as *
|
|
|
|
* published by the Free Software Foundation; either version 3 of *
|
|
|
|
* the License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.*
|
|
|
|
*************************************************************************/
|
2009-04-22 13:41:30 +01:00
|
|
|
|
|
|
|
#if !defined(TREELOG__H)
|
|
|
|
|
|
|
|
#define TREELOG__H
|
|
|
|
|
|
|
|
#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:
|
2016-04-14 19:18:36 +01:00
|
|
|
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
|