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
9ab3a054
Commit
9ab3a054
authored
Feb 27, 2008
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4 - Preferences refreshing fix by atmo, Andre Weber.
parent
c482de12
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
28 deletions
+91
-28
modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/preferences_widgets.cpp
+85
-26
modules/gui/qt4/components/preferences_widgets.hpp
modules/gui/qt4/components/preferences_widgets.hpp
+6
-2
No files found.
modules/gui/qt4/components/preferences_widgets.cpp
View file @
9ab3a054
...
@@ -36,7 +36,6 @@
...
@@ -36,7 +36,6 @@
#include "components/preferences_widgets.hpp"
#include "components/preferences_widgets.hpp"
#include "util/customwidgets.hpp"
#include "util/customwidgets.hpp"
#include <vlc_keys.h>
#include <vlc_keys.h>
#include <QString>
#include <QString>
...
@@ -373,7 +372,10 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *_p_this,
...
@@ -373,7 +372,10 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *_p_this,
combo
=
new
QComboBox
();
combo
=
new
QComboBox
();
combo
->
setMinimumWidth
(
MINWIDTH_BOX
);
combo
->
setMinimumWidth
(
MINWIDTH_BOX
);
combo
->
setSizePolicy
(
QSizePolicy
::
MinimumExpanding
,
QSizePolicy
::
Preferred
);
combo
->
setSizePolicy
(
QSizePolicy
::
MinimumExpanding
,
QSizePolicy
::
Preferred
);
finish
(
bycat
);
module_config_t
*
p_module_config
=
config_FindConfig
(
p_this
,
getName
()
);
finish
(
p_module_config
,
bycat
);
if
(
!
l
)
if
(
!
l
)
{
{
l
=
new
QGridLayout
();
l
=
new
QGridLayout
();
...
@@ -410,17 +412,20 @@ void StringListConfigControl::actionRequested( int i_action )
...
@@ -410,17 +412,20 @@ void StringListConfigControl::actionRequested( int i_action )
/* Supplementary check for boundaries */
/* Supplementary check for boundaries */
if
(
i_action
<
0
||
i_action
>=
p_item
->
i_action
)
return
;
if
(
i_action
<
0
||
i_action
>=
p_item
->
i_action
)
return
;
module_config_t
*
p_module_config
=
config_FindConfig
(
p_this
,
getName
()
);
if
(
!
p_module_config
)
return
;
vlc_value_t
val
;
vlc_value_t
val
;
val
.
psz_string
=
val
.
psz_string
=
qtu
(
(
combo
->
itemData
(
combo
->
currentIndex
()
).
toString
()
)
);
qtu
(
(
combo
->
itemData
(
combo
->
currentIndex
()
).
toString
()
)
);
p_
item
->
ppf_action
[
i_action
](
p_this
,
getName
(),
val
,
val
,
0
);
p_
module_config
->
ppf_action
[
i_action
](
p_this
,
getName
(),
val
,
val
,
0
);
if
(
p_
item
->
b_dirty
)
if
(
p_
module_config
->
b_dirty
)
{
{
combo
->
clear
();
combo
->
clear
();
finish
(
true
);
finish
(
p_module_config
,
true
);
p_
item
->
b_dirty
=
VLC_FALSE
;
p_
module_config
->
b_dirty
=
VLC_FALSE
;
}
}
}
}
StringListConfigControl
::
StringListConfigControl
(
vlc_object_t
*
_p_this
,
StringListConfigControl
::
StringListConfigControl
(
vlc_object_t
*
_p_this
,
...
@@ -429,26 +434,31 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *_p_this,
...
@@ -429,26 +434,31 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *_p_this,
{
{
combo
=
_combo
;
combo
=
_combo
;
label
=
_label
;
label
=
_label
;
finish
(
bycat
);
module_config_t
*
p_module_config
=
config_FindConfig
(
p_this
,
getName
()
);
finish
(
p_module_config
,
bycat
);
}
}
void
StringListConfigControl
::
finish
(
bool
bycat
)
void
StringListConfigControl
::
finish
(
module_config_t
*
p_module_config
,
bool
bycat
)
{
{
combo
->
setEditable
(
false
);
combo
->
setEditable
(
false
);
for
(
int
i_index
=
0
;
i_index
<
p_item
->
i_list
;
i_index
++
)
if
(
!
p_module_config
)
return
;
for
(
int
i_index
=
0
;
i_index
<
p_module_config
->
i_list
;
i_index
++
)
{
{
combo
->
addItem
(
qfu
(
p_
item
->
ppsz_list_text
?
combo
->
addItem
(
qfu
(
p_
module_config
->
ppsz_list_text
?
p_
item
->
ppsz_list_text
[
i_index
]
:
p_
module_config
->
ppsz_list_text
[
i_index
]
:
p_
item
->
ppsz_list
[
i_index
]
),
p_
module_config
->
ppsz_list
[
i_index
]
),
QVariant
(
p_
item
->
ppsz_list
[
i_index
]
)
);
QVariant
(
p_
module_config
->
ppsz_list
[
i_index
]
)
);
if
(
p_item
->
value
.
psz
&&
!
strcmp
(
p_
item
->
value
.
psz
,
if
(
p_item
->
value
.
psz
&&
!
strcmp
(
p_
module_config
->
value
.
psz
,
p_
item
->
ppsz_list
[
i_index
]
)
)
p_
module_config
->
ppsz_list
[
i_index
]
)
)
combo
->
setCurrentIndex
(
combo
->
count
()
-
1
);
combo
->
setCurrentIndex
(
combo
->
count
()
-
1
);
}
}
combo
->
setToolTip
(
formatTooltip
(
qtr
(
p_
item
->
psz_longtext
))
);
combo
->
setToolTip
(
formatTooltip
(
qtr
(
p_
module_config
->
psz_longtext
))
);
if
(
label
)
if
(
label
)
label
->
setToolTip
(
formatTooltip
(
qtr
(
p_
item
->
psz_longtext
))
);
label
->
setToolTip
(
formatTooltip
(
qtr
(
p_
module_config
->
psz_longtext
))
);
}
}
QString
StringListConfigControl
::
getValue
()
QString
StringListConfigControl
::
getValue
()
...
@@ -826,7 +836,10 @@ IntegerListConfigControl::IntegerListConfigControl( vlc_object_t *_p_this,
...
@@ -826,7 +836,10 @@ IntegerListConfigControl::IntegerListConfigControl( vlc_object_t *_p_this,
label
=
new
QLabel
(
qtr
(
p_item
->
psz_text
)
);
label
=
new
QLabel
(
qtr
(
p_item
->
psz_text
)
);
combo
=
new
QComboBox
();
combo
=
new
QComboBox
();
combo
->
setMinimumWidth
(
MINWIDTH_BOX
);
combo
->
setMinimumWidth
(
MINWIDTH_BOX
);
finish
(
bycat
);
module_config_t
*
p_module_config
=
config_FindConfig
(
p_this
,
getName
()
);
finish
(
p_module_config
,
bycat
);
if
(
!
l
)
if
(
!
l
)
{
{
QHBoxLayout
*
layout
=
new
QHBoxLayout
();
QHBoxLayout
*
layout
=
new
QHBoxLayout
();
...
@@ -838,6 +851,25 @@ IntegerListConfigControl::IntegerListConfigControl( vlc_object_t *_p_this,
...
@@ -838,6 +851,25 @@ IntegerListConfigControl::IntegerListConfigControl( vlc_object_t *_p_this,
l
->
addWidget
(
label
,
line
,
0
);
l
->
addWidget
(
label
,
line
,
0
);
l
->
addWidget
(
combo
,
line
,
LAST_COLUMN
,
Qt
::
AlignRight
);
l
->
addWidget
(
combo
,
line
,
LAST_COLUMN
,
Qt
::
AlignRight
);
}
}
if
(
p_item
->
i_action
)
{
QSignalMapper
*
signalMapper
=
new
QSignalMapper
(
this
);
/* Some stringLists like Capture listings have action associated */
for
(
int
i
=
0
;
i
<
p_item
->
i_action
;
i
++
)
{
QPushButton
*
button
=
new
QPushButton
(
qfu
(
p_item
->
ppsz_action_text
[
i
]
));
CONNECT
(
button
,
clicked
(),
signalMapper
,
map
()
);
signalMapper
->
setMapping
(
button
,
i
);
l
->
addWidget
(
button
,
line
,
LAST_COLUMN
-
p_item
->
i_action
+
i
,
Qt
::
AlignRight
);
}
CONNECT
(
signalMapper
,
mapped
(
int
),
this
,
actionRequested
(
int
)
);
}
}
}
IntegerListConfigControl
::
IntegerListConfigControl
(
vlc_object_t
*
_p_this
,
IntegerListConfigControl
::
IntegerListConfigControl
(
vlc_object_t
*
_p_this
,
module_config_t
*
_p_item
,
QLabel
*
_label
,
QComboBox
*
_combo
,
module_config_t
*
_p_item
,
QLabel
*
_label
,
QComboBox
*
_combo
,
...
@@ -845,23 +877,50 @@ IntegerListConfigControl::IntegerListConfigControl( vlc_object_t *_p_this,
...
@@ -845,23 +877,50 @@ IntegerListConfigControl::IntegerListConfigControl( vlc_object_t *_p_this,
{
{
combo
=
_combo
;
combo
=
_combo
;
label
=
_label
;
label
=
_label
;
finish
(
bycat
);
module_config_t
*
p_module_config
=
config_FindConfig
(
p_this
,
getName
()
);
finish
(
p_module_config
,
bycat
);
}
}
void
IntegerListConfigControl
::
finish
(
bool
bycat
)
void
IntegerListConfigControl
::
finish
(
module_config_t
*
p_module_config
,
bool
bycat
)
{
{
combo
->
setEditable
(
false
);
combo
->
setEditable
(
false
);
for
(
int
i_index
=
0
;
i_index
<
p_item
->
i_list
;
i_index
++
)
if
(
!
p_module_config
)
return
;
for
(
int
i_index
=
0
;
i_index
<
p_module_config
->
i_list
;
i_index
++
)
{
{
combo
->
addItem
(
qtr
(
p_
item
->
ppsz_list_text
[
i_index
]
),
combo
->
addItem
(
qtr
(
p_
module_config
->
ppsz_list_text
[
i_index
]
),
QVariant
(
p_
item
->
pi_list
[
i_index
]
)
);
QVariant
(
p_
module_config
->
pi_list
[
i_index
]
)
);
if
(
p_
item
->
value
.
i
==
p_item
->
pi_list
[
i_index
]
)
if
(
p_
module_config
->
value
.
i
==
p_module_config
->
pi_list
[
i_index
]
)
combo
->
setCurrentIndex
(
combo
->
count
()
-
1
);
combo
->
setCurrentIndex
(
combo
->
count
()
-
1
);
}
}
combo
->
setToolTip
(
formatTooltip
(
qtr
(
p_
item
->
psz_longtext
))
);
combo
->
setToolTip
(
formatTooltip
(
qtr
(
p_
module_config
->
psz_longtext
))
);
if
(
label
)
if
(
label
)
label
->
setToolTip
(
formatTooltip
(
qtr
(
p_item
->
psz_longtext
))
);
label
->
setToolTip
(
formatTooltip
(
qtr
(
p_module_config
->
psz_longtext
))
);
}
void
IntegerListConfigControl
::
actionRequested
(
int
i_action
)
{
/* Supplementary check for boundaries */
if
(
i_action
<
0
||
i_action
>=
p_item
->
i_action
)
return
;
module_config_t
*
p_module_config
=
config_FindConfig
(
p_this
,
getName
()
);
if
(
!
p_module_config
)
return
;
vlc_value_t
val
;
val
.
i_int
=
combo
->
itemData
(
combo
->
currentIndex
()
).
toInt
();
p_module_config
->
ppf_action
[
i_action
](
p_this
,
getName
(),
val
,
val
,
0
);
if
(
p_module_config
->
b_dirty
)
{
combo
->
clear
();
finish
(
p_module_config
,
true
);
p_module_config
->
b_dirty
=
VLC_FALSE
;
}
}
}
int
IntegerListConfigControl
::
getValue
()
int
IntegerListConfigControl
::
getValue
()
...
...
modules/gui/qt4/components/preferences_widgets.hpp
View file @
9ab3a054
...
@@ -163,6 +163,7 @@ private:
...
@@ -163,6 +163,7 @@ private:
class
IntegerListConfigControl
:
public
VIntConfigControl
class
IntegerListConfigControl
:
public
VIntConfigControl
{
{
Q_OBJECT
public:
public:
IntegerListConfigControl
(
vlc_object_t
*
,
module_config_t
*
,
QWidget
*
,
IntegerListConfigControl
(
vlc_object_t
*
,
module_config_t
*
,
QWidget
*
,
bool
,
QGridLayout
*
,
int
&
);
bool
,
QGridLayout
*
,
int
&
);
...
@@ -173,9 +174,12 @@ public:
...
@@ -173,9 +174,12 @@ public:
virtual
void
hide
()
{
combo
->
hide
();
if
(
label
)
label
->
hide
();
}
virtual
void
hide
()
{
combo
->
hide
();
if
(
label
)
label
->
hide
();
}
virtual
void
show
()
{
combo
->
show
();
if
(
label
)
label
->
show
();
}
virtual
void
show
()
{
combo
->
show
();
if
(
label
)
label
->
show
();
}
private:
private:
void
finish
(
bool
);
void
finish
(
module_config_t
*
,
bool
);
QLabel
*
label
;
QLabel
*
label
;
QComboBox
*
combo
;
QComboBox
*
combo
;
private
slots
:
void
actionRequested
(
int
);
};
};
class
BoolConfigControl
:
public
VIntConfigControl
class
BoolConfigControl
:
public
VIntConfigControl
...
@@ -384,7 +388,7 @@ public:
...
@@ -384,7 +388,7 @@ public:
virtual
void
show
()
{
combo
->
show
();
if
(
label
)
label
->
show
();
}
virtual
void
show
()
{
combo
->
show
();
if
(
label
)
label
->
show
();
}
QComboBox
*
combo
;
QComboBox
*
combo
;
private:
private:
void
finish
(
bool
);
void
finish
(
module_config_t
*
,
bool
);
QLabel
*
label
;
QLabel
*
label
;
private
slots
:
private
slots
:
void
actionRequested
(
int
);
void
actionRequested
(
int
);
...
...
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