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
1075ddb2
Commit
1075ddb2
authored
May 11, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: convert VLC message stuff to QString
parent
166da1ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
18 deletions
+27
-18
modules/gui/qt4/dialogs/messages.cpp
modules/gui/qt4/dialogs/messages.cpp
+25
-17
modules/gui/qt4/dialogs/messages.hpp
modules/gui/qt4/dialogs/messages.hpp
+2
-1
No files found.
modules/gui/qt4/dialogs/messages.cpp
View file @
1075ddb2
...
...
@@ -47,23 +47,32 @@ enum {
class
MsgEvent
:
public
QEvent
{
public:
MsgEvent
(
msg_item_t
*
msg
)
:
QEvent
(
(
QEvent
::
Type
)
MsgEvent_Type
)
{
this
->
msg
=
msg_Copy
(
msg
);
}
virtual
~
MsgEvent
(
void
)
{
msg_Free
(
msg
);
}
msg_item_t
*
msg
;
MsgEvent
(
const
msg_item_t
*
);
int
priority
;
uintptr_t
object_id
;
QString
object_type
;
QString
header
;
QString
module
;
QString
text
;
};
MsgEvent
::
MsgEvent
(
const
msg_item_t
*
msg
)
:
QEvent
(
(
QEvent
::
Type
)
MsgEvent_Type
),
priority
(
msg
->
i_type
),
object_id
(
msg
->
i_object_id
),
object_type
(
qfu
(
msg
->
psz_object_type
)
),
header
(
qfu
(
msg
->
psz_header
)
),
module
(
qfu
(
msg
->
psz_module
)
),
text
(
qfu
(
msg
->
psz_msg
)
)
{
}
struct
msg_cb_data_t
{
MessagesDialog
*
self
;
};
static
void
MsgCallback
(
msg_cb_data_t
*
,
msg_item_t
*
,
unsigned
);
MessagesDialog
::
MessagesDialog
(
intf_thread_t
*
_p_intf
)
...
...
@@ -71,7 +80,6 @@ MessagesDialog::MessagesDialog( intf_thread_t *_p_intf)
{
setWindowTitle
(
qtr
(
"Messages"
)
);
setWindowRole
(
"vlc-messages"
);
/* Build Ui */
ui
.
setupUi
(
this
);
ui
.
bottomButtonsBox
->
addButton
(
new
QPushButton
(
qtr
(
"&Close"
),
this
),
...
...
@@ -160,7 +168,7 @@ void MessagesDialog::updateConfig()
}
}
void
MessagesDialog
::
sinkMessage
(
msg_item_t
*
item
)
void
MessagesDialog
::
sinkMessage
(
MsgEvent
*
msg
)
{
QTextEdit
*
messages
=
ui
.
messages
;
/* Only scroll if the viewport is at the end.
...
...
@@ -180,9 +188,9 @@ void MessagesDialog::sinkMessage( msg_item_t *item )
messages
->
setFontItalic
(
true
);
messages
->
setTextColor
(
"darkBlue"
);
messages
->
insertPlainText
(
qfu
(
item
->
psz_module
)
);
messages
->
insertPlainText
(
msg
->
module
);
switch
(
item
->
i_type
)
switch
(
msg
->
priority
)
{
case
VLC_MSG_INFO
:
messages
->
setTextColor
(
"blue"
);
...
...
@@ -206,7 +214,7 @@ void MessagesDialog::sinkMessage( msg_item_t *item )
/* Add message Regular black Font */
messages
->
setFontItalic
(
false
);
messages
->
setTextColor
(
"black"
);
messages
->
insertPlainText
(
qfu
(
item
->
psz_msg
)
);
messages
->
insertPlainText
(
msg
->
text
);
messages
->
insertPlainText
(
"
\n
"
);
if
(
b_autoscroll
)
messages
->
ensureCursorVisible
();
}
...
...
@@ -216,7 +224,7 @@ void MessagesDialog::customEvent( QEvent *event )
MsgEvent
*
msge
=
static_cast
<
MsgEvent
*>
(
event
);
assert
(
msge
);
sinkMessage
(
msge
->
msg
);
sinkMessage
(
msge
);
}
void
MessagesDialog
::
clear
()
...
...
modules/gui/qt4/dialogs/messages.hpp
View file @
1075ddb2
...
...
@@ -37,6 +37,7 @@ class QTextEdit;
class
QTreeWidget
;
class
QTreeWidgetItem
;
class
QLineEdit
;
class
MsgEvent
;
class
MessagesDialog
:
public
QVLCFrame
,
public
Singleton
<
MessagesDialog
>
{
...
...
@@ -50,7 +51,7 @@ private:
msg_cb_data_t
*
cbData
;
static
void
sinkMessage
(
msg_cb_data_t
*
,
msg_item_t
*
,
unsigned
);
void
customEvent
(
QEvent
*
);
void
sinkMessage
(
msg_item_t
*
item
);
void
sinkMessage
(
MsgEvent
*
);
private
slots
:
bool
save
();
...
...
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