Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
f70a9052
Commit
f70a9052
authored
Oct 19, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: restore message dialog
(bug at exit due to more generic problems with #2226 and #2227)
parent
42b58e87
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
68 deletions
+69
-68
modules/gui/qt4/dialogs/messages.cpp
modules/gui/qt4/dialogs/messages.cpp
+64
-62
modules/gui/qt4/dialogs/messages.hpp
modules/gui/qt4/dialogs/messages.hpp
+5
-2
modules/gui/qt4/qt4.cpp
modules/gui/qt4/qt4.cpp
+0
-3
modules/gui/qt4/qt4.hpp
modules/gui/qt4/qt4.hpp
+0
-1
No files found.
modules/gui/qt4/dialogs/messages.cpp
View file @
f70a9052
...
...
@@ -39,9 +39,16 @@
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QHeaderView>
#include <QMutex>
MessagesDialog
*
MessagesDialog
::
instance
=
NULL
;
struct
msg_cb_data_t
{
MessagesDialog
*
self
;
QMutex
lock
;
/**< protects MessagesDialog::messages */
};
MessagesDialog
::
MessagesDialog
(
intf_thread_t
*
_p_intf
)
:
QVLCFrame
(
_p_intf
)
{
...
...
@@ -64,7 +71,6 @@ MessagesDialog::MessagesDialog( intf_thread_t *_p_intf)
msgLayout
->
addWidget
(
messages
,
0
,
0
,
1
,
0
);
mainTab
->
addTab
(
msgWidget
,
qtr
(
"Messages"
)
);
// ON_TIMEOUT( updateLog() );
/* Modules tree */
...
...
@@ -109,8 +115,21 @@ MessagesDialog::MessagesDialog( intf_thread_t *_p_intf)
/* General action */
readSettings
(
"Messages"
,
QSize
(
600
,
450
)
);
/* Hook up to LibVLC messaging */
cb_data
=
new
msg_cb_data_t
;
cb_data
->
self
=
this
;
sub
=
msg_Subscribe
(
_p_intf
->
p_libvlc
,
sinkMessage
,
cb_data
);
}
MessagesDialog
::~
MessagesDialog
()
{
writeSettings
(
"messages"
);
msg_Unsubscribe
(
sub
);
delete
cb_data
;
};
void
MessagesDialog
::
updateTab
(
int
index
)
{
/* Second tab : modules tree */
...
...
@@ -132,72 +151,53 @@ void MessagesDialog::updateTab( int index )
}
}
void
MessagesDialog
::
updateLog
()
void
MessagesDialog
::
sinkMessage
(
msg_cb_data_t
*
data
,
msg_item_t
*
item
,
unsigned
overruns
)
{
MessagesDialog
*
self
=
data
->
self
;
QMutexLocker
locker
(
&
data
->
lock
);
self
->
sinkMessage
(
item
,
overruns
);
}
void
MessagesDialog
::
sinkMessage
(
msg_item_t
*
item
,
unsigned
)
{
#if 0
msg_subscription_t *p_sub = p_intf->p_sys->p_sub;
int i_start
;
if
((
item
->
i_type
==
VLC_MSG_WARN
&&
verbosityBox
->
value
()
<
1
)
||
(
item
->
i_type
==
VLC_MSG_DBG
&&
verbosityBox
->
value
()
<
2
))
return
;
vlc_mutex_lock( p_sub->p_lock );
int i_stop = *p_sub->pi_stop;
vlc_mutex_unlock( p_sub->p_lock );
messages
->
textCursor
().
movePosition
(
QTextCursor
::
End
);
messages
->
setFontItalic
(
true
);
messages
->
setTextColor
(
"darkBlue"
);
messages
->
insertPlainText
(
qfu
(
item
->
psz_module
)
);
if( p_sub->i_start != i_stop
)
switch
(
item
->
i_type
)
{
messages->textCursor().movePosition( QTextCursor::End );
for( i_start = p_sub->i_start;
i_start != i_stop;
i_start = (i_start+1) % VLC_MSG_QSIZE )
{
if( p_sub->p_msg[i_start].i_type == VLC_MSG_INFO ||
p_sub->p_msg[i_start].i_type == VLC_MSG_ERR ||
p_sub->p_msg[i_start].i_type == VLC_MSG_WARN &&
verbosityBox->value() >= 1 ||
p_sub->p_msg[i_start].i_type == VLC_MSG_DBG &&
verbosityBox->value() >= 2 )
{
messages->setFontItalic( true );
messages->setTextColor( "darkBlue" );
messages->insertPlainText( qfu( p_sub->p_msg[i_start].psz_module ) );
}
else
continue;
switch( p_sub->p_msg[i_start].i_type )
{
case VLC_MSG_INFO:
messages->setTextColor( "blue" );
messages->insertPlainText( " info: " );
break;
case VLC_MSG_ERR:
messages->setTextColor( "red" );
messages->insertPlainText( " error: " );
break;
case VLC_MSG_WARN:
messages->setTextColor( "green" );
messages->insertPlainText( " warning: " );
break;
case VLC_MSG_DBG:
default:
messages->setTextColor( "grey" );
messages->insertPlainText( " debug: " );
break;
}
/* Add message Regular black Font */
messages->setFontItalic( false );
messages->setTextColor( "black" );
messages->insertPlainText( qfu(p_sub->p_msg[i_start].psz_msg) );
messages->insertPlainText( "\n" );
}
messages->ensureCursorVisible();
vlc_mutex_lock( p_sub->p_lock );
p_sub->i_start = i_start;
vlc_mutex_unlock( p_sub->p_lock );
case
VLC_MSG_INFO
:
messages
->
setTextColor
(
"blue"
);
messages
->
insertPlainText
(
" info: "
);
break
;
case
VLC_MSG_ERR
:
messages
->
setTextColor
(
"red"
);
messages
->
insertPlainText
(
" error: "
);
break
;
case
VLC_MSG_WARN
:
messages
->
setTextColor
(
"green"
);
messages
->
insertPlainText
(
" warning: "
);
break
;
case
VLC_MSG_DBG
:
default:
messages
->
setTextColor
(
"grey"
);
messages
->
insertPlainText
(
" debug: "
);
break
;
}
#endif
/* Add message Regular black Font */
messages
->
setFontItalic
(
false
);
messages
->
setTextColor
(
"black"
);
messages
->
insertPlainText
(
qfu
(
item
->
psz_msg
)
);
messages
->
insertPlainText
(
"
\n
"
);
messages
->
ensureCursorVisible
();
}
void
MessagesDialog
::
buildTree
(
QTreeWidgetItem
*
parentItem
,
...
...
@@ -242,6 +242,7 @@ void MessagesDialog::updateTree()
void
MessagesDialog
::
clear
()
{
QMutexLocker
locker
(
&
cb_data
->
lock
);
messages
->
clear
();
}
...
...
@@ -264,6 +265,7 @@ bool MessagesDialog::save()
}
QTextStream
out
(
&
file
);
QMutexLocker
locker
(
&
cb_data
->
lock
);
out
<<
messages
->
toPlainText
()
<<
"
\n
"
;
return
true
;
...
...
modules/gui/qt4/dialogs/messages.hpp
View file @
f70a9052
...
...
@@ -51,7 +51,7 @@ public:
instance
=
NULL
;
}
virtual
~
MessagesDialog
()
{
writeSettings
(
"messages"
);
}
;
virtual
~
MessagesDialog
();
private:
MessagesDialog
(
intf_thread_t
*
);
...
...
@@ -63,10 +63,13 @@ private:
QTreeWidget
*
modulesTree
;
QPushButton
*
clearUpdateButton
;
QPushButton
*
saveLogButton
;
msg_subscription_t
*
sub
;
msg_cb_data_t
*
cb_data
;
static
void
sinkMessage
(
msg_cb_data_t
*
,
msg_item_t
*
,
unsigned
);
void
sinkMessage
(
msg_item_t
*
item
,
unsigned
);
private
slots
:
void
updateTab
(
int
);
void
updateLog
();
void
clearOrUpdate
();
bool
save
();
private:
...
...
modules/gui/qt4/qt4.cpp
View file @
f70a9052
...
...
@@ -263,8 +263,6 @@ static int Open( vlc_object_t *p_this )
/* Access to the playlist */
p_intf
->
p_sys
->
p_playlist
=
pl_Hold
(
p_intf
);
/* Listen to the messages */
//p_intf->p_sys->p_sub = msg_Subscribe( p_intf->p_libvlc, NULL, NULL );
/* one settings to rule them all */
var_Create
(
p_this
,
"window_widget"
,
VLC_VAR_ADDRESS
);
...
...
@@ -298,7 +296,6 @@ static void Close( vlc_object_t *p_this )
}
vlc_object_release
(
p_intf
->
p_sys
->
p_playlist
);
//msg_Unsubscribe( p_intf->p_sys->p_sub );
free
(
p_intf
->
p_sys
);
}
...
...
modules/gui/qt4/qt4.hpp
View file @
f70a9052
...
...
@@ -72,7 +72,6 @@ struct intf_sys_t
bool
b_isDialogProvider
;
playlist_t
*
p_playlist
;
msg_subscription_t
*
p_sub
;
///< Subscription to the message bank
VideoWidget
*
p_video
;
...
...
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