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
93ec3e57
Commit
93ec3e57
authored
Nov 22, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Partial compilation fix
parent
fcf49602
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
74 deletions
+72
-74
modules/gui/qt4/components/preferences.cpp
modules/gui/qt4/components/preferences.cpp
+38
-41
modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/preferences_widgets.cpp
+34
-33
No files found.
modules/gui/qt4/components/preferences.cpp
View file @
93ec3e57
...
@@ -77,44 +77,42 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
...
@@ -77,44 +77,42 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
#undef BI
#undef BI
/* Build the tree for the main module */
/* Build the tree for the main module */
int
i_index
;
module_t
*
p_module
=
NULL
;
module_t
*
p_module
;
vlc_list_t
*
p_list
=
vlc_list_find
(
p_intf
,
VLC_OBJECT_MODULE
,
vlc_list_t
*
p_list
=
vlc_list_find
(
p_intf
,
VLC_OBJECT_MODULE
,
FIND_ANYWHERE
);
FIND_ANYWHERE
);
bool
found
=
true
;
if
(
!
p_list
)
return
;
if
(
!
p_list
)
return
;
for
(
i
_index
=
0
;
i_index
<
p_list
->
i_count
;
i_index
++
)
for
(
i
nt
i_index
=
0
;
p_module
==
NULL
;
i_index
++
)
{
{
assert
(
i_index
<
p_list
->
i_count
);
p_module
=
(
module_t
*
)
p_list
->
p_values
[
i_index
].
p_object
;
p_module
=
(
module_t
*
)
p_list
->
p_values
[
i_index
].
p_object
;
if
(
!
strcmp
(
p_module
->
psz_object_name
,
"main"
)
)
{
if
(
strcmp
(
p_module
->
psz_object_name
,
"main"
)
)
found
=
true
;
break
;
p_module
=
NULL
;
}
}
}
assert
(
found
);
module_config_t
*
p_item
=
p_module
->
p_config
;
PrefsItemData
*
data
=
NULL
;
PrefsItemData
*
data
=
NULL
;
QTreeWidgetItem
*
current_item
=
NULL
;
QTreeWidgetItem
*
current_item
=
NULL
;
if
(
p_item
)
do
for
(
size_t
i
=
0
;
i
<
p_module
->
confsize
;
i
++
)
{
{
module_config_t
*
p_item
=
p_module
->
p_config
+
i
;
char
*
psz_help
;
char
*
psz_help
;
QIcon
icon
;
QIcon
icon
;
switch
(
p_item
->
i_type
)
switch
(
p_item
->
i_type
)
{
{
case
CONFIG_CATEGORY
:
case
CONFIG_CATEGORY
:
if
(
p_item
->
i_value
==
-
1
)
break
;
if
(
p_item
->
value
.
i
==
-
1
)
break
;
data
=
new
PrefsItemData
();
data
=
new
PrefsItemData
();
data
->
name
=
QString
(
qfu
(
config_CategoryNameGet
data
->
name
=
QString
(
qfu
(
config_CategoryNameGet
(
p_item
->
i_value
)
)
);
(
p_item
->
value
.
i
)
)
);
psz_help
=
config_CategoryHelpGet
(
p_item
->
i_value
);
psz_help
=
config_CategoryHelpGet
(
p_item
->
value
.
i
);
if
(
psz_help
)
if
(
psz_help
)
data
->
help
=
QString
(
qfu
(
psz_help
)
);
data
->
help
=
QString
(
qfu
(
psz_help
)
);
else
else
data
->
help
.
clear
();
data
->
help
.
clear
();
data
->
i_type
=
TYPE_CATEGORY
;
data
->
i_type
=
TYPE_CATEGORY
;
data
->
i_object_id
=
p_item
->
i_value
;
data
->
i_object_id
=
p_item
->
value
.
i
;
switch
(
p_item
->
i_value
)
switch
(
p_item
->
value
.
i
)
{
{
#define CI(a,b) case a: icon = b##_icon;break
#define CI(a,b) case a: icon = b##_icon;break
CI
(
CAT_AUDIO
,
audio
);
CI
(
CAT_AUDIO
,
audio
);
...
@@ -135,22 +133,22 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
...
@@ -135,22 +133,22 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
addTopLevelItem
(
current_item
);
addTopLevelItem
(
current_item
);
break
;
break
;
case
CONFIG_SUBCATEGORY
:
case
CONFIG_SUBCATEGORY
:
if
(
p_item
->
i_value
==
-
1
)
break
;
if
(
p_item
->
value
.
i
==
-
1
)
break
;
if
(
data
&&
if
(
data
&&
(
p_item
->
i_value
==
SUBCAT_VIDEO_GENERAL
||
(
p_item
->
value
.
i
==
SUBCAT_VIDEO_GENERAL
||
p_item
->
i_value
==
SUBCAT_ADVANCED_MISC
||
p_item
->
value
.
i
==
SUBCAT_ADVANCED_MISC
||
p_item
->
i_value
==
SUBCAT_INPUT_GENERAL
||
p_item
->
value
.
i
==
SUBCAT_INPUT_GENERAL
||
p_item
->
i_value
==
SUBCAT_INTERFACE_GENERAL
||
p_item
->
value
.
i
==
SUBCAT_INTERFACE_GENERAL
||
p_item
->
i_value
==
SUBCAT_SOUT_GENERAL
||
p_item
->
value
.
i
==
SUBCAT_SOUT_GENERAL
||
p_item
->
i_value
==
SUBCAT_PLAYLIST_GENERAL
||
p_item
->
value
.
i
==
SUBCAT_PLAYLIST_GENERAL
||
p_item
->
i_value
==
SUBCAT_AUDIO_GENERAL
)
)
p_item
->
value
.
i
==
SUBCAT_AUDIO_GENERAL
)
)
{
{
// Data still contains the correct thing
// Data still contains the correct thing
data
->
i_type
=
TYPE_CATSUBCAT
;
data
->
i_type
=
TYPE_CATSUBCAT
;
data
->
i_subcat_id
=
p_item
->
i_value
;
data
->
i_subcat_id
=
p_item
->
value
.
i
;
data
->
name
=
QString
(
qfu
(
config_CategoryNameGet
(
data
->
name
=
QString
(
qfu
(
config_CategoryNameGet
(
p_item
->
i_value
))
);
p_item
->
value
.
i
))
);
psz_help
=
config_CategoryHelpGet
(
p_item
->
i_value
);
psz_help
=
config_CategoryHelpGet
(
p_item
->
value
.
i
);
if
(
psz_help
)
if
(
psz_help
)
data
->
help
=
QString
(
qfu
(
psz_help
)
);
data
->
help
=
QString
(
qfu
(
psz_help
)
);
else
else
...
@@ -161,14 +159,14 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
...
@@ -161,14 +159,14 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
}
}
data
=
new
PrefsItemData
();
data
=
new
PrefsItemData
();
data
->
name
=
QString
(
qfu
(
config_CategoryNameGet
(
data
->
name
=
QString
(
qfu
(
config_CategoryNameGet
(
p_item
->
i_value
))
);
p_item
->
value
.
i
))
);
psz_help
=
config_CategoryHelpGet
(
p_item
->
i_value
);
psz_help
=
config_CategoryHelpGet
(
p_item
->
value
.
i
);
if
(
psz_help
)
if
(
psz_help
)
data
->
help
=
QString
(
qfu
(
psz_help
)
);
data
->
help
=
QString
(
qfu
(
psz_help
)
);
else
else
data
->
help
.
clear
();
data
->
help
.
clear
();
data
->
i_type
=
TYPE_SUBCATEGORY
;
data
->
i_type
=
TYPE_SUBCATEGORY
;
data
->
i_object_id
=
p_item
->
i_value
;
data
->
i_object_id
=
p_item
->
value
.
i
;
assert
(
current_item
);
assert
(
current_item
);
...
@@ -182,12 +180,11 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
...
@@ -182,12 +180,11 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
current_item
->
addChild
(
subcat_item
);
current_item
->
addChild
(
subcat_item
);
break
;
break
;
}
}
}
while
(
p_item
->
i_type
!=
CONFIG_HINT_END
&&
p_item
++
);
}
/* Build the tree of plugins */
/* Build the tree of plugins */
for
(
int
i_index
=
0
;
i_index
<
p_list
->
i_count
;
i_index
++
)
for
(
int
i_index
=
0
;
i_index
<
p_list
->
i_count
;
i_index
++
)
{
{
module_config_t
*
p_item
;
int
i_subcategory
=
-
1
,
i_category
=
-
1
,
i_options
=
0
;
int
i_subcategory
=
-
1
,
i_category
=
-
1
,
i_options
=
0
;
p_module
=
(
module_t
*
)
p_list
->
p_values
[
i_index
].
p_object
;
p_module
=
(
module_t
*
)
p_list
->
p_values
[
i_index
].
p_object
;
...
@@ -198,20 +195,20 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
...
@@ -198,20 +195,20 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
* are stored in the parent module) */
* are stored in the parent module) */
if
(
p_module
->
b_submodule
)
continue
;
if
(
p_module
->
b_submodule
)
continue
;
p_item
=
p_module
->
p_config
;
for
(
size_t
i
=
0
;
i
<
p_module
->
confsize
;
i
++
)
if
(
!
p_item
)
continue
;
{
module_config_t
*
p_item
=
p_module
->
p_config
+
i
;
do
{
if
(
p_item
->
i_type
==
CONFIG_CATEGORY
)
if
(
p_item
->
i_type
==
CONFIG_CATEGORY
)
i_category
=
p_item
->
i_value
;
i_category
=
p_item
->
value
.
i
;
else
if
(
p_item
->
i_type
==
CONFIG_SUBCATEGORY
)
else
if
(
p_item
->
i_type
==
CONFIG_SUBCATEGORY
)
i_subcategory
=
p_item
->
i_value
;
i_subcategory
=
p_item
->
value
.
i
;
if
(
p_item
->
i_type
&
CONFIG_ITEM
)
if
(
p_item
->
i_type
&
CONFIG_ITEM
)
i_options
++
;
i_options
++
;
if
(
i_options
>
0
&&
i_category
>=
0
&&
i_subcategory
>=
0
)
if
(
i_options
>
0
&&
i_category
>=
0
&&
i_subcategory
>=
0
)
break
;
break
;
}
while
(
p_item
->
i_type
!=
CONFIG_HINT_END
&&
p_item
++
);
}
if
(
!
i_options
)
continue
;
// Nothing to display
if
(
!
i_options
)
continue
;
// Nothing to display
...
@@ -365,9 +362,9 @@ PrefsPanel::PrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
...
@@ -365,9 +362,9 @@ PrefsPanel::PrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
{
{
if
(
p_item
->
i_type
==
CONFIG_SUBCATEGORY
&&
if
(
p_item
->
i_type
==
CONFIG_SUBCATEGORY
&&
(
data
->
i_type
==
TYPE_SUBCATEGORY
&&
(
data
->
i_type
==
TYPE_SUBCATEGORY
&&
p_item
->
i_value
==
data
->
i_object_id
)
||
p_item
->
value
.
i
==
data
->
i_object_id
)
||
(
data
->
i_type
==
TYPE_CATSUBCAT
&&
(
data
->
i_type
==
TYPE_CATSUBCAT
&&
p_item
->
i_value
==
data
->
i_subcat_id
)
)
p_item
->
value
.
i
==
data
->
i_subcat_id
)
)
break
;
break
;
if
(
p_item
->
i_type
==
CONFIG_HINT_END
)
break
;
if
(
p_item
->
i_type
==
CONFIG_HINT_END
)
break
;
}
while
(
p_item
++
);
}
while
(
p_item
++
);
...
@@ -415,9 +412,9 @@ PrefsPanel::PrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
...
@@ -415,9 +412,9 @@ PrefsPanel::PrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
if
(
p_item
)
do
if
(
p_item
)
do
{
{
if
(
(
(
data
->
i_type
==
TYPE_SUBCATEGORY
&&
if
(
(
(
data
->
i_type
==
TYPE_SUBCATEGORY
&&
p_item
->
i_value
!=
data
->
i_object_id
)
||
p_item
->
value
.
i
!=
data
->
i_object_id
)
||
(
data
->
i_type
==
TYPE_CATSUBCAT
&&
(
data
->
i_type
==
TYPE_CATSUBCAT
&&
p_item
->
i_value
!=
data
->
i_subcat_id
)
)
&&
p_item
->
value
.
i
!=
data
->
i_subcat_id
)
)
&&
(
p_item
->
i_type
==
CONFIG_CATEGORY
||
(
p_item
->
i_type
==
CONFIG_CATEGORY
||
p_item
->
i_type
==
CONFIG_SUBCATEGORY
)
)
p_item
->
i_type
==
CONFIG_SUBCATEGORY
)
)
break
;
break
;
...
...
modules/gui/qt4/components/preferences_widgets.cpp
View file @
93ec3e57
...
@@ -92,7 +92,7 @@ ConfigControl *ConfigControl::createControl( vlc_object_t *p_this,
...
@@ -92,7 +92,7 @@ ConfigControl *ConfigControl::createControl( vlc_object_t *p_this,
if
(
p_item
->
i_list
)
if
(
p_item
->
i_list
)
p_control
=
new
IntegerListConfigControl
(
p_this
,
p_item
,
p_control
=
new
IntegerListConfigControl
(
p_this
,
p_item
,
parent
,
false
,
l
,
line
);
parent
,
false
,
l
,
line
);
else
if
(
p_item
->
i_min
||
p_item
->
i_max
)
else
if
(
p_item
->
min
.
i
||
p_item
->
max
.
i
)
p_control
=
new
IntegerRangeConfigControl
(
p_this
,
p_item
,
parent
,
p_control
=
new
IntegerRangeConfigControl
(
p_this
,
p_item
,
parent
,
l
,
line
);
l
,
line
);
else
else
...
@@ -112,7 +112,7 @@ ConfigControl *ConfigControl::createControl( vlc_object_t *p_this,
...
@@ -112,7 +112,7 @@ ConfigControl *ConfigControl::createControl( vlc_object_t *p_this,
p_control
=
new
BoolConfigControl
(
p_this
,
p_item
,
parent
,
l
,
line
);
p_control
=
new
BoolConfigControl
(
p_this
,
p_item
,
parent
,
l
,
line
);
break
;
break
;
case
CONFIG_ITEM_FLOAT
:
case
CONFIG_ITEM_FLOAT
:
if
(
p_item
->
f_min
||
p_item
->
f_max
)
if
(
p_item
->
min
.
f
||
p_item
->
max
.
f
)
p_control
=
new
FloatRangeConfigControl
(
p_this
,
p_item
,
parent
,
p_control
=
new
FloatRangeConfigControl
(
p_this
,
p_item
,
parent
,
l
,
line
);
l
,
line
);
else
else
...
@@ -173,7 +173,7 @@ StringConfigControl::StringConfigControl( vlc_object_t *_p_this,
...
@@ -173,7 +173,7 @@ StringConfigControl::StringConfigControl( vlc_object_t *_p_this,
VStringConfigControl
(
_p_this
,
_p_item
,
_parent
)
VStringConfigControl
(
_p_this
,
_p_item
,
_parent
)
{
{
label
=
new
QLabel
(
qfu
(
p_item
->
psz_text
)
);
label
=
new
QLabel
(
qfu
(
p_item
->
psz_text
)
);
text
=
new
QLineEdit
(
qfu
(
p_item
->
psz_value
)
);
text
=
new
QLineEdit
(
qfu
(
p_item
->
value
.
psz
)
);
finish
();
finish
();
if
(
!
l
)
if
(
!
l
)
...
@@ -200,7 +200,7 @@ StringConfigControl::StringConfigControl( vlc_object_t *_p_this,
...
@@ -200,7 +200,7 @@ StringConfigControl::StringConfigControl( vlc_object_t *_p_this,
void
StringConfigControl
::
finish
()
void
StringConfigControl
::
finish
()
{
{
text
->
setText
(
qfu
(
p_item
->
psz_value
)
);
text
->
setText
(
qfu
(
p_item
->
value
.
psz
)
);
text
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
text
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
if
(
label
)
if
(
label
)
label
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
label
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
...
@@ -246,7 +246,7 @@ void StringListConfigControl::finish( bool bycat )
...
@@ -246,7 +246,7 @@ void StringListConfigControl::finish( bool bycat )
p_item
->
ppsz_list_text
[
i_index
]
:
p_item
->
ppsz_list_text
[
i_index
]
:
p_item
->
ppsz_list
[
i_index
]
),
p_item
->
ppsz_list
[
i_index
]
),
QVariant
(
p_item
->
ppsz_list
[
i_index
]
)
);
QVariant
(
p_item
->
ppsz_list
[
i_index
]
)
);
if
(
p_item
->
psz_value
&&
!
strcmp
(
p_item
->
psz_value
,
if
(
p_item
->
value
.
psz
&&
!
strcmp
(
p_item
->
value
.
psz
,
p_item
->
ppsz_list
[
i_index
]
)
)
p_item
->
ppsz_list
[
i_index
]
)
)
combo
->
setCurrentIndex
(
combo
->
count
()
-
1
);
combo
->
setCurrentIndex
(
combo
->
count
()
-
1
);
}
}
...
@@ -308,24 +308,24 @@ void ModuleConfigControl::finish( bool bycat )
...
@@ -308,24 +308,24 @@ void ModuleConfigControl::finish( bool bycat )
{
{
if
(
!
strcmp
(
p_parser
->
psz_object_name
,
"main"
)
)
continue
;
if
(
!
strcmp
(
p_parser
->
psz_object_name
,
"main"
)
)
continue
;
module_config_t
*
p_config
=
p_parser
->
p_config
;
for
(
size_t
i
=
0
;
i
<
p_parser
->
confsize
;
i
++
)
if
(
p_config
)
do
{
{
module_config_t
*
p_config
=
p_parser
->
p_config
+
i
;
/* Hack: required subcategory is stored in i_min */
/* Hack: required subcategory is stored in i_min */
if
(
p_config
->
i_type
==
CONFIG_SUBCATEGORY
&&
if
(
p_config
->
i_type
==
CONFIG_SUBCATEGORY
&&
p_config
->
i_value
==
p_item
->
i_min
)
p_config
->
value
.
i
==
p_item
->
min
.
i
)
combo
->
addItem
(
qfu
(
p_parser
->
psz_longname
),
combo
->
addItem
(
qfu
(
p_parser
->
psz_longname
),
QVariant
(
p_parser
->
psz_object_name
)
);
QVariant
(
p_parser
->
psz_object_name
)
);
if
(
p_item
->
psz_value
&&
!
strcmp
(
p_item
->
psz_value
,
if
(
p_item
->
value
.
psz
&&
!
strcmp
(
p_item
->
value
.
psz
,
p_parser
->
psz_object_name
)
)
p_parser
->
psz_object_name
)
)
combo
->
setCurrentIndex
(
combo
->
count
()
-
1
);
combo
->
setCurrentIndex
(
combo
->
count
()
-
1
);
}
while
(
p_config
->
i_type
!=
CONFIG_HINT_END
&&
p_config
++
);
}
}
}
else
if
(
!
strcmp
(
p_parser
->
psz_capability
,
p_item
->
psz_type
)
)
else
if
(
!
strcmp
(
p_parser
->
psz_capability
,
p_item
->
psz_type
)
)
{
{
combo
->
addItem
(
qfu
(
p_parser
->
psz_longname
),
combo
->
addItem
(
qfu
(
p_parser
->
psz_longname
),
QVariant
(
p_parser
->
psz_object_name
)
);
QVariant
(
p_parser
->
psz_object_name
)
);
if
(
p_item
->
psz_value
&&
!
strcmp
(
p_item
->
psz_value
,
if
(
p_item
->
value
.
psz
&&
!
strcmp
(
p_item
->
value
.
psz
,
p_parser
->
psz_object_name
)
)
p_parser
->
psz_object_name
)
)
combo
->
setCurrentIndex
(
combo
->
count
()
-
1
);
combo
->
setCurrentIndex
(
combo
->
count
()
-
1
);
}
}
...
@@ -405,19 +405,19 @@ void ModuleListConfigControl::finish( bool bycat )
...
@@ -405,19 +405,19 @@ void ModuleListConfigControl::finish( bool bycat )
{
{
if
(
!
strcmp
(
p_parser
->
psz_object_name
,
"main"
)
)
continue
;
if
(
!
strcmp
(
p_parser
->
psz_object_name
,
"main"
)
)
continue
;
module_config_t
*
p_config
=
p_parser
->
p_config
;
for
(
size_t
i
=
0
;
i
<
p_parser
->
confsize
;
i
++
)
if
(
p_config
)
do
{
{
module_config_t
*
p_config
=
p_parser
->
p_config
+
i
;
/* Hack: required subcategory is stored in i_min */
/* Hack: required subcategory is stored in i_min */
if
(
p_config
->
i_type
==
CONFIG_SUBCATEGORY
&&
if
(
p_config
->
i_type
==
CONFIG_SUBCATEGORY
&&
p_config
->
i_value
==
p_item
->
i_min
)
p_config
->
value
.
i
==
p_item
->
min
.
i
)
{
{
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
)
);
cb
->
setToolTip
(
qfu
(
p_parser
->
psz_longname
)
);
modules
.
push_back
(
cb
);
modules
.
push_back
(
cb
);
}
}
}
while
(
p_config
->
i_type
!=
CONFIG_HINT_END
&&
p_config
++
);
}
}
}
else
if
(
!
strcmp
(
p_parser
->
psz_capability
,
p_item
->
psz_type
)
)
else
if
(
!
strcmp
(
p_parser
->
psz_capability
,
p_item
->
psz_type
)
)
{
{
...
@@ -512,7 +512,7 @@ void IntegerConfigControl::finish()
...
@@ -512,7 +512,7 @@ void IntegerConfigControl::finish()
{
{
spin
->
setMaximum
(
2000000000
);
spin
->
setMaximum
(
2000000000
);
spin
->
setMinimum
(
-
2000000000
);
spin
->
setMinimum
(
-
2000000000
);
spin
->
setValue
(
p_item
->
i_value
);
spin
->
setValue
(
p_item
->
value
.
i
);
spin
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
spin
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
if
(
label
)
if
(
label
)
label
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
label
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
...
@@ -543,8 +543,8 @@ IntegerRangeConfigControl::IntegerRangeConfigControl( vlc_object_t *_p_this,
...
@@ -543,8 +543,8 @@ IntegerRangeConfigControl::IntegerRangeConfigControl( vlc_object_t *_p_this,
void
IntegerRangeConfigControl
::
finish
()
void
IntegerRangeConfigControl
::
finish
()
{
{
spin
->
setMaximum
(
p_item
->
i_max
);
spin
->
setMaximum
(
p_item
->
max
.
i
);
spin
->
setMinimum
(
p_item
->
i_min
);
spin
->
setMinimum
(
p_item
->
min
.
i
);
}
}
/********* Integer / choice list **********/
/********* Integer / choice list **********/
...
@@ -585,7 +585,7 @@ void IntegerListConfigControl::finish( bool bycat )
...
@@ -585,7 +585,7 @@ void IntegerListConfigControl::finish( bool bycat )
{
{
combo
->
addItem
(
qfu
(
p_item
->
ppsz_list_text
[
i_index
]
),
combo
->
addItem
(
qfu
(
p_item
->
ppsz_list_text
[
i_index
]
),
QVariant
(
p_item
->
pi_list
[
i_index
]
)
);
QVariant
(
p_item
->
pi_list
[
i_index
]
)
);
if
(
p_item
->
i_value
==
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
(
qfu
(
p_item
->
psz_longtext
)
);
...
@@ -632,7 +632,7 @@ BoolConfigControl::BoolConfigControl( vlc_object_t *_p_this,
...
@@ -632,7 +632,7 @@ BoolConfigControl::BoolConfigControl( vlc_object_t *_p_this,
void
BoolConfigControl
::
finish
()
void
BoolConfigControl
::
finish
()
{
{
checkbox
->
setCheckState
(
p_item
->
i_value
==
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
(
qfu
(
p_item
->
psz_longtext
)
);
}
}
...
@@ -687,7 +687,7 @@ void FloatConfigControl::finish()
...
@@ -687,7 +687,7 @@ void FloatConfigControl::finish()
spin
->
setMaximum
(
2000000000.
);
spin
->
setMaximum
(
2000000000.
);
spin
->
setMinimum
(
-
2000000000.
);
spin
->
setMinimum
(
-
2000000000.
);
spin
->
setSingleStep
(
0.1
);
spin
->
setSingleStep
(
0.1
);
spin
->
setValue
(
(
double
)
p_item
->
f_value
);
spin
->
setValue
(
(
double
)
p_item
->
value
.
f
);
spin
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
spin
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
if
(
label
)
if
(
label
)
label
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
label
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
...
@@ -719,8 +719,8 @@ FloatRangeConfigControl::FloatRangeConfigControl( vlc_object_t *_p_this,
...
@@ -719,8 +719,8 @@ FloatRangeConfigControl::FloatRangeConfigControl( vlc_object_t *_p_this,
void
FloatRangeConfigControl
::
finish
()
void
FloatRangeConfigControl
::
finish
()
{
{
spin
->
setMaximum
(
(
double
)
p_item
->
f_max
);
spin
->
setMaximum
(
(
double
)
p_item
->
max
.
f
);
spin
->
setMinimum
(
(
double
)
p_item
->
f_min
);
spin
->
setMinimum
(
(
double
)
p_item
->
min
.
f
);
}
}
...
@@ -762,22 +762,23 @@ void KeySelectorControl::finish()
...
@@ -762,22 +762,23 @@ void KeySelectorControl::finish()
module_t
*
p_main
=
config_FindModule
(
p_this
,
"main"
);
module_t
*
p_main
=
config_FindModule
(
p_this
,
"main"
);
assert
(
p_main
);
assert
(
p_main
);
module_config_t
*
p_item
=
p_main
->
p_config
;
if
(
p_item
)
do
for
(
size_t
i
=
0
;
i
<
p_main
->
confsize
;
i
++
)
{
{
module_config_t
*
p_item
=
p_main
->
p_config
+
i
;
if
(
p_item
->
i_type
&
CONFIG_ITEM
&&
p_item
->
psz_name
&&
if
(
p_item
->
i_type
&
CONFIG_ITEM
&&
p_item
->
psz_name
&&
strstr
(
p_item
->
psz_name
,
"key-"
)
)
strstr
(
p_item
->
psz_name
,
"key-"
)
)
{
{
QTreeWidgetItem
*
treeItem
=
new
QTreeWidgetItem
();
QTreeWidgetItem
*
treeItem
=
new
QTreeWidgetItem
();
treeItem
->
setText
(
0
,
qfu
(
p_item
->
psz_text
)
);
treeItem
->
setText
(
0
,
qfu
(
p_item
->
psz_text
)
);
treeItem
->
setText
(
1
,
VLCKeyToString
(
p_item
->
i_value
)
);
treeItem
->
setText
(
1
,
VLCKeyToString
(
p_item
->
value
.
i
)
);
treeItem
->
setData
(
0
,
Qt
::
UserRole
,
treeItem
->
setData
(
0
,
Qt
::
UserRole
,
QVariant
::
fromValue
(
(
void
*
)
p_item
)
);
QVariant
::
fromValue
(
(
void
*
)
p_item
)
);
values
+=
p_item
;
values
+=
p_item
;
table
->
addTopLevelItem
(
treeItem
);
table
->
addTopLevelItem
(
treeItem
);
}
}
}
while
(
p_item
->
i_type
!=
CONFIG_HINT_END
&&
p_item
++
);
}
table
->
resizeColumnToContents
(
0
);
table
->
resizeColumnToContents
(
0
);
CONNECT
(
table
,
itemDoubleClicked
(
QTreeWidgetItem
*
,
int
),
CONNECT
(
table
,
itemDoubleClicked
(
QTreeWidgetItem
*
,
int
),
...
@@ -793,7 +794,7 @@ void KeySelectorControl::selectKey( QTreeWidgetItem *keyItem )
...
@@ -793,7 +794,7 @@ void KeySelectorControl::selectKey( QTreeWidgetItem *keyItem )
d
->
exec
();
d
->
exec
();
if
(
d
->
result
()
==
QDialog
::
Accepted
)
if
(
d
->
result
()
==
QDialog
::
Accepted
)
{
{
p_keyItem
->
i_value
=
d
->
keyValue
;
p_keyItem
->
value
.
i
=
d
->
keyValue
;
if
(
d
->
conflicts
)
if
(
d
->
conflicts
)
{
{
for
(
int
i
=
0
;
i
<
table
->
topLevelItemCount
()
;
i
++
)
for
(
int
i
=
0
;
i
<
table
->
topLevelItemCount
()
;
i
++
)
...
@@ -801,11 +802,11 @@ void KeySelectorControl::selectKey( QTreeWidgetItem *keyItem )
...
@@ -801,11 +802,11 @@ void KeySelectorControl::selectKey( QTreeWidgetItem *keyItem )
QTreeWidgetItem
*
it
=
table
->
topLevelItem
(
i
);
QTreeWidgetItem
*
it
=
table
->
topLevelItem
(
i
);
module_config_t
*
p_item
=
static_cast
<
module_config_t
*>
module_config_t
*
p_item
=
static_cast
<
module_config_t
*>
(
it
->
data
(
0
,
Qt
::
UserRole
).
value
<
void
*>
());
(
it
->
data
(
0
,
Qt
::
UserRole
).
value
<
void
*>
());
it
->
setText
(
1
,
VLCKeyToString
(
p_item
->
i_value
)
);
it
->
setText
(
1
,
VLCKeyToString
(
p_item
->
value
.
i
)
);
}
}
}
}
else
else
keyItem
->
setText
(
1
,
VLCKeyToString
(
p_keyItem
->
i_value
)
);
keyItem
->
setText
(
1
,
VLCKeyToString
(
p_keyItem
->
value
.
i
)
);
}
}
delete
d
;
delete
d
;
}
}
...
@@ -814,7 +815,7 @@ void KeySelectorControl::doApply()
...
@@ -814,7 +815,7 @@ void KeySelectorControl::doApply()
{
{
foreach
(
module_config_t
*
p_current
,
values
)
foreach
(
module_config_t
*
p_current
,
values
)
{
{
config_PutInt
(
p_this
,
p_current
->
psz_name
,
p_current
->
i_value
);
config_PutInt
(
p_this
,
p_current
->
psz_name
,
p_current
->
value
.
i
);
}
}
}
}
...
@@ -855,10 +856,10 @@ void KeyInputDialog::keyPressEvent( QKeyEvent *e )
...
@@ -855,10 +856,10 @@ void KeyInputDialog::keyPressEvent( QKeyEvent *e )
module_config_t
*
p_current
=
NULL
;
module_config_t
*
p_current
=
NULL
;
foreach
(
p_current
,
values
)
foreach
(
p_current
,
values
)
{
{
if
(
p_current
->
i_value
==
i_vlck
&&
strcmp
(
p_current
->
psz_text
,
if
(
p_current
->
value
.
i
==
i_vlck
&&
strcmp
(
p_current
->
psz_text
,
keyToChange
)
)
keyToChange
)
)
{
{
p_current
->
i_value
=
0
;
p_current
->
value
.
i
=
0
;
conflicts
=
true
;
conflicts
=
true
;
break
;
break
;
}
}
...
...
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