Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
abef937f
Commit
abef937f
authored
Jan 31, 2007
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: messages. Small commit to fix two forgottten qfu() and to add whitespaces where needed.
parent
2d454641
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
40 deletions
+41
-40
modules/gui/qt4/dialogs/messages.cpp
modules/gui/qt4/dialogs/messages.cpp
+41
-40
No files found.
modules/gui/qt4/dialogs/messages.cpp
View file @
abef937f
...
...
@@ -41,28 +41,28 @@ MessagesDialog::MessagesDialog( intf_thread_t *_p_intf) : QVLCFrame( _p_intf )
setWindowTitle
(
qtr
(
"Messages"
)
);
resize
(
600
,
400
);
QGridLayout
*
layout
=
new
QGridLayout
(
this
);
QPushButton
*
closeButton
=
new
QPushButton
(
qtr
(
"&Close"
)
);
QPushButton
*
clearButton
=
new
QPushButton
(
qtr
(
"&Clear"
)
);
QPushButton
*
saveLogButton
=
new
QPushButton
(
qtr
(
"&Save as..."
)
);
QGridLayout
*
layout
=
new
QGridLayout
(
this
);
QPushButton
*
closeButton
=
new
QPushButton
(
qtr
(
"&Close"
)
);
QPushButton
*
clearButton
=
new
QPushButton
(
qtr
(
"&Clear"
)
);
QPushButton
*
saveLogButton
=
new
QPushButton
(
qtr
(
"&Save as..."
)
);
verbosityBox
=
new
QSpinBox
();
verbosityBox
->
setRange
(
0
,
2
);
verbosityBox
->
setValue
(
config_GetInt
(
p_intf
,
"verbose"
)
);
verbosityBox
->
setWrapping
(
true
);
verbosityBox
->
setRange
(
0
,
2
);
verbosityBox
->
setValue
(
config_GetInt
(
p_intf
,
"verbose"
)
);
verbosityBox
->
setWrapping
(
true
);
verbosityBox
->
setMaximumWidth
(
50
);
QLabel
*
verbosityLabel
=
new
QLabel
(
qtr
(
"Verbosity Level"
)
);
QLabel
*
verbosityLabel
=
new
QLabel
(
qtr
(
"Verbosity Level"
)
);
messages
=
new
QTextEdit
();
messages
->
setReadOnly
(
true
);
messages
->
setGeometry
(
0
,
0
,
440
,
600
);
messages
->
setHorizontalScrollBarPolicy
(
Qt
::
ScrollBarAlwaysOff
);
messages
->
setReadOnly
(
true
);
messages
->
setGeometry
(
0
,
0
,
440
,
600
);
messages
->
setHorizontalScrollBarPolicy
(
Qt
::
ScrollBarAlwaysOff
);
layout
->
addWidget
(
messages
,
0
,
0
,
1
,
0
);
layout
->
addWidget
(
verbosityLabel
,
1
,
0
,
1
,
1
);
layout
->
addWidget
(
verbosityBox
,
1
,
1
);
layout
->
addWidget
(
messages
,
0
,
0
,
1
,
0
);
layout
->
addWidget
(
verbosityLabel
,
1
,
0
,
1
,
1
);
layout
->
addWidget
(
verbosityBox
,
1
,
1
);
layout
->
addItem
(
new
QSpacerItem
(
20
,
20
,
QSizePolicy
::
Expanding
),
1
,
2
);
layout
->
addWidget
(
saveLogButton
,
1
,
3
);
layout
->
addWidget
(
clearButton
,
1
,
4
);
layout
->
addWidget
(
closeButton
,
1
,
5
);
layout
->
addWidget
(
saveLogButton
,
1
,
3
);
layout
->
addWidget
(
clearButton
,
1
,
4
);
layout
->
addWidget
(
closeButton
,
1
,
5
);
BUTTONACT
(
closeButton
,
close
()
);
BUTTONACT
(
clearButton
,
clear
()
);
...
...
@@ -97,9 +97,9 @@ void MessagesDialog::updateLog()
p_sub
->
p_msg
[
i_start
].
i_type
==
VLC_MSG_DBG
&&
verbosityBox
->
value
()
>=
2
)
{
messages
->
setFontItalic
(
true
);
messages
->
setTextColor
(
"darkBlue"
);
messages
->
insertPlainText
(
p_sub
->
p_msg
[
i_start
].
psz_module
);
messages
->
setFontItalic
(
true
);
messages
->
setTextColor
(
"darkBlue"
);
messages
->
insertPlainText
(
qfu
(
p_sub
->
p_msg
[
i_start
].
psz_module
)
);
}
else
continue
;
...
...
@@ -107,27 +107,27 @@ void MessagesDialog::updateLog()
switch
(
p_sub
->
p_msg
[
i_start
].
i_type
)
{
case
VLC_MSG_INFO
:
messages
->
setTextColor
(
"blue"
);
messages
->
insertPlainText
(
" info: "
);
messages
->
setTextColor
(
"blue"
);
messages
->
insertPlainText
(
" info: "
);
break
;
case
VLC_MSG_ERR
:
messages
->
setTextColor
(
"red"
);
messages
->
insertPlainText
(
" error: "
);
messages
->
setTextColor
(
"red"
);
messages
->
insertPlainText
(
" error: "
);
break
;
case
VLC_MSG_WARN
:
messages
->
setTextColor
(
"green"
);
messages
->
insertPlainText
(
" warning: "
);
messages
->
setTextColor
(
"green"
);
messages
->
insertPlainText
(
" warning: "
);
break
;
case
VLC_MSG_DBG
:
default:
messages
->
setTextColor
(
"grey"
);
messages
->
insertPlainText
(
" debug: "
);
messages
->
setTextColor
(
"grey"
);
messages
->
insertPlainText
(
" debug: "
);
break
;
}
/* Add message Regular black Font */
messages
->
setFontItalic
(
false
);
messages
->
setTextColor
(
"black"
);
messages
->
setFontItalic
(
false
);
messages
->
setTextColor
(
"black"
);
messages
->
insertPlainText
(
qfu
(
p_sub
->
p_msg
[
i_start
].
psz_msg
)
);
messages
->
insertPlainText
(
"
\n
"
);
}
...
...
@@ -152,25 +152,26 @@ void MessagesDialog::clear()
bool
MessagesDialog
::
save
()
{
QString
saveLogFileName
=
QFileDialog
::
getSaveFileName
(
this
,
qtr
(
"Choose a filename to save the logs under..."
),
p_intf
->
p_libvlc
->
psz_homedir
,
"Texts / Logs (*.log *.txt);; All (*.*) "
);
this
,
qtr
(
"Choose a filename to save the logs under..."
),
qfu
(
p_intf
->
p_libvlc
->
psz_homedir
)
,
"Texts / Logs (*.log *.txt);; All (*.*) "
);
if
(
!
saveLogFileName
.
isNull
()
)
{
QFile
file
(
saveLogFileName
);
if
(
!
file
.
open
(
QFile
::
WriteOnly
|
QFile
::
Text
)
)
{
QMessageBox
::
warning
(
this
,
qtr
(
"Application"
),
qtr
(
"Cannot write file %1:
\n
%2."
)
.
arg
(
saveLogFileName
)
.
arg
(
file
.
errorString
())
);
QFile
file
(
saveLogFileName
);
if
(
!
file
.
open
(
QFile
::
WriteOnly
|
QFile
::
Text
)
)
{
QMessageBox
::
warning
(
this
,
qtr
(
"Application"
),
qtr
(
"Cannot write file %1:
\n
%2."
)
.
arg
(
saveLogFileName
)
.
arg
(
file
.
errorString
()
)
);
return
false
;
}
QTextStream
out
(
&
file
);
QTextStream
out
(
&
file
);
out
<<
messages
->
toPlainText
()
<<
"
\n
"
;
return
true
;
}
return
false
;
}
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