OpenWalnut
1.5.0dev
src
qtgui
WQtMessageDock.h
1
//---------------------------------------------------------------------------
2
//
3
// Project: OpenWalnut ( http://www.openwalnut.org )
4
//
5
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6
// For more information see http://www.openwalnut.org/copying
7
//
8
// This file is part of OpenWalnut.
9
//
10
// OpenWalnut is free software: you can redistribute it and/or modify
11
// it under the terms of the GNU Lesser General Public License as published by
12
// the Free Software Foundation, either version 3 of the License, or
13
// (at your option) any later version.
14
//
15
// OpenWalnut is distributed in the hope that it will be useful,
16
// but WITHOUT ANY WARRANTY; without even the implied warranty of
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
// GNU Lesser General Public License for more details.
19
//
20
// You should have received a copy of the GNU Lesser General Public License
21
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22
//
23
//---------------------------------------------------------------------------
24
25
#ifndef WQTMESSAGEDOCK_H
26
#define WQTMESSAGEDOCK_H
27
28
#include <QDockWidget>
29
#include <QListWidget>
30
#include <QComboBox>
31
32
#include "core/common/WLogEntry.h"
33
34
#include "guiElements/WQtDockWidget.h"
35
#include "WQtMessagePopup.h"
36
37
/**
38
* Dock widget for showing messages and logs
39
*/
40
class
WQtMessageDock
:
public
WQtDockWidget
41
{
42
Q_OBJECT
43
public
:
44
/**
45
* Constructor
46
*
47
* \param dockTitle the title
48
* \param parent parent widget
49
*/
50
WQtMessageDock
( QString dockTitle, QWidget* parent );
51
52
/**
53
* Destructor.
54
*/
55
virtual
~WQtMessageDock
();
56
57
/**
58
* Add a message to the dock
59
*
60
* \param title the title
61
* \param message the message
62
* \param type the type
63
*/
64
void
addMessage
( QString title, QString message, WQtMessagePopup::MessageType type );
65
66
/**
67
* Add a message to the dock
68
*
69
* \param sender who sent the message
70
* \param message the message
71
* \param type the type
72
*/
73
void
addLogMessage
( QString sender, QString message, WQtMessagePopup::MessageType type );
74
75
/**
76
* Add message to the dock
77
*
78
* \param entry use this log entry
79
*/
80
void
addLogMessage
(
const
WLogEntry
& entry );
81
82
/**
83
* Save state to settings
84
*/
85
void
saveSettings
();
86
87
public
slots:
88
/**
89
* Clear the message list.
90
*/
91
void
clearMessages
();
92
93
protected
slots:
94
/**
95
* Handles changes in the filter combo
96
*/
97
void
handleFilterUpdate
();
98
private
:
99
/**
100
* The list
101
*/
102
QListWidget*
m_logList
;
103
104
/**
105
* The message filter
106
*/
107
QComboBox*
m_filterCombo
;
108
};
109
110
#endif
// WQTMESSAGEDOCK_H
111
WLogEntry
Represents a simple log message with some attributes.
Definition:
WLogEntry.h:57
WQtDockWidget
Advanced QDockWidget.
Definition:
WQtDockWidget.h:50
WQtMessageDock
Dock widget for showing messages and logs.
Definition:
WQtMessageDock.h:41
WQtMessageDock::saveSettings
void saveSettings()
Save state to settings.
Definition:
WQtMessageDock.cpp:129
WQtMessageDock::m_logList
QListWidget * m_logList
The list.
Definition:
WQtMessageDock.h:102
WQtMessageDock::addMessage
void addMessage(QString title, QString message, WQtMessagePopup::MessageType type)
Add a message to the dock.
Definition:
WQtMessageDock.cpp:94
WQtMessageDock::addLogMessage
void addLogMessage(QString sender, QString message, WQtMessagePopup::MessageType type)
Add a message to the dock.
Definition:
WQtMessageDock.cpp:89
WQtMessageDock::m_filterCombo
QComboBox * m_filterCombo
The message filter.
Definition:
WQtMessageDock.h:107
WQtMessageDock::WQtMessageDock
WQtMessageDock(QString dockTitle, QWidget *parent)
Constructor.
Definition:
WQtMessageDock.cpp:43
WQtMessageDock::clearMessages
void clearMessages()
Clear the message list.
Definition:
WQtMessageDock.cpp:148
WQtMessageDock::~WQtMessageDock
virtual ~WQtMessageDock()
Destructor.
Definition:
WQtMessageDock.cpp:77
WQtMessageDock::handleFilterUpdate
void handleFilterUpdate()
Handles changes in the filter combo.
Definition:
WQtMessageDock.cpp:134
Generated by
1.9.1