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
d3f18b52
Commit
d3f18b52
authored
Apr 22, 2011
by
Hugo Beauzée-Luyssen
Committed by
Jean-Baptiste Kempf
Apr 22, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qt4: preferences_widget: Use inheritance instead of switch.
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
8d4f298b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
40 deletions
+24
-40
modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/preferences_widgets.cpp
+19
-38
modules/gui/qt4/components/preferences_widgets.hpp
modules/gui/qt4/components/preferences_widgets.hpp
+5
-2
No files found.
modules/gui/qt4/components/preferences_widgets.cpp
View file @
d3f18b52
...
...
@@ -162,43 +162,6 @@ ConfigControl *ConfigControl::createControl( vlc_object_t *p_this,
return
p_control
;
}
void
ConfigControl
::
doApply
(
intf_thread_t
*
p_intf
)
{
switch
(
getType
()
)
{
case
CONFIG_ITEM_INTEGER
:
case
CONFIG_ITEM_BOOL
:
{
VIntConfigControl
*
vicc
=
qobject_cast
<
VIntConfigControl
*>
(
this
);
assert
(
vicc
);
config_PutInt
(
p_intf
,
vicc
->
getName
(),
vicc
->
getValue
()
);
break
;
}
case
CONFIG_ITEM_FLOAT
:
{
VFloatConfigControl
*
vfcc
=
qobject_cast
<
VFloatConfigControl
*>
(
this
);
assert
(
vfcc
);
config_PutFloat
(
p_intf
,
vfcc
->
getName
(),
vfcc
->
getValue
()
);
break
;
}
case
CONFIG_ITEM_STRING
:
{
VStringConfigControl
*
vscc
=
qobject_cast
<
VStringConfigControl
*>
(
this
);
assert
(
vscc
);
config_PutPsz
(
p_intf
,
vscc
->
getName
(),
qtu
(
vscc
->
getValue
()
)
);
break
;
}
case
CONFIG_ITEM_KEY
:
{
KeySelectorControl
*
ksc
=
qobject_cast
<
KeySelectorControl
*>
(
this
);
assert
(
ksc
);
ksc
->
doApply
();
}
}
}
/*******************************************************
* Simple widgets
*******************************************************/
...
...
@@ -241,6 +204,12 @@ void InterfacePreviewWidget::setPreview( enum_style e_style )
* String-based controls
*************************************************************************/
void
VStringConfigControl
::
doApply
(
intf_thread_t
*
p_intf
)
{
config_PutPsz
(
p_intf
,
getName
(),
qtu
(
getValue
()
)
);
}
/*********** String **************/
StringConfigControl
::
StringConfigControl
(
vlc_object_t
*
_p_this
,
module_config_t
*
_p_item
,
...
...
@@ -844,6 +813,12 @@ void ModuleListConfigControl::onUpdate()
* Integer-based controls
*************************************************************************/
void
VIntConfigControl
::
doApply
(
intf_thread_t
*
p_intf
)
{
config_PutInt
(
p_intf
,
getName
(),
getValue
()
);
}
/*********** Integer **************/
IntegerConfigControl
::
IntegerConfigControl
(
vlc_object_t
*
_p_this
,
module_config_t
*
_p_item
,
...
...
@@ -1123,6 +1098,12 @@ int BoolConfigControl::getValue() const
* Float-based controls
*************************************************************************/
void
VFloatConfigControl
::
doApply
(
intf_thread_t
*
p_intf
)
{
config_PutFloat
(
p_intf
,
getName
(),
getValue
()
);
}
/*********** Float **************/
FloatConfigControl
::
FloatConfigControl
(
vlc_object_t
*
_p_this
,
module_config_t
*
_p_item
,
...
...
@@ -1416,7 +1397,7 @@ void KeySelectorControl::setTheKey()
Qt
::
UserRole
,
shortcutValue
->
getValue
()
);
}
void
KeySelectorControl
::
doApply
()
void
KeySelectorControl
::
doApply
(
intf_thread_t
*
)
{
QTreeWidgetItem
*
it
;
for
(
int
i
=
0
;
i
<
table
->
topLevelItemCount
()
;
i
++
)
...
...
modules/gui/qt4/components/preferences_widgets.hpp
View file @
d3f18b52
...
...
@@ -101,7 +101,7 @@ public:
static
ConfigControl
*
createControl
(
vlc_object_t
*
,
module_config_t
*
,
QWidget
*
,
QGridLayout
*
,
int
&
);
v
oid
doApply
(
intf_thread_t
*
)
;
v
irtual
void
doApply
(
intf_thread_t
*
)
=
0
;
protected:
vlc_object_t
*
p_this
;
module_config_t
*
p_item
;
...
...
@@ -127,6 +127,7 @@ public:
ConfigControl
(
a
,
b
)
{};
virtual
int
getValue
()
const
=
0
;
virtual
int
getType
()
const
{
return
CONFIG_ITEM_INTEGER
;
}
virtual
void
doApply
(
intf_thread_t
*
);
};
class
IntegerConfigControl
:
public
VIntConfigControl
...
...
@@ -223,6 +224,7 @@ public:
ConfigControl
(
a
,
b
)
{};
virtual
float
getValue
()
const
=
0
;
virtual
int
getType
()
const
{
return
CONFIG_ITEM_FLOAT
;
}
virtual
void
doApply
(
intf_thread_t
*
);
};
class
FloatConfigControl
:
public
VFloatConfigControl
...
...
@@ -270,6 +272,7 @@ public:
ConfigControl
(
a
,
b
)
{};
virtual
QString
getValue
()
const
=
0
;
virtual
int
getType
()
const
{
return
CONFIG_ITEM_STRING
;
}
virtual
void
doApply
(
intf_thread_t
*
);
};
class
StringConfigControl
:
public
VStringConfigControl
...
...
@@ -454,7 +457,7 @@ public:
virtual
int
getType
()
const
{
return
CONFIG_ITEM_KEY
;
}
virtual
void
hide
()
{
table
->
hide
();
if
(
label
)
label
->
hide
();
}
virtual
void
show
()
{
table
->
show
();
if
(
label
)
label
->
show
();
}
v
oid
doApply
(
);
v
irtual
void
doApply
(
intf_thread_t
*
);
private:
void
finish
();
QLabel
*
label
;
...
...
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