From 6fb36d6c028d4fe88043c764e42b54df9b06f48b Mon Sep 17 00:00:00 2001 From: Tannin Date: Sun, 4 May 2014 14:50:01 +0200 Subject: - main window now has a small view displaying log messages - mod list will now be highlighted when grouping is active is active - download tooltip now supports bbcode markup in the description - bbcode translator will now translate some named colors - algorithm for detection of mod order problems is now more sophisticated - exposed more functionality to python plugins - updated to qt 4.8.6 dlls - bugfix: plugin list wasn't - bugfix: state changes in mod list wasn't always reported - bugfix: loot client will now create necessary directory - bugfix: NCC sometimes used wrong source path for extracting - bugfix: removed noisy debug message --- src/logbuffer.h | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'src/logbuffer.h') diff --git a/src/logbuffer.h b/src/logbuffer.h index 68753996..caada1d9 100644 --- a/src/logbuffer.h +++ b/src/logbuffer.h @@ -23,10 +23,12 @@ along with Mod Organizer. If not, see . #include #include #include +#include +#include #include -class LogBuffer : public QObject +class LogBuffer : public QAbstractItemModel { Q_OBJECT @@ -42,12 +44,22 @@ public: static void writeNow(); static void cleanQuit(); + static LogBuffer *instance() { return s_Instance.data(); } + public: virtual ~LogBuffer(); void logMessage(QtMsgType type, const QString &message); + // QAbstractItemModel interface +public: + QModelIndex index(int row, int column, const QModelIndex &parent) const; + QModelIndex parent(const QModelIndex &child) const; + int rowCount(const QModelIndex &parent) const; + int columnCount(const QModelIndex &parent) const; + QVariant data(const QModelIndex &index, int role) const; + signals: public slots: @@ -62,6 +74,15 @@ private: static char msgTypeID(QtMsgType type); +private: + + struct Message { + QtMsgType type; + QTime time; + QString message; + QString toString() const; + }; + private: static QScopedPointer s_Instance; @@ -71,7 +92,7 @@ private: bool m_ShutDown; QtMsgType m_MinMsgType; unsigned int m_NumMessages; - std::vector m_Messages; + std::vector m_Messages; }; -- cgit v1.3.1