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
3ede77e4
Commit
3ede77e4
authored
Apr 29, 2007
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4 - Preferences. Implement the onUpdate for ModuleList.
parent
bee4d417
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
24 deletions
+55
-24
modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/preferences_widgets.cpp
+54
-23
modules/gui/qt4/components/preferences_widgets.hpp
modules/gui/qt4/components/preferences_widgets.hpp
+1
-1
No files found.
modules/gui/qt4/components/preferences_widgets.cpp
View file @
3ede77e4
...
@@ -51,6 +51,20 @@
...
@@ -51,6 +51,20 @@
#include <vlc_keys.h>
#include <vlc_keys.h>
QString
formatTooltip
(
const
QString
&
tooltip
)
{
QString
formatted
=
"<html><head><meta name=
\"
qrichtext
\"
content=
\"
1
\"
/><style type=
\"
text/css
\"
>"
" p, li { white-space: pre-wrap; } </style></head><body style=
\"
font-family:'Sans Serif';"
" font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;
\"
>"
"<p style=
\"
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; "
"-qt-block-indent:0; text-indent:0px;
\"
>"
+
tooltip
+
"</p></body></html>"
;
return
formatted
;
}
ConfigControl
*
ConfigControl
::
createControl
(
vlc_object_t
*
p_this
,
ConfigControl
*
ConfigControl
::
createControl
(
vlc_object_t
*
p_this
,
module_config_t
*
p_item
,
module_config_t
*
p_item
,
QWidget
*
parent
)
QWidget
*
parent
)
...
@@ -212,9 +226,9 @@ StringConfigControl::StringConfigControl( vlc_object_t *_p_this,
...
@@ -212,9 +226,9 @@ StringConfigControl::StringConfigControl( vlc_object_t *_p_this,
void
StringConfigControl
::
finish
()
void
StringConfigControl
::
finish
()
{
{
text
->
setText
(
qfu
(
p_item
->
value
.
psz
)
);
text
->
setText
(
qfu
(
p_item
->
value
.
psz
)
);
text
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
text
->
setToolTip
(
formatTooltip
(
qfu
(
p_item
->
psz_longtext
)
)
);
if
(
label
)
if
(
label
)
label
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
label
->
setToolTip
(
formatTooltip
(
qfu
(
p_item
->
psz_longtext
)
)
);
}
}
/*********** File **************/
/*********** File **************/
...
@@ -277,9 +291,9 @@ void FileConfigControl::updateField()
...
@@ -277,9 +291,9 @@ void FileConfigControl::updateField()
void
FileConfigControl
::
finish
()
void
FileConfigControl
::
finish
()
{
{
text
->
setText
(
qfu
(
p_item
->
value
.
psz
)
);
text
->
setText
(
qfu
(
p_item
->
value
.
psz
)
);
text
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
text
->
setToolTip
(
formatTooltip
(
qfu
(
p_item
->
psz_longtext
)
)
);
if
(
label
)
if
(
label
)
label
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
label
->
setToolTip
(
formatTooltip
(
qfu
(
p_item
->
psz_longtext
)
)
);
}
}
/********* String / Directory **********/
/********* String / Directory **********/
...
@@ -372,9 +386,9 @@ void StringListConfigControl::finish( bool bycat )
...
@@ -372,9 +386,9 @@ void StringListConfigControl::finish( bool bycat )
p_item
->
ppsz_list
[
i_index
]
)
)
p_item
->
ppsz_list
[
i_index
]
)
)
combo
->
setCurrentIndex
(
combo
->
count
()
-
1
);
combo
->
setCurrentIndex
(
combo
->
count
()
-
1
);
}
}
combo
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
combo
->
setToolTip
(
formatTooltip
(
qfu
(
p_item
->
psz_longtext
)
)
);
if
(
label
)
if
(
label
)
label
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
label
->
setToolTip
(
formatTooltip
(
qfu
(
p_item
->
psz_longtext
)
)
);
}
}
QString
StringListConfigControl
::
getValue
()
QString
StringListConfigControl
::
getValue
()
...
@@ -453,9 +467,9 @@ void ModuleConfigControl::finish( bool bycat )
...
@@ -453,9 +467,9 @@ void ModuleConfigControl::finish( bool bycat )
}
}
}
}
vlc_list_release
(
p_list
);
vlc_list_release
(
p_list
);
combo
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
combo
->
setToolTip
(
formatTooltip
(
qfu
(
p_item
->
psz_longtext
)
)
);
if
(
label
)
if
(
label
)
label
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
label
->
setToolTip
(
formatTooltip
(
qfu
(
p_item
->
psz_longtext
)
)
);
}
}
QString
ModuleConfigControl
::
getValue
()
QString
ModuleConfigControl
::
getValue
()
...
@@ -540,7 +554,9 @@ void ModuleListConfigControl::finish( bool bycat )
...
@@ -540,7 +554,9 @@ void ModuleListConfigControl::finish( bool bycat )
{
{
QCheckBox
*
cb
=
QCheckBox
*
cb
=
new
QCheckBox
(
qfu
(
p_parser
->
psz_object_name
)
);
new
QCheckBox
(
qfu
(
p_parser
->
psz_object_name
)
);
cb
->
setToolTip
(
qfu
(
p_parser
->
psz_longname
)
);
CONNECT
(
cb
,
stateChanged
(
int
),
this
,
onUpdate
(
int
)
);
cb
->
setToolTip
(
formatTooltip
(
qfu
(
p_parser
->
psz_longname
))
);
modules
.
push_back
(
cb
);
modules
.
push_back
(
cb
);
}
}
}
}
...
@@ -549,14 +565,15 @@ void ModuleListConfigControl::finish( bool bycat )
...
@@ -549,14 +565,15 @@ void ModuleListConfigControl::finish( bool bycat )
{
{
QCheckBox
*
cb
=
QCheckBox
*
cb
=
new
QCheckBox
(
qfu
(
p_parser
->
psz_object_name
)
);
new
QCheckBox
(
qfu
(
p_parser
->
psz_object_name
)
);
cb
->
setToolTip
(
qfu
(
p_parser
->
psz_longname
)
);
CONNECT
(
cb
,
stateChanged
(
int
),
this
,
onUpdate
(
int
)
);
cb
->
setToolTip
(
formatTooltip
(
qfu
(
p_parser
->
psz_longname
))
);
modules
.
push_back
(
cb
);
modules
.
push_back
(
cb
);
}
}
}
}
vlc_list_release
(
p_list
);
vlc_list_release
(
p_list
);
text
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
text
->
setToolTip
(
formatTooltip
(
qfu
(
p_item
->
psz_longtext
)
)
);
if
(
groupBox
)
if
(
groupBox
)
groupBox
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
groupBox
->
setToolTip
(
formatTooltip
(
qfu
(
p_item
->
psz_longtext
)
)
);
}
}
QString
ModuleListConfigControl
::
getValue
()
QString
ModuleListConfigControl
::
getValue
()
...
@@ -585,12 +602,26 @@ void ModuleListConfigControl::show()
...
@@ -585,12 +602,26 @@ void ModuleListConfigControl::show()
}
}
void
ModuleListConfigControl
::
wakeUp_TheUserJustClickedOnSomething
(
int
value
)
void
ModuleListConfigControl
::
onUpdate
(
int
value
)
{
{
text
->
clear
();
text
->
clear
();
bool
first
=
true
;
for
(
QVector
<
QCheckBox
*>::
iterator
it
=
modules
.
begin
();
for
(
QVector
<
QCheckBox
*>::
iterator
it
=
modules
.
begin
();
it
!=
modules
.
end
();
it
++
)
it
!=
modules
.
end
();
it
++
)
{
{
if
(
(
*
it
)
->
isChecked
()
)
{
if
(
first
)
{
text
->
setText
(
text
->
text
()
+
(
*
it
)
->
text
()
);
first
=
false
;
}
else
{
text
->
setText
(
text
->
text
()
+
":"
+
(
*
it
)
->
text
()
);
}
}
}
}
}
}
...
@@ -638,9 +669,9 @@ void IntegerConfigControl::finish()
...
@@ -638,9 +669,9 @@ void IntegerConfigControl::finish()
spin
->
setMaximum
(
2000000000
);
spin
->
setMaximum
(
2000000000
);
spin
->
setMinimum
(
-
2000000000
);
spin
->
setMinimum
(
-
2000000000
);
spin
->
setValue
(
p_item
->
value
.
i
);
spin
->
setValue
(
p_item
->
value
.
i
);
spin
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
spin
->
setToolTip
(
formatTooltip
(
qfu
(
p_item
->
psz_longtext
)
)
);
if
(
label
)
if
(
label
)
label
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
label
->
setToolTip
(
formatTooltip
(
qfu
(
p_item
->
psz_longtext
)
)
);
}
}
int
IntegerConfigControl
::
getValue
()
int
IntegerConfigControl
::
getValue
()
...
@@ -683,9 +714,9 @@ IntegerRangeSliderConfigControl::IntegerRangeSliderConfigControl(
...
@@ -683,9 +714,9 @@ IntegerRangeSliderConfigControl::IntegerRangeSliderConfigControl(
slider
->
setMaximum
(
p_item
->
max
.
i
);
slider
->
setMaximum
(
p_item
->
max
.
i
);
slider
->
setMinimum
(
p_item
->
min
.
i
);
slider
->
setMinimum
(
p_item
->
min
.
i
);
slider
->
setValue
(
p_item
->
value
.
i
);
slider
->
setValue
(
p_item
->
value
.
i
);
slider
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
slider
->
setToolTip
(
formatTooltip
(
qfu
(
p_item
->
psz_longtext
)
)
);
if
(
label
)
if
(
label
)
label
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
label
->
setToolTip
(
formatTooltip
(
qfu
(
p_item
->
psz_longtext
)
)
);
}
}
int
IntegerRangeSliderConfigControl
::
getValue
()
int
IntegerRangeSliderConfigControl
::
getValue
()
...
@@ -735,9 +766,9 @@ void IntegerListConfigControl::finish( bool bycat )
...
@@ -735,9 +766,9 @@ void IntegerListConfigControl::finish( bool bycat )
if
(
p_item
->
value
.
i
==
p_item
->
pi_list
[
i_index
]
)
if
(
p_item
->
value
.
i
==
p_item
->
pi_list
[
i_index
]
)
combo
->
setCurrentIndex
(
combo
->
count
()
-
1
);
combo
->
setCurrentIndex
(
combo
->
count
()
-
1
);
}
}
combo
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
combo
->
setToolTip
(
formatTooltip
(
qfu
(
p_item
->
psz_longtext
)
)
);
if
(
label
)
if
(
label
)
label
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
label
->
setToolTip
(
formatTooltip
(
qfu
(
p_item
->
psz_longtext
)
)
);
}
}
int
IntegerListConfigControl
::
getValue
()
int
IntegerListConfigControl
::
getValue
()
...
@@ -781,7 +812,7 @@ void BoolConfigControl::finish()
...
@@ -781,7 +812,7 @@ void BoolConfigControl::finish()
{
{
checkbox
->
setCheckState
(
p_item
->
value
.
i
==
VLC_TRUE
?
Qt
::
Checked
checkbox
->
setCheckState
(
p_item
->
value
.
i
==
VLC_TRUE
?
Qt
::
Checked
:
Qt
::
Unchecked
);
:
Qt
::
Unchecked
);
checkbox
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
checkbox
->
setToolTip
(
formatTooltip
(
qfu
(
p_item
->
psz_longtext
)
)
);
}
}
int
BoolConfigControl
::
getValue
()
int
BoolConfigControl
::
getValue
()
...
@@ -836,9 +867,9 @@ void FloatConfigControl::finish()
...
@@ -836,9 +867,9 @@ void FloatConfigControl::finish()
spin
->
setMinimum
(
-
2000000000.
);
spin
->
setMinimum
(
-
2000000000.
);
spin
->
setSingleStep
(
0.1
);
spin
->
setSingleStep
(
0.1
);
spin
->
setValue
(
(
double
)
p_item
->
value
.
f
);
spin
->
setValue
(
(
double
)
p_item
->
value
.
f
);
spin
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
spin
->
setToolTip
(
formatTooltip
(
qfu
(
p_item
->
psz_longtext
)
)
);
if
(
label
)
if
(
label
)
label
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
label
->
setToolTip
(
formatTooltip
(
qfu
(
p_item
->
psz_longtext
)
)
);
}
}
float
FloatConfigControl
::
getValue
()
float
FloatConfigControl
::
getValue
()
...
@@ -902,7 +933,7 @@ KeySelectorControl::KeySelectorControl( vlc_object_t *_p_this,
...
@@ -902,7 +933,7 @@ KeySelectorControl::KeySelectorControl( vlc_object_t *_p_this,
void
KeySelectorControl
::
finish
()
void
KeySelectorControl
::
finish
()
{
{
if
(
label
)
if
(
label
)
label
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
label
->
setToolTip
(
formatTooltip
(
qfu
(
p_item
->
psz_longtext
)
)
);
/* Fill the table */
/* Fill the table */
table
->
setColumnCount
(
2
);
table
->
setColumnCount
(
2
);
...
...
modules/gui/qt4/components/preferences_widgets.hpp
View file @
3ede77e4
...
@@ -339,7 +339,7 @@ public:
...
@@ -339,7 +339,7 @@ public:
virtual
void
hide
();
virtual
void
hide
();
virtual
void
show
();
virtual
void
show
();
public
slots
:
public
slots
:
void
wakeUp_TheUserJustClickedOnSomething
(
int
value
);
void
onUpdate
(
int
value
);
private:
private:
void
finish
(
bool
);
void
finish
(
bool
);
QVector
<
QCheckBox
*>
modules
;
QVector
<
QCheckBox
*>
modules
;
...
...
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