Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
4f0c843d
Commit
4f0c843d
authored
Sep 07, 2010
by
Francois Cartegnie
Committed by
Jean-Baptiste Kempf
Sep 07, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: simplifiy/rebase messages on QtCreator. Fix Ui Logic
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
fe65deaa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
144 additions
and
118 deletions
+144
-118
modules/gui/qt4/Modules.am
modules/gui/qt4/Modules.am
+2
-0
modules/gui/qt4/dialogs/messages.cpp
modules/gui/qt4/dialogs/messages.cpp
+23
-106
modules/gui/qt4/dialogs/messages.hpp
modules/gui/qt4/dialogs/messages.hpp
+3
-12
modules/gui/qt4/ui/messages_panel.ui
modules/gui/qt4/ui/messages_panel.ui
+116
-0
No files found.
modules/gui/qt4/Modules.am
View file @
4f0c843d
...
...
@@ -85,6 +85,7 @@ nodist_SOURCES_qt4 = \
ui/sprefs_subtitles.h \
ui/sprefs_video.h \
ui/streampanel.h \
ui/messages_panel.h \
ui/sout.h
DEPS_res = \
...
...
@@ -356,6 +357,7 @@ EXTRA_DIST += \
ui/sprefs_subtitles.ui \
ui/sprefs_video.ui \
ui/streampanel.ui \
ui/messages_panel.ui \
ui/sout.ui \
ui/vlm.ui \
$(DEPS_res)
...
...
modules/gui/qt4/dialogs/messages.cpp
View file @
4f0c843d
...
...
@@ -76,90 +76,39 @@ MessagesDialog::MessagesDialog( intf_thread_t *_p_intf)
setWindowTitle
(
qtr
(
"Messages"
)
);
setWindowRole
(
"vlc-messages"
);
/* General widgets */
QGridLayout
*
mainLayout
=
new
QGridLayout
(
this
);
mainTab
=
new
QTabWidget
(
this
);
mainTab
->
setTabPosition
(
QTabWidget
::
North
);
/* Messages */
QWidget
*
msgWidget
=
new
QWidget
;
QGridLayout
*
msgLayout
=
new
QGridLayout
(
msgWidget
);
messages
=
new
QTextEdit
();
messages
->
setReadOnly
(
true
);
messages
->
setGeometry
(
0
,
0
,
440
,
600
);
messages
->
setHorizontalScrollBarPolicy
(
Qt
::
ScrollBarAlwaysOff
);
messages
->
setTextInteractionFlags
(
Qt
::
TextSelectableByMouse
);
msgLayout
->
addWidget
(
messages
,
0
,
0
,
1
,
0
);
mainTab
->
addTab
(
msgWidget
,
qtr
(
"Messages"
)
);
/* Build Ui */
ui
.
setupUi
(
this
);
updateTree
();
/* Modules tree */
QWidget
*
treeWidget
=
new
QWidget
;
QGridLayout
*
treeLayout
=
new
QGridLayout
(
treeWidget
);
modulesTree
=
new
QTreeWidget
();
modulesTree
->
header
()
->
hide
();
treeLayout
->
addWidget
(
modulesTree
,
0
,
0
,
1
,
0
);
mainTab
->
addTab
(
treeWidget
,
qtr
(
"Modules tree"
)
);
ui
.
modulesTree
->
header
()
->
hide
();
/* Buttons and general layout */
QPushButton
*
closeButton
=
new
QPushButton
(
qtr
(
"&Close"
)
);
closeButton
->
setDefault
(
true
);
clearUpdateButton
=
new
QPushButton
(
qtr
(
"C&lear"
)
);
saveLogButton
=
new
QPushButton
(
qtr
(
"&Save as..."
)
);
saveLogButton
->
setToolTip
(
qtr
(
"Saves all the displayed logs to a file"
)
);
verbosityBox
=
new
QSpinBox
();
verbosityBox
->
setRange
(
0
,
2
);
verbosityBox
->
setValue
(
var_InheritInteger
(
p_intf
,
"verbose"
)
);
verbosityBox
->
setWrapping
(
true
);
verbosityBox
->
setSizePolicy
(
QSizePolicy
::
Maximum
,
QSizePolicy
::
Fixed
);
ui
.
saveLogButton
->
setToolTip
(
qtr
(
"Saves all the displayed logs to a file"
)
);
verbosityLabel
=
new
QLabel
(
qtr
(
"Verbosity Level
"
)
);
ui
.
verbosityBox
->
setValue
(
var_InheritInteger
(
p_intf
,
"verbose
"
)
);
vbobjectsEdit
=
new
QLineEdit
();
vbobjectsEdit
->
setSizePolicy
(
QSizePolicy
::
Minimum
,
QSizePolicy
::
Fixed
);
vbobjectsEdit
->
setText
(
config_GetPsz
(
p_intf
,
"verbose-objects"
));
vbobjectsEdit
->
setToolTip
(
"verbose-objects usage:
\n
"
ui
.
vbobjectsEdit
->
setText
(
config_GetPsz
(
p_intf
,
"verbose-objects"
));
ui
.
vbobjectsEdit
->
setToolTip
(
"verbose-objects usage:
\n
"
"--verbose-objects=+printthatobject,-dontprintthatone
\n
"
"(keyword 'all' to applies to all objects)"
);
vbobjectsLabel
=
new
QLabel
(
qtr
(
"Filter:"
)
);
mainLayout
->
addWidget
(
mainTab
,
0
,
0
,
1
,
0
);
mainLayout
->
addWidget
(
verbosityLabel
,
1
,
0
,
1
,
1
);
mainLayout
->
addWidget
(
verbosityBox
,
1
,
1
);
mainLayout
->
addWidget
(
vbobjectsLabel
,
1
,
2
,
1
,
1
);
mainLayout
->
addWidget
(
vbobjectsEdit
,
1
,
3
);
mainLayout
->
setColumnStretch
(
4
,
10
);
mainLayout
->
addWidget
(
saveLogButton
,
1
,
5
);
mainLayout
->
addWidget
(
clearUpdateButton
,
1
,
6
);
mainLayout
->
addWidget
(
closeButton
,
1
,
7
);
BUTTONACT
(
closeButton
,
hide
()
);
BUTTONACT
(
clearUpdateButton
,
clearOrUpdate
()
);
BUTTONACT
(
saveLogButton
,
save
()
);
CONNECT
(
mainTab
,
currentChanged
(
int
),
this
,
updateTab
(
int
)
);
CONNECT
(
vbobjectsEdit
,
editingFinished
(),
this
,
updateConfig
());
CONNECT
(
verbosityBox
,
valueChanged
(
int
),
BUTTONACT
(
ui
.
clearButton
,
clear
()
);
BUTTONACT
(
ui
.
updateButton
,
updateTree
()
);
BUTTONACT
(
ui
.
saveLogButton
,
save
()
);
CONNECT
(
ui
.
vbobjectsEdit
,
editingFinished
(),
this
,
updateConfig
());
CONNECT
(
ui
.
bottomButtonsBox
,
rejected
(),
this
,
hide
()
);
CONNECT
(
ui
.
verbosityBox
,
valueChanged
(
int
),
this
,
changeVerbosity
(
int
)
);
/* General action */
readSettings
(
"Messages"
,
QSize
(
600
,
450
)
);
/* Hook up to LibVLC messaging */
cbData
=
new
msg_cb_data_t
;
cbData
->
self
=
this
;
sub
=
msg_Subscribe
(
p_intf
->
p_libvlc
,
MsgCallback
,
cbData
);
changeVerbosity
(
verbosityBox
->
value
()
);
changeVerbosity
(
ui
.
verbosityBox
->
value
()
);
}
MessagesDialog
::~
MessagesDialog
()
...
...
@@ -174,42 +123,17 @@ void MessagesDialog::changeVerbosity( int verbosity )
msg_SubscriptionSetVerbosity
(
sub
,
verbosity
);
}
void
MessagesDialog
::
updateTab
(
int
index
)
{
/* Second tab : modules tree */
if
(
index
==
1
)
{
verbosityLabel
->
hide
();
verbosityBox
->
hide
();
vbobjectsLabel
->
hide
();
vbobjectsEdit
->
hide
();
clearUpdateButton
->
setText
(
qtr
(
"&Update"
)
);
saveLogButton
->
hide
();
updateTree
();
}
/* First tab : messages */
else
{
verbosityLabel
->
show
();
verbosityBox
->
show
();
vbobjectsLabel
->
show
();
vbobjectsEdit
->
show
();
clearUpdateButton
->
setText
(
qtr
(
"&Clear"
)
);
saveLogButton
->
show
();
}
}
void
MessagesDialog
::
updateConfig
()
{
config_PutPsz
(
p_intf
,
"verbose-objects"
,
qtu
(
vbobjectsEdit
->
text
()));
config_PutPsz
(
p_intf
,
"verbose-objects"
,
qtu
(
ui
.
vbobjectsEdit
->
text
()));
//vbobjectsEdit->setText("vbEdit changed!");
if
(
!
vbobjectsEdit
->
text
().
isEmpty
()
)
if
(
!
ui
.
vbobjectsEdit
->
text
().
isEmpty
()
)
{
/* if user sets filter, go with the idea that user just wants that to be shown,
so disable all by default and enable those that user wants */
msg_DisableObjectPrinting
(
p_intf
,
"all"
);
char
*
psz_verbose_objects
=
strdup
(
qtu
(
vbobjectsEdit
->
text
()));
char
*
psz_verbose_objects
=
strdup
(
qtu
(
ui
.
vbobjectsEdit
->
text
()));
char
*
psz_object
,
*
iter
=
psz_verbose_objects
;
while
(
(
psz_object
=
strsep
(
&
iter
,
","
))
)
{
...
...
@@ -232,6 +156,7 @@ void MessagesDialog::updateConfig()
void
MessagesDialog
::
sinkMessage
(
msg_item_t
*
item
)
{
QTextEdit
*
messages
=
ui
.
messages
;
/* Only scroll if the viewport is at the end.
Don't bug user by auto-changing/loosing viewport on insert(). */
bool
b_autoscroll
=
(
messages
->
verticalScrollBar
()
->
value
()
...
...
@@ -288,17 +213,9 @@ void MessagesDialog::customEvent( QEvent *event )
sinkMessage
(
msge
->
msg
);
}
void
MessagesDialog
::
clearOrUpdate
()
{
if
(
mainTab
->
currentIndex
()
)
updateTree
();
else
clear
();
}
void
MessagesDialog
::
clear
()
{
messages
->
clear
();
ui
.
messages
->
clear
();
}
bool
MessagesDialog
::
save
()
...
...
@@ -320,7 +237,7 @@ bool MessagesDialog::save()
}
QTextStream
out
(
&
file
);
out
<<
messages
->
toPlainText
()
<<
"
\n
"
;
out
<<
ui
.
messages
->
toPlainText
()
<<
"
\n
"
;
return
true
;
}
...
...
@@ -335,7 +252,7 @@ void MessagesDialog::buildTree( QTreeWidgetItem *parentItem,
if
(
parentItem
)
item
=
new
QTreeWidgetItem
(
parentItem
);
else
item
=
new
QTreeWidgetItem
(
modulesTree
);
item
=
new
QTreeWidgetItem
(
ui
.
modulesTree
);
char
*
name
=
vlc_object_get_name
(
p_obj
);
if
(
name
!=
NULL
)
...
...
@@ -359,7 +276,7 @@ void MessagesDialog::buildTree( QTreeWidgetItem *parentItem,
void
MessagesDialog
::
updateTree
()
{
modulesTree
->
clear
();
ui
.
modulesTree
->
clear
();
buildTree
(
NULL
,
VLC_OBJECT
(
p_intf
->
p_libvlc
)
);
}
...
...
modules/gui/qt4/dialogs/messages.hpp
View file @
4f0c843d
...
...
@@ -26,6 +26,7 @@
#include "util/qvlcframe.hpp"
#include "util/singleton.hpp"
#include "ui/messages_panel.h"
class
QTabWidget
;
class
QPushButton
;
...
...
@@ -44,15 +45,7 @@ private:
MessagesDialog
(
intf_thread_t
*
);
virtual
~
MessagesDialog
();
QTabWidget
*
mainTab
;
QSpinBox
*
verbosityBox
;
QLabel
*
verbosityLabel
;
QTextEdit
*
messages
;
QTreeWidget
*
modulesTree
;
QPushButton
*
clearUpdateButton
;
QPushButton
*
saveLogButton
;
QLineEdit
*
vbobjectsEdit
;
QLabel
*
vbobjectsLabel
;
Ui
::
messagesPanelWidget
ui
;
msg_subscription_t
*
sub
;
msg_cb_data_t
*
cbData
;
static
void
sinkMessage
(
msg_cb_data_t
*
,
msg_item_t
*
,
unsigned
);
...
...
@@ -60,14 +53,12 @@ private:
void
sinkMessage
(
msg_item_t
*
item
);
private
slots
:
void
updateTab
(
int
);
void
clearOrUpdate
();
bool
save
();
void
updateConfig
();
void
changeVerbosity
(
int
);
private:
void
clear
();
void
updateTree
();
private:
void
buildTree
(
QTreeWidgetItem
*
,
vlc_object_t
*
);
friend
class
Singleton
<
MessagesDialog
>
;
...
...
modules/gui/qt4/ui/messages_panel.ui
0 → 100644
View file @
4f0c843d
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
messagesPanelWidget
</class>
<widget
class=
"QWidget"
name=
"messagesPanelWidget"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
570
</width>
<height>
440
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Messages
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_2"
>
<item>
<widget
class=
"QTabWidget"
name=
"mainTab"
>
<property
name=
"currentIndex"
>
<number>
0
</number>
</property>
<widget
class=
"QWidget"
name=
"tab"
>
<attribute
name=
"title"
>
<string>
Messages
</string>
</attribute>
<layout
class=
"QGridLayout"
name=
"msgLayout"
>
<item
row=
"0"
column=
"0"
colspan=
"6"
>
<widget
class=
"QTextEdit"
name=
"messages"
>
<property
name=
"horizontalScrollBarPolicy"
>
<enum>
Qt::ScrollBarAlwaysOff
</enum>
</property>
<property
name=
"readOnly"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
Verbosity:
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"5"
>
<widget
class=
"QPushButton"
name=
"clearButton"
>
<property
name=
"text"
>
<string>
&
Clear
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QSpinBox"
name=
"verbosityBox"
>
<property
name=
"wrapping"
>
<bool>
true
</bool>
</property>
<property
name=
"maximum"
>
<number>
2
</number>
</property>
</widget>
</item>
<item
row=
"1"
column=
"2"
>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
<string>
Filter:
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"3"
>
<widget
class=
"QLineEdit"
name=
"vbobjectsEdit"
/>
</item>
<item
row=
"1"
column=
"4"
>
<widget
class=
"QPushButton"
name=
"saveLogButton"
>
<property
name=
"text"
>
<string>
&
Save as...
</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget
class=
"QWidget"
name=
"tab_2"
>
<attribute
name=
"title"
>
<string>
Modules Tree
</string>
</attribute>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QTreeWidget"
name=
"modulesTree"
>
<column>
<property
name=
"text"
>
<string
notr=
"true"
>
1
</string>
</property>
</column>
</widget>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"updateButton"
>
<property
name=
"text"
>
<string>
&
Update
</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget
class=
"QDialogButtonBox"
name=
"bottomButtonsBox"
>
<property
name=
"standardButtons"
>
<set>
QDialogButtonBox::Close
</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
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