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
a4989d74
Commit
a4989d74
authored
Aug 27, 2006
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Float, Float with range and Integer with range widgets.
parent
7cf4df92
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
158 additions
and
4 deletions
+158
-4
modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/preferences_widgets.cpp
+112
-3
modules/gui/qt4/components/preferences_widgets.hpp
modules/gui/qt4/components/preferences_widgets.hpp
+46
-1
No files found.
modules/gui/qt4/components/preferences_widgets.cpp
View file @
a4989d74
...
...
@@ -79,7 +79,8 @@ ConfigControl *ConfigControl::createControl( vlc_object_t *p_this,
p_control
=
new
IntegerListConfigControl
(
p_this
,
p_item
,
parent
,
false
,
l
,
line
);
else
if
(
p_item
->
i_min
||
p_item
->
i_max
)
fprintf
(
stderr
,
"Todo
\n
"
);
p_control
=
new
IntegerRangeConfigControl
(
p_this
,
p_item
,
parent
,
l
,
line
);
else
p_control
=
new
IntegerConfigControl
(
p_this
,
p_item
,
parent
,
l
,
line
);
...
...
@@ -92,9 +93,11 @@ ConfigControl *ConfigControl::createControl( vlc_object_t *p_this,
break
;
case
CONFIG_ITEM_FLOAT
:
if
(
p_item
->
f_min
||
p_item
->
f_max
)
fprintf
(
stderr
,
"Todo
\n
"
);
p_control
=
new
FloatRangeConfigControl
(
p_this
,
p_item
,
parent
,
l
,
line
);
else
fprintf
(
stderr
,
"Todo
\n
"
);
p_control
=
new
FloatConfigControl
(
p_this
,
p_item
,
parent
,
l
,
line
);
break
;
default:
break
;
...
...
@@ -323,6 +326,7 @@ IntegerConfigControl::IntegerConfigControl( vlc_object_t *_p_this,
void
IntegerConfigControl
::
finish
()
{
spin
->
setMaximum
(
2000000000
);
spin
->
setMinimum
(
-
2000000000
);
spin
->
setValue
(
p_item
->
i_value
);
spin
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
if
(
label
)
...
...
@@ -334,6 +338,30 @@ int IntegerConfigControl::getValue()
return
spin
->
value
();
}
/********* Integer range **********/
IntegerRangeConfigControl
::
IntegerRangeConfigControl
(
vlc_object_t
*
_p_this
,
module_config_t
*
_p_item
,
QWidget
*
_parent
,
QGridLayout
*
l
,
int
line
)
:
IntegerConfigControl
(
_p_this
,
_p_item
,
_parent
,
l
,
line
)
{
finish
();
}
IntegerRangeConfigControl
::
IntegerRangeConfigControl
(
vlc_object_t
*
_p_this
,
module_config_t
*
_p_item
,
QLabel
*
_label
,
QSpinBox
*
_spin
)
:
IntegerConfigControl
(
_p_this
,
_p_item
,
_label
,
_spin
)
{
finish
();
}
void
IntegerRangeConfigControl
::
finish
()
{
spin
->
setMaximum
(
p_item
->
i_max
);
spin
->
setMinimum
(
p_item
->
i_min
);
}
/********* Integer / choice list **********/
IntegerListConfigControl
::
IntegerListConfigControl
(
vlc_object_t
*
_p_this
,
module_config_t
*
_p_item
,
QWidget
*
_parent
,
bool
bycat
,
...
...
@@ -428,3 +456,84 @@ int BoolConfigControl::getValue()
{
return
checkbox
->
checkState
()
==
Qt
::
Checked
?
VLC_TRUE
:
VLC_FALSE
;
}
/**************************************************************************
* Float-based controls
*************************************************************************/
/*********** Float **************/
FloatConfigControl
::
FloatConfigControl
(
vlc_object_t
*
_p_this
,
module_config_t
*
_p_item
,
QWidget
*
_parent
,
QGridLayout
*
l
,
int
line
)
:
VFloatConfigControl
(
_p_this
,
_p_item
,
_parent
)
{
label
=
new
QLabel
(
qfu
(
p_item
->
psz_text
)
);
spin
=
new
QDoubleSpinBox
;
spin
->
setMinimumWidth
(
80
);
spin
->
setMaximumWidth
(
90
);
finish
();
if
(
!
l
)
{
QHBoxLayout
*
layout
=
new
QHBoxLayout
();
layout
->
addWidget
(
label
,
0
);
layout
->
addWidget
(
spin
,
1
);
widget
->
setLayout
(
layout
);
}
else
{
l
->
addWidget
(
label
,
line
,
0
);
l
->
addWidget
(
spin
,
line
,
1
,
Qt
::
AlignRight
);
}
}
FloatConfigControl
::
FloatConfigControl
(
vlc_object_t
*
_p_this
,
module_config_t
*
_p_item
,
QLabel
*
_label
,
QDoubleSpinBox
*
_spin
)
:
VFloatConfigControl
(
_p_this
,
_p_item
)
{
spin
=
_spin
;
label
=
_label
;
finish
();
}
void
FloatConfigControl
::
finish
()
{
spin
->
setMaximum
(
2000000000.
);
spin
->
setMinimum
(
-
2000000000.
);
spin
->
setSingleStep
(
0.1
);
spin
->
setValue
(
(
double
)
p_item
->
f_value
);
spin
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
if
(
label
)
label
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
}
float
FloatConfigControl
::
getValue
()
{
return
(
float
)
spin
->
value
();
}
/*********** Float with range **************/
FloatRangeConfigControl
::
FloatRangeConfigControl
(
vlc_object_t
*
_p_this
,
module_config_t
*
_p_item
,
QWidget
*
_parent
,
QGridLayout
*
l
,
int
line
)
:
FloatConfigControl
(
_p_this
,
_p_item
,
_parent
,
l
,
line
)
{
finish
();
}
FloatRangeConfigControl
::
FloatRangeConfigControl
(
vlc_object_t
*
_p_this
,
module_config_t
*
_p_item
,
QLabel
*
_label
,
QDoubleSpinBox
*
_spin
)
:
FloatConfigControl
(
_p_this
,
_p_item
,
_label
,
_spin
)
{
finish
();
}
void
FloatRangeConfigControl
::
finish
()
{
spin
->
setMaximum
(
(
double
)
p_item
->
f_max
);
spin
->
setMinimum
(
(
double
)
p_item
->
f_min
);
}
modules/gui/qt4/components/preferences_widgets.hpp
View file @
a4989d74
...
...
@@ -28,6 +28,7 @@
#include <QWidget>
#include <QLineEdit>
#include <QSpinBox>
#include <QDoubleSpinBox>
#include <QComboBox>
#include <QCheckBox>
#include "ui/input_stats.h"
...
...
@@ -95,12 +96,26 @@ public:
virtual
int
getValue
();
virtual
void
show
()
{
spin
->
show
();
label
->
show
();
}
virtual
void
hide
()
{
spin
->
hide
();
label
->
hide
();
}
private:
protected:
QSpinBox
*
spin
;
private:
QLabel
*
label
;
void
finish
();
};
class
IntegerRangeConfigControl
:
public
IntegerConfigControl
{
public:
IntegerRangeConfigControl
(
vlc_object_t
*
,
module_config_t
*
,
QWidget
*
,
QGridLayout
*
,
int
);
IntegerRangeConfigControl
(
vlc_object_t
*
,
module_config_t
*
,
QLabel
*
,
QSpinBox
*
);
private:
void
finish
();
};
class
IntegerListConfigControl
:
public
VIntConfigControl
{
public:
...
...
@@ -148,6 +163,36 @@ public:
virtual
float
getValue
()
=
0
;
};
class
FloatConfigControl
:
public
VFloatConfigControl
{
public:
FloatConfigControl
(
vlc_object_t
*
,
module_config_t
*
,
QWidget
*
,
QGridLayout
*
,
int
);
FloatConfigControl
(
vlc_object_t
*
,
module_config_t
*
,
QLabel
*
,
QDoubleSpinBox
*
);
virtual
~
FloatConfigControl
()
{};
virtual
float
getValue
();
virtual
void
show
()
{
spin
->
show
();
label
->
show
();
}
virtual
void
hide
()
{
spin
->
hide
();
label
->
hide
();
}
protected:
QDoubleSpinBox
*
spin
;
private:
QLabel
*
label
;
void
finish
();
};
class
FloatRangeConfigControl
:
public
FloatConfigControl
{
public:
FloatRangeConfigControl
(
vlc_object_t
*
,
module_config_t
*
,
QWidget
*
,
QGridLayout
*
,
int
);
FloatRangeConfigControl
(
vlc_object_t
*
,
module_config_t
*
,
QLabel
*
,
QDoubleSpinBox
*
);
private:
void
finish
();
};
#if 0
class FloatConfigControl : public VFloatConfigControl
{
...
...
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