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
1a2f7b20
Commit
1a2f7b20
authored
Jun 15, 2015
by
Daniel Amm
Committed by
Jean-Baptiste Kempf
Jun 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: extension dialog: update checkboxes if a check state was changed
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
aee51fec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
modules/gui/qt4/components/simple_preferences.cpp
modules/gui/qt4/components/simple_preferences.cpp
+43
-0
modules/gui/qt4/components/simple_preferences.hpp
modules/gui/qt4/components/simple_preferences.hpp
+1
-0
No files found.
modules/gui/qt4/components/simple_preferences.cpp
View file @
1a2f7b20
...
...
@@ -1352,6 +1352,8 @@ void SPrefsPanel::assoDialog()
#undef aTv
#undef aTa
CONNECT
(
filetypeList
,
itemChanged
(
QTreeWidgetItem
*
,
int
),
this
,
updateCheckBoxes
(
QTreeWidgetItem
*
,
int
)
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
d
);
QPushButton
*
closeButton
=
new
QPushButton
(
qtr
(
"&Apply"
)
);
QPushButton
*
clearButton
=
new
QPushButton
(
qtr
(
"&Cancel"
)
);
...
...
@@ -1368,6 +1370,47 @@ void SPrefsPanel::assoDialog()
listAsso
.
clear
();
}
void
SPrefsPanel
::
updateCheckBoxes
(
QTreeWidgetItem
*
item
,
int
column
)
{
if
(
column
!=
0
)
return
;
/* temporarily block signals to avoid signal loops */
bool
b_signalsBlocked
=
item
->
treeWidget
()
->
blockSignals
(
true
);
/* A parent checkbox was changed */
if
(
item
->
parent
()
==
0
)
{
Qt
::
CheckState
checkState
=
item
->
checkState
(
0
);
for
(
int
i
=
0
;
i
<
item
->
childCount
();
i
++
)
{
item
->
child
(
i
)
->
setCheckState
(
0
,
checkState
);
}
}
/* A child checkbox was changed */
else
{
bool
b_diff
=
false
;
for
(
int
i
=
0
;
i
<
item
->
parent
()
->
childCount
();
i
++
)
{
if
(
i
!=
item
->
parent
()
->
indexOfChild
(
item
)
&&
item
->
checkState
(
0
)
!=
item
->
parent
()
->
child
(
i
)
->
checkState
(
0
)
)
{
b_diff
=
true
;
break
;
}
}
if
(
b_diff
)
item
->
parent
()
->
setCheckState
(
0
,
Qt
::
PartiallyChecked
);
else
item
->
parent
()
->
setCheckState
(
0
,
item
->
checkState
(
0
));
}
/* Stop signal blocking */
item
->
treeWidget
()
->
blockSignals
(
b_signalsBlocked
);
}
void
addAsso
(
QVLCRegistry
*
qvReg
,
const
char
*
psz_ext
)
{
QString
s_path
(
"VLC"
);
s_path
+=
psz_ext
;
...
...
modules/gui/qt4/components/simple_preferences.hpp
View file @
1a2f7b20
...
...
@@ -122,6 +122,7 @@ private slots:
void
langChanged
(
int
);
#ifdef _WIN32
void
assoDialog
();
void
updateCheckBoxes
(
QTreeWidgetItem
*
,
int
);
void
saveAsso
();
#endif
void
configML
();
...
...
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