Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
6327c52d
Commit
6327c52d
authored
Aug 18, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: apply verbosity filtering within Qt, do not rely on core
parent
28fde051
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
26 deletions
+32
-26
include/vlc_messages.h
include/vlc_messages.h
+16
-17
modules/gui/qt4/dialogs/messages.cpp
modules/gui/qt4/dialogs/messages.cpp
+13
-9
modules/gui/qt4/dialogs/messages.hpp
modules/gui/qt4/dialogs/messages.hpp
+3
-0
No files found.
include/vlc_messages.h
View file @
6327c52d
...
...
@@ -42,29 +42,28 @@
* @{
*/
/** Message types */
enum
msg_item_type
{
VLC_MSG_INFO
=
0
,
/**< Important information */
VLC_MSG_ERR
,
/**< Error */
VLC_MSG_WARN
,
/**< Warning */
VLC_MSG_DBG
,
/**< Debug */
};
/**
*
Store a single message sent to user.
*
Log message
*/
typedef
struct
{
int
i_type
;
/**< message type, see below
*/
uintptr_t
i_object_id
;
const
char
*
psz_object_type
;
const
char
*
psz_module
;
const
char
*
psz_header
;
/**< Additional header
*/
char
*
psz_msg
;
/**< the message itself
*/
unsigned
i_type
;
/**< Message type, see @ref msg_item_type
*/
uintptr_t
i_object_id
;
/**< Emitter (temporaly) unique object ID or 0 */
const
char
*
psz_object_type
;
/**< Emitter object type name */
const
char
*
psz_module
;
/**< Emitter module (source code) */
const
char
*
psz_header
;
/**< Additional header (used by VLM media)
*/
char
*
psz_msg
;
/**< Message text
*/
}
msg_item_t
;
/* Message types */
/** standard messages */
#define VLC_MSG_INFO 0
/** error messages */
#define VLC_MSG_ERR 1
/** warning messages */
#define VLC_MSG_WARN 2
/** debug messages */
#define VLC_MSG_DBG 3
VLC_MALLOC
VLC_USED
static
inline
msg_item_t
*
msg_Copy
(
const
msg_item_t
*
msg
)
{
...
...
modules/gui/qt4/dialogs/messages.cpp
View file @
6327c52d
/*****************************************************************************
* Messages.cpp : Information about an item
****************************************************************************
* Copyright (C) 2006-20
07
the VideoLAN team
* Copyright (C) 2006-20
11
the VideoLAN team
* $Id$
*
* Authors: Jean-Baptiste Kempf <jb (at) videolan.org>
...
...
@@ -25,6 +25,7 @@
#endif
#include "dialogs/messages.hpp"
#include <vlc_atomic.h>
#include <QTextEdit>
#include <QTextCursor>
...
...
@@ -73,8 +74,6 @@ struct msg_cb_data_t
MessagesDialog
*
self
;
};
static
void
MsgCallback
(
msg_cb_data_t
*
,
const
msg_item_t
*
);
MessagesDialog
::
MessagesDialog
(
intf_thread_t
*
_p_intf
)
:
QVLCFrame
(
_p_intf
)
{
...
...
@@ -92,7 +91,9 @@ MessagesDialog::MessagesDialog( intf_thread_t *_p_intf)
/* Buttons and general layout */
ui
.
saveLogButton
->
setToolTip
(
qtr
(
"Saves all the displayed logs to a file"
)
);
ui
.
verbosityBox
->
setValue
(
var_InheritInteger
(
p_intf
,
"verbose"
)
);
int
verbosity
=
var_InheritInteger
(
p_intf
,
"verbose"
);
vlc_atomic_set
(
&
this
->
verbosity
,
verbosity
);
ui
.
verbosityBox
->
setValue
(
verbosity
);
ui
.
vbobjectsEdit
->
setText
(
config_GetPsz
(
p_intf
,
"verbose-objects"
));
ui
.
vbobjectsEdit
->
setToolTip
(
"verbose-objects usage:
\n
"
...
...
@@ -122,7 +123,6 @@ MessagesDialog::MessagesDialog( intf_thread_t *_p_intf)
cbData
=
new
msg_cb_data_t
;
cbData
->
self
=
this
;
sub
=
msg_Subscribe
(
p_intf
->
p_libvlc
,
MsgCallback
,
cbData
);
changeVerbosity
(
ui
.
verbosityBox
->
value
()
);
}
MessagesDialog
::~
MessagesDialog
()
...
...
@@ -134,7 +134,7 @@ MessagesDialog::~MessagesDialog()
void
MessagesDialog
::
changeVerbosity
(
int
verbosity
)
{
msg_SubscriptionSetVerbosity
(
sub
,
verbosity
);
vlc_atomic_set
(
&
this
->
verbosity
,
verbosity
);
}
void
MessagesDialog
::
updateConfig
()
...
...
@@ -296,11 +296,15 @@ void MessagesDialog::tabChanged( int i )
updateButton
->
setVisible
(
i
==
1
);
}
static
void
MsgCallback
(
msg_cb_data_t
*
data
,
const
msg_item_t
*
item
)
void
MessagesDialog
::
MsgCallback
(
msg_cb_data_t
*
data
,
const
msg_item_t
*
item
)
{
int
canc
=
vlc_savecancel
();
MessagesDialog
*
dialog
=
data
->
self
;
int
verbosity
=
vlc_atomic_get
(
&
dialog
->
verbosity
);
QApplication
::
postEvent
(
data
->
self
,
new
MsgEvent
(
item
)
);
if
(
verbosity
<
0
||
verbosity
<
(
item
->
i_type
-
VLC_MSG_ERR
)
)
return
;
int
canc
=
vlc_savecancel
();
QApplication
::
postEvent
(
dialog
,
new
MsgEvent
(
item
)
);
vlc_restorecancel
(
canc
);
}
modules/gui/qt4/dialogs/messages.hpp
View file @
6327c52d
...
...
@@ -53,6 +53,9 @@ private:
void
customEvent
(
QEvent
*
);
void
sinkMessage
(
MsgEvent
*
);
vlc_atomic_t
verbosity
;
static
void
MsgCallback
(
msg_cb_data_t
*
,
const
msg_item_t
*
);
private
slots
:
bool
save
();
void
updateConfig
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment