From 8f5ecf399dbe0c8bdf4f140cb5fbc0b583ade3d1 Mon Sep 17 00:00:00 2001 From: ephy Date: Sun, 25 Apr 2010 18:01:13 +0000 Subject: [PATCH] GCS/consolegadget: Addition of primitive console gadget that displays log messages. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@546 ebee16cc-31ac-478f-84a7-5cbb03baadba --- .../consolegadget/ConsoleGadget.pluginspec | 10 ++ .../plugins/consolegadget/consolegadget.cpp | 51 +++++++ .../src/plugins/consolegadget/consolegadget.h | 59 ++++++++ .../plugins/consolegadget/consolegadget.pro | 15 ++ .../consolegadget/consolegadgetfactory.cpp | 47 ++++++ .../consolegadget/consolegadgetfactory.h | 50 +++++++ .../consolegadget/consolegadgetwidget.cpp | 44 ++++++ .../consolegadget/consolegadgetwidget.h | 44 ++++++ .../plugins/consolegadget/consoleplugin.cpp | 65 +++++++++ .../src/plugins/consolegadget/consoleplugin.h | 47 ++++++ .../consolegadget/texteditloggerengine.cpp | 137 ++++++++++++++++++ .../consolegadget/texteditloggerengine.h | 57 ++++++++ 12 files changed, 626 insertions(+) create mode 100644 ground/src/plugins/consolegadget/ConsoleGadget.pluginspec create mode 100644 ground/src/plugins/consolegadget/consolegadget.cpp create mode 100644 ground/src/plugins/consolegadget/consolegadget.h create mode 100644 ground/src/plugins/consolegadget/consolegadget.pro create mode 100644 ground/src/plugins/consolegadget/consolegadgetfactory.cpp create mode 100644 ground/src/plugins/consolegadget/consolegadgetfactory.h create mode 100644 ground/src/plugins/consolegadget/consolegadgetwidget.cpp create mode 100644 ground/src/plugins/consolegadget/consolegadgetwidget.h create mode 100644 ground/src/plugins/consolegadget/consoleplugin.cpp create mode 100644 ground/src/plugins/consolegadget/consoleplugin.h create mode 100644 ground/src/plugins/consolegadget/texteditloggerengine.cpp create mode 100644 ground/src/plugins/consolegadget/texteditloggerengine.h diff --git a/ground/src/plugins/consolegadget/ConsoleGadget.pluginspec b/ground/src/plugins/consolegadget/ConsoleGadget.pluginspec new file mode 100644 index 000000000..212c647bc --- /dev/null +++ b/ground/src/plugins/consolegadget/ConsoleGadget.pluginspec @@ -0,0 +1,10 @@ + + The OpenPilot Project + (C) 2010 OpenPilot Project + The GNU Public License (GPL) Version 3 + Console gadget + http://www.openpilot.org + + + + diff --git a/ground/src/plugins/consolegadget/consolegadget.cpp b/ground/src/plugins/consolegadget/consolegadget.cpp new file mode 100644 index 000000000..84c1a2c61 --- /dev/null +++ b/ground/src/plugins/consolegadget/consolegadget.cpp @@ -0,0 +1,51 @@ +/** + ****************************************************************************** + * + * @file consolegadget.cpp + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. + * @brief + * @see The GNU Public License (GPL) Version 3 + * @defgroup consolegadget + * @{ + * + *****************************************************************************/ +/* + * 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, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include "consolegadget.h" +#include "consolegadgetwidget.h" +#include "texteditloggerengine.h" + +ConsoleGadget::ConsoleGadget(QString classId, ConsoleGadgetWidget *widget, QWidget *parent) : + IUAVGadget(classId, parent), + m_widget(widget) +{ + m_logger = new TextEditLoggerEngine(widget); + bool suitableName = false; + int i = 0; + QString loggerName; + while (!suitableName) { + loggerName = "TextEditLogger" + QVariant(i).toString(); + if (!qxtLog->isLoggerEngine(loggerName)) + suitableName = true; + ++i; + } + qxtLog->addLoggerEngine(loggerName, m_logger); +} + +ConsoleGadget::~ConsoleGadget() +{ + qxtLog->removeLoggerEngine(m_logger); +} diff --git a/ground/src/plugins/consolegadget/consolegadget.h b/ground/src/plugins/consolegadget/consolegadget.h new file mode 100644 index 000000000..870ae629e --- /dev/null +++ b/ground/src/plugins/consolegadget/consolegadget.h @@ -0,0 +1,59 @@ +/** + ****************************************************************************** + * + * @file consolegadget.h + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. + * @brief + * @see The GNU Public License (GPL) Version 3 + * @defgroup consolegadget + * @{ + * + *****************************************************************************/ +/* + * 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, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef CONSOLEGADGET_H_ +#define CONSOLEGADGET_H_ + +#include + +namespace Core { +class IUAVGadget; +} +class ConsoleGadgetWidget; +class TextEditLoggerEngine; + +using namespace Core; + +class ConsoleGadget : public Core::IUAVGadget +{ + Q_OBJECT +public: + ConsoleGadget(QString classId, ConsoleGadgetWidget *widget, QWidget *parent = 0); + ~ConsoleGadget(); + + QList context() const { return m_context; } + QWidget *widget() { return m_widget; } + QString contextHelpId() const { return QString(); } + +private: + QWidget *m_widget; + QList m_context; + TextEditLoggerEngine *m_logger; +}; + + +#endif // CONSOLEGADGET_H_ diff --git a/ground/src/plugins/consolegadget/consolegadget.pro b/ground/src/plugins/consolegadget/consolegadget.pro new file mode 100644 index 000000000..7b29b765c --- /dev/null +++ b/ground/src/plugins/consolegadget/consolegadget.pro @@ -0,0 +1,15 @@ +TEMPLATE = lib +TARGET = ConsoleGadget +include(../../openpilotgcsplugin.pri) +include(../../plugins/coreplugin/coreplugin.pri) +HEADERS += consoleplugin.h \ + texteditloggerengine.h +HEADERS += consolegadget.h +HEADERS += consolegadgetwidget.h +HEADERS += consolegadgetfactory.h +SOURCES += consoleplugin.cpp \ + texteditloggerengine.cpp +SOURCES += consolegadget.cpp +SOURCES += consolegadgetfactory.cpp +SOURCES += consolegadgetwidget.cpp +OTHER_FILES += ConsoleGadget.pluginspec diff --git a/ground/src/plugins/consolegadget/consolegadgetfactory.cpp b/ground/src/plugins/consolegadget/consolegadgetfactory.cpp new file mode 100644 index 000000000..0c22cd32e --- /dev/null +++ b/ground/src/plugins/consolegadget/consolegadgetfactory.cpp @@ -0,0 +1,47 @@ +/** + ****************************************************************************** + * + * @file consolegadgetfactory.cpp + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. + * @brief + * @see The GNU Public License (GPL) Version 3 + * @defgroup consolegadget + * @{ + * + *****************************************************************************/ +/* + * 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, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include "consolegadgetfactory.h" +#include "consolegadgetwidget.h" +#include "consolegadget.h" +#include + +ConsoleGadgetFactory::ConsoleGadgetFactory(QObject *parent) : + IUAVGadgetFactory(QString("ConsoleGadget"), + tr("Console"), + parent) +{ +} + +ConsoleGadgetFactory::~ConsoleGadgetFactory() +{ + +} + +IUAVGadget* ConsoleGadgetFactory::createGadget(QWidget *parent) { + ConsoleGadgetWidget* gadgetWidget = new ConsoleGadgetWidget(parent); + return new ConsoleGadget(QString("ConsoleGadget"), gadgetWidget, parent); +} diff --git a/ground/src/plugins/consolegadget/consolegadgetfactory.h b/ground/src/plugins/consolegadget/consolegadgetfactory.h new file mode 100644 index 000000000..f61463ee0 --- /dev/null +++ b/ground/src/plugins/consolegadget/consolegadgetfactory.h @@ -0,0 +1,50 @@ +/** + ****************************************************************************** + * + * @file consolegadgetfactory.h + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. + * @brief + * @see The GNU Public License (GPL) Version 3 + * @defgroup consolegadget + * @{ + * + *****************************************************************************/ +/* + * 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, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef CONSOLEGADGETFACTORY_H_ +#define CONSOLEGADGETFACTORY_H_ + +#include + +namespace Core { +class IUAVGadget; +class IUAVGadgetFactory; +} + +using namespace Core; + +class ConsoleGadgetFactory : public IUAVGadgetFactory +{ + Q_OBJECT +public: + ConsoleGadgetFactory(QObject *parent = 0); + ~ConsoleGadgetFactory(); + + IUAVGadget *createGadget(QWidget *parent); +}; + +#endif // CONSOLEGADGETFACTORY_H_ diff --git a/ground/src/plugins/consolegadget/consolegadgetwidget.cpp b/ground/src/plugins/consolegadget/consolegadgetwidget.cpp new file mode 100644 index 000000000..5d0b7c958 --- /dev/null +++ b/ground/src/plugins/consolegadget/consolegadgetwidget.cpp @@ -0,0 +1,44 @@ +/** + ****************************************************************************** + * + * @file consolegadgetwidget.cpp + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. + * @brief + * @see The GNU Public License (GPL) Version 3 + * @defgroup consolegadget + * @{ + * + *****************************************************************************/ +/* + * 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, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include "consolegadgetwidget.h" +#include "qxtlogger.h" + +#include +#include + +ConsoleGadgetWidget::ConsoleGadgetWidget(QWidget *parent) : QTextEdit(parent) +{ + setMinimumSize(64,64); + setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + setReadOnly(true); +} + +ConsoleGadgetWidget::~ConsoleGadgetWidget() +{ + // Do nothing +} + diff --git a/ground/src/plugins/consolegadget/consolegadgetwidget.h b/ground/src/plugins/consolegadget/consolegadgetwidget.h new file mode 100644 index 000000000..252e640e8 --- /dev/null +++ b/ground/src/plugins/consolegadget/consolegadgetwidget.h @@ -0,0 +1,44 @@ +/** + ****************************************************************************** + * + * @file consolegadgetwidget.h + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. + * @brief + * @see The GNU Public License (GPL) Version 3 + * @defgroup consolegadget + * @{ + * + *****************************************************************************/ +/* + * 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, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef CONSOLEGADGETWIDGET_H_ +#define CONSOLEGADGETWIDGET_H_ + +#include + +class ConsoleGadgetWidget : public QTextEdit +{ + Q_OBJECT + +public: + ConsoleGadgetWidget(QWidget *parent = 0); + ~ConsoleGadgetWidget(); + +private: +}; + +#endif /* CONSOLEGADGETWIDGET_H_ */ diff --git a/ground/src/plugins/consolegadget/consoleplugin.cpp b/ground/src/plugins/consolegadget/consoleplugin.cpp new file mode 100644 index 000000000..da62426ec --- /dev/null +++ b/ground/src/plugins/consolegadget/consoleplugin.cpp @@ -0,0 +1,65 @@ +/** + ****************************************************************************** + * + * @file consoleplugin.cpp + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. + * @brief + * @see The GNU Public License (GPL) Version 3 + * @defgroup consolegadget + * @{ + * + *****************************************************************************/ +/* + * 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, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include "consoleplugin.h" +#include "consolegadgetfactory.h" +#include +#include +#include +#include + + +ConsolePlugin::ConsolePlugin() +{ + // Do nothing +} + +ConsolePlugin::~ConsolePlugin() +{ + // Do nothing +} + +bool ConsolePlugin::initialize(const QStringList& args, QString *errMsg) +{ + Q_UNUSED(args); + Q_UNUSED(errMsg); + mf = new ConsoleGadgetFactory(this); + addAutoReleasedObject(mf); + + return true; +} + +void ConsolePlugin::extensionsInitialized() +{ + // Do nothing +} + +void ConsolePlugin::shutdown() +{ + // Do nothing +} +Q_EXPORT_PLUGIN(ConsolePlugin) + diff --git a/ground/src/plugins/consolegadget/consoleplugin.h b/ground/src/plugins/consolegadget/consoleplugin.h new file mode 100644 index 000000000..08100b3c9 --- /dev/null +++ b/ground/src/plugins/consolegadget/consoleplugin.h @@ -0,0 +1,47 @@ +/** + ****************************************************************************** + * + * @file consoleplugin.h + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. + * @brief + * @see The GNU Public License (GPL) Version 3 + * @defgroup consolegadget + * @{ + * + *****************************************************************************/ +/* + * 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, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef CONSOLEPLUGIN_H_ +#define CONSOLEPLUGIN_H_ + +#include + +class ConsoleGadgetFactory; + +class ConsolePlugin : public ExtensionSystem::IPlugin +{ +public: + ConsolePlugin(); + ~ConsolePlugin(); + + void extensionsInitialized(); + bool initialize(const QStringList & arguments, QString * errorString); + void shutdown(); +private: + ConsoleGadgetFactory *mf; +}; +#endif /* CONSOLEPLUGIN_H_ */ diff --git a/ground/src/plugins/consolegadget/texteditloggerengine.cpp b/ground/src/plugins/consolegadget/texteditloggerengine.cpp new file mode 100644 index 000000000..7c65fb068 --- /dev/null +++ b/ground/src/plugins/consolegadget/texteditloggerengine.cpp @@ -0,0 +1,137 @@ +/** + ****************************************************************************** + * + * @file texteditloggerengine.cpp + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. + * Parts by Qxt Foundation http://www.libqxt.org Copyright (C) + * @brief + * @see The GNU Public License (GPL) Version 3 + * @defgroup consolegadget + * @{ + * + *****************************************************************************/ +/* + * 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, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "texteditloggerengine.h" +#include +#include +#include +#include + +#define QXT_REQUIRED_LEVELS (QxtLogger::WarningLevel | QxtLogger::ErrorLevel | QxtLogger::CriticalLevel | QxtLogger::FatalLevel) + +TextEditLoggerEngine::TextEditLoggerEngine(QTextEdit *textEdit) : m_textEdit(textEdit) +{ +#ifndef QT_NO_DEBUG + setLogLevelsEnabled(QXT_REQUIRED_LEVELS); +#else + setLogLevelsEnabled(QXT_REQUIRED_LEVELS | QxtLogger::DebugLevel); +#endif + enableLogging(); +} + +TextEditLoggerEngine::~TextEditLoggerEngine() +{ +} + +void TextEditLoggerEngine::initLoggerEngine() +{ + return; // Should work out of the box! +} + +void TextEditLoggerEngine::killLoggerEngine() +{ + return; // I do nothing. +} + +bool TextEditLoggerEngine::isInitialized() const +{ + return true; +} + +void TextEditLoggerEngine::setLogLevelEnabled(QxtLogger::LogLevels level, bool enable) +{ + QxtLoggerEngine::setLogLevelsEnabled(level | QXT_REQUIRED_LEVELS, enable); + if (!enable) QxtLoggerEngine::setLogLevelsEnabled(QXT_REQUIRED_LEVELS); +} + +void TextEditLoggerEngine::writeFormatted(QxtLogger::LogLevel level, const QList &msgs) +{ + switch (level) + { + case QxtLogger::ErrorLevel: + writeToTextEdit("Error", msgs, Qt::red); + break; + case QxtLogger::WarningLevel: + writeToTextEdit("Warning", msgs, Qt::red); + break; + case QxtLogger::CriticalLevel: + writeToTextEdit("Critical", msgs, Qt::red); + break; + case QxtLogger::FatalLevel: + writeToTextEdit("!!FATAL!!", msgs, Qt::red); + break; + case QxtLogger::TraceLevel: + writeToTextEdit("Trace", msgs, Qt::blue); + break; + case QxtLogger::DebugLevel: + writeToTextEdit("DEBUG", msgs, Qt::blue); + break; + case QxtLogger::InfoLevel: + writeToTextEdit("INFO", msgs); + break; + default: + writeToTextEdit("", msgs); + break; + } +} + +void TextEditLoggerEngine::writeToTextEdit(const QString& level, const QList &msgs, QColor color) +{ + /* Message format... + [time] [error level] First message..... + second message + third message + */ + if (msgs.isEmpty()) + return; + QScrollBar *sb = m_textEdit->verticalScrollBar(); + bool scroll = sb->value() == sb->maximum(); + QString header = '[' + QTime::currentTime().toString("hh:mm:ss.zzz") + "] [" + level + "] "; + QString padding; + QString appendText; + appendText.append(header); + for (int i = 0; i < header.size(); i++) padding.append(' '); + int count = 0; + Q_FOREACH(const QVariant& out, msgs) + { + if (!out.isNull()) + { + if (count != 0) + appendText.append(padding); + appendText.append(out.toString()); + } + count++; + } + Q_ASSERT(m_textEdit); + QTextCharFormat format = m_textEdit->currentCharFormat(); + format.setForeground(QBrush(color)); + m_textEdit->setCurrentCharFormat(format); + m_textEdit->append(appendText); + if (scroll) + sb->setValue(sb->maximum()); +} diff --git a/ground/src/plugins/consolegadget/texteditloggerengine.h b/ground/src/plugins/consolegadget/texteditloggerengine.h new file mode 100644 index 000000000..2ba40bf83 --- /dev/null +++ b/ground/src/plugins/consolegadget/texteditloggerengine.h @@ -0,0 +1,57 @@ +/** + ****************************************************************************** + * + * @file texteditloggerengine.h + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. + * Parts by Qxt Foundation http://www.libqxt.org Copyright (C) + * @brief + * @see The GNU Public License (GPL) Version 3 + * @defgroup consolegadget + * @{ + * + *****************************************************************************/ +/* + * 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, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef TEXTEDITLOGGERENGINE_H +#define TEXTEDITLOGGERENGINE_H + + +#include "qxtloggerengine.h" +#include "qxtglobal.h" +#include +class QTextEdit; + +class TextEditLoggerEngine : public QxtLoggerEngine +{ + +public: + TextEditLoggerEngine(QTextEdit *textEdit); + ~TextEditLoggerEngine(); + + void initLoggerEngine(); + void killLoggerEngine(); + void writeFormatted(QxtLogger::LogLevel level, const QList &messages); + void setLogLevelEnabled(QxtLogger::LogLevels level, bool enable = true); + + bool isInitialized() const; + +private: + virtual void writeToTextEdit(const QString& str_level, const QList &msgs, QColor color = QColor(0,0,0)); + QTextEdit *m_textEdit; +}; + +#endif // TEXTEDITLOGGERENGINE_H