]> git.sesse.net Git - vlc/blob - modules/gui/qt4/dialogs/messages.hpp
Qt: Preferences: match window title to current prefs
[vlc] / modules / gui / qt4 / dialogs / messages.hpp
1 /*****************************************************************************
2  * messages.hpp : Information about a stream
3  ****************************************************************************
4  * Copyright (C) 2006-2007 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Jean-Baptiste Kempf <jb (at) videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #ifndef QVLC_MESSAGES_DIALOG_H_
25 #define QVLC_MESSAGES_DIALOG_H_ 1
26
27 #include "util/qvlcframe.hpp"
28 #include "util/singleton.hpp"
29 #include "ui/messages_panel.h"
30 #include <stdarg.h>
31 #include <vlc_atomic.h>
32 #include <QMutex>
33
34 class QTabWidget;
35 class QPushButton;
36 class QSpinBox;
37 class QGridLayout;
38 class QLabel;
39 class QTextEdit;
40 class QTreeWidget;
41 class QTreeWidgetItem;
42 class QLineEdit;
43 class MsgEvent;
44
45 class MessagesDialog : public QVLCFrame, public Singleton<MessagesDialog>
46 {
47     Q_OBJECT
48 private:
49     MessagesDialog( intf_thread_t * );
50     virtual ~MessagesDialog();
51
52     Ui::messagesPanelWidget ui;
53     static void sinkMessage( void *, vlc_log_t *, unsigned );
54     void customEvent( QEvent * );
55     void sinkMessage( const MsgEvent * );
56     bool matchFilter( const QString& );
57
58     vlc_atomic_t verbosity;
59     static void MsgCallback( void *, int, const vlc_log_t *, const char *,
60                              va_list );
61
62 private slots:
63     bool save();
64     void updateConfig();
65     void changeVerbosity( int );
66     void updateOrClear();
67     void tabChanged( int );
68     void filterMessages();
69
70 private:
71     void buildTree( QTreeWidgetItem *, vlc_object_t * );
72
73     friend class    Singleton<MessagesDialog>;
74     QPushButton *updateButton;
75     QMutex messageLocker;
76 #ifndef NDEBUG
77     QTreeWidget *pldebugTree;
78     void updatePLTree();
79 #endif
80 };
81
82 #endif