28 #include <QDockWidget>
29 #include <QVBoxLayout>
30 #include <QHBoxLayout>
36 #include "WMainWindow.h"
37 #include "WQtMessagePopup.h"
39 #include "WQtMessageDock.h"
46 setObjectName(
"MessageDock:" + dockTitle );
47 setAllowedAreas( Qt::AllDockWidgetAreas );
48 setFeatures( QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable );
56 m_filterCombo->setToolTip(
"Filter the messages by level. When choosing a level, all messages with this and an above level will be displayed." );
70 connect( clearAction, SIGNAL( triggered() ),
this, SLOT(
clearMessages() ) );
91 addMessage(
"Log message from " + sender, message, type );
102 item->setSizeHint( QSize( 0, w->sizeHint().height() ) );
109 item->setHidden(
true );
121 for(
int i = 0; i <
m_logList->count() - MAXITEMS; ++i )
136 for(
int i = 0; i <
m_logList->count(); ++i )
139 QWidget* w =
m_logList->itemWidget( li );
Represents a simple log message with some attributes.
LogLevel getLogLevel() const
std::string getMessage() const
Returns the plain message of the entry.
std::string getSource() const
Returns the sender of the log.
static QSettings & getSettings()
Returns the settings object.
static WMainWindow * getMainWindow()
Returns the current main window instance or NULL if not existent.
void saveSettings()
Save state to settings.
QListWidget * m_logList
The list.
void addMessage(QString title, QString message, WQtMessagePopup::MessageType type)
Add a message to the dock.
void addLogMessage(QString sender, QString message, WQtMessagePopup::MessageType type)
Add a message to the dock.
QComboBox * m_filterCombo
The message filter.
WQtMessageDock(QString dockTitle, QWidget *parent)
Constructor.
void clearMessages()
Clear the message list.
virtual ~WQtMessageDock()
Destructor.
void handleFilterUpdate()
Handles changes in the filter combo.