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
da803b04
Commit
da803b04
authored
Aug 19, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: implement message object/module filter in the dialog
parent
9e0d891f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
26 deletions
+40
-26
modules/gui/qt4/dialogs/messages.cpp
modules/gui/qt4/dialogs/messages.cpp
+36
-25
modules/gui/qt4/dialogs/messages.hpp
modules/gui/qt4/dialogs/messages.hpp
+4
-1
No files found.
modules/gui/qt4/dialogs/messages.cpp
View file @
da803b04
...
@@ -95,7 +95,13 @@ MessagesDialog::MessagesDialog( intf_thread_t *_p_intf)
...
@@ -95,7 +95,13 @@ MessagesDialog::MessagesDialog( intf_thread_t *_p_intf)
vlc_atomic_set
(
&
this
->
verbosity
,
verbosity
);
vlc_atomic_set
(
&
this
->
verbosity
,
verbosity
);
ui
.
verbosityBox
->
setValue
(
verbosity
);
ui
.
verbosityBox
->
setValue
(
verbosity
);
ui
.
vbobjectsEdit
->
setText
(
config_GetPsz
(
p_intf
,
"verbose-objects"
));
char
*
objs
=
var_InheritString
(
p_intf
,
"verbose-objects"
);
if
(
objs
!=
NULL
)
{
ui
.
vbobjectsEdit
->
setText
(
qfu
(
objs
)
);
free
(
objs
);
}
updateConfig
();
ui
.
vbobjectsEdit
->
setToolTip
(
"verbose-objects usage:
\n
"
ui
.
vbobjectsEdit
->
setToolTip
(
"verbose-objects usage:
\n
"
"--verbose-objects=+printthatobject,-dontprintthatone
\n
"
"--verbose-objects=+printthatobject,-dontprintthatone
\n
"
"(keyword 'all' to applies to all objects)"
);
"(keyword 'all' to applies to all objects)"
);
...
@@ -139,37 +145,42 @@ void MessagesDialog::changeVerbosity( int verbosity )
...
@@ -139,37 +145,42 @@ void MessagesDialog::changeVerbosity( int verbosity )
void
MessagesDialog
::
updateConfig
()
void
MessagesDialog
::
updateConfig
()
{
{
config_PutPsz
(
p_intf
,
"verbose-objects"
,
qtu
(
ui
.
vbobjectsEdit
->
text
()));
const
QString
&
objects
=
ui
.
vbobjectsEdit
->
text
();
//vbobjectsEdit->setText("vbEdit changed!");
/* FIXME: config item should be part of Qt4 module */
config_PutPsz
(
p_intf
,
"verbose-objects"
,
qtu
(
objects
));
if
(
!
ui
.
vbobjectsEdit
->
text
().
isEmpty
()
)
QStringList
filterOut
,
filterIn
;
/* If a filter is set, disable by default */
/* If no filters are set, enable */
filterDefault
=
objects
.
isEmpty
();
foreach
(
const
QString
&
elem
,
objects
.
split
(
QChar
(
','
))
)
{
{
/* if user sets filter, go with the idea that user just wants that to be shown,
QString
object
=
elem
;
so disable all by default and enable those that user wants */
bool
add
=
true
;
msg_DisableObjectPrinting
(
p_intf
,
"all"
);
char
*
psz_verbose_objects
=
strdup
(
qtu
(
ui
.
vbobjectsEdit
->
text
()));
if
(
elem
.
startsWith
(
QChar
(
'-'
))
)
char
*
psz_object
,
*
iter
=
psz_verbose_objects
;
while
(
(
psz_object
=
strsep
(
&
iter
,
","
))
)
{
switch
(
psz_object
[
0
]
)
{
{
printf
(
"%s
\n
"
,
psz_object
+
1
);
add
=
false
;
case
'+'
:
msg_EnableObjectPrinting
(
p_intf
,
psz_object
+
1
);
break
;
object
.
remove
(
0
,
1
);
case
'-'
:
msg_DisableObjectPrinting
(
p_intf
,
psz_object
+
1
);
break
;
/* user can but just 'lua,playlist' on filter */
default:
msg_EnableObjectPrinting
(
p_intf
,
psz_object
);
break
;
}
}
free
(
psz_verbose_objects
);
}
}
else
if
(
elem
.
startsWith
(
QChar
(
'+'
))
)
object
.
remove
(
0
,
1
);
if
(
object
.
compare
(
qfu
(
"all"
),
Qt
::
CaseInsensitive
)
==
0
)
filterDefault
=
add
;
else
else
{
(
add
?
&
filterIn
:
&
filterOut
)
->
append
(
object
);
msg_EnableObjectPrinting
(
p_intf
,
"all"
);
}
}
filter
=
filterDefault
?
filterOut
:
filterIn
;
filter
.
removeDuplicates
();
}
}
void
MessagesDialog
::
sinkMessage
(
MsgEvent
*
msg
)
void
MessagesDialog
::
sinkMessage
(
const
MsgEvent
*
msg
)
{
{
if
(
(
filter
.
contains
(
msg
->
module
)
||
filter
.
contains
(
msg
->
object_type
))
==
filterDefault
)
return
;
QTextEdit
*
messages
=
ui
.
messages
;
QTextEdit
*
messages
=
ui
.
messages
;
/* Only scroll if the viewport is at the end.
/* Only scroll if the viewport is at the end.
Don't bug user by auto-changing/loosing viewport on insert(). */
Don't bug user by auto-changing/loosing viewport on insert(). */
...
...
modules/gui/qt4/dialogs/messages.hpp
View file @
da803b04
...
@@ -51,11 +51,14 @@ private:
...
@@ -51,11 +51,14 @@ private:
msg_cb_data_t
*
cbData
;
msg_cb_data_t
*
cbData
;
static
void
sinkMessage
(
msg_cb_data_t
*
,
msg_item_t
*
,
unsigned
);
static
void
sinkMessage
(
msg_cb_data_t
*
,
msg_item_t
*
,
unsigned
);
void
customEvent
(
QEvent
*
);
void
customEvent
(
QEvent
*
);
void
sinkMessage
(
MsgEvent
*
);
void
sinkMessage
(
const
MsgEvent
*
);
vlc_atomic_t
verbosity
;
vlc_atomic_t
verbosity
;
static
void
MsgCallback
(
msg_cb_data_t
*
,
const
msg_item_t
*
);
static
void
MsgCallback
(
msg_cb_data_t
*
,
const
msg_item_t
*
);
QStringList
filter
;
bool
filterDefault
;
private
slots
:
private
slots
:
bool
save
();
bool
save
();
void
updateConfig
();
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