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
28d465e8
Commit
28d465e8
authored
Dec 22, 2012
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: hotkeys: allow filtering by field (fix #7931)
parent
bfcafac5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
7 deletions
+28
-7
modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/preferences_widgets.cpp
+24
-6
modules/gui/qt4/components/preferences_widgets.hpp
modules/gui/qt4/components/preferences_widgets.hpp
+4
-1
No files found.
modules/gui/qt4/components/preferences_widgets.cpp
View file @
28d465e8
...
@@ -1134,8 +1134,15 @@ KeySelectorControl::KeySelectorControl( vlc_object_t *_p_this,
...
@@ -1134,8 +1134,15 @@ KeySelectorControl::KeySelectorControl( vlc_object_t *_p_this,
searchLabel
=
new
QLabel
(
qtr
(
"Search"
),
p
);
searchLabel
=
new
QLabel
(
qtr
(
"Search"
),
p
);
actionSearch
=
new
SearchLineEdit
();
actionSearch
=
new
SearchLineEdit
();
searchOptionLabel
=
new
QLabel
(
qtr
(
"in"
)
);
searchOption
=
new
QComboBox
();
searchOption
->
addItem
(
qtr
(
"Any field"
),
ANY_COL
);
searchOption
->
addItem
(
qtr
(
"Actions"
),
ACTION_COL
);
searchOption
->
addItem
(
qtr
(
"Hotkeys"
),
HOTKEY_COL
);
searchOption
->
addItem
(
qtr
(
"Global Hotkeys"
),
GLOBAL_HOTKEY_COL
);
table
=
new
QTreeWidget
(
p
);
table
=
new
QTreeWidget
(
p
);
table
->
setColumnCount
(
3
);
table
->
setColumnCount
(
ANY_COL
);
table
->
headerItem
()
->
setText
(
ACTION_COL
,
qtr
(
"Action"
)
);
table
->
headerItem
()
->
setText
(
ACTION_COL
,
qtr
(
"Action"
)
);
table
->
headerItem
()
->
setText
(
HOTKEY_COL
,
qtr
(
"Hotkey"
)
);
table
->
headerItem
()
->
setText
(
HOTKEY_COL
,
qtr
(
"Hotkey"
)
);
table
->
headerItem
()
->
setToolTip
(
HOTKEY_COL
,
qtr
(
"Application level hotkey"
)
);
table
->
headerItem
()
->
setToolTip
(
HOTKEY_COL
,
qtr
(
"Application level hotkey"
)
);
...
@@ -1161,10 +1168,12 @@ KeySelectorControl::KeySelectorControl( vlc_object_t *_p_this,
...
@@ -1161,10 +1168,12 @@ KeySelectorControl::KeySelectorControl( vlc_object_t *_p_this,
void
KeySelectorControl
::
fillGrid
(
QGridLayout
*
l
,
int
line
)
void
KeySelectorControl
::
fillGrid
(
QGridLayout
*
l
,
int
line
)
{
{
QGridLayout
*
gLayout
=
new
QGridLayout
();
QGridLayout
*
gLayout
=
new
QGridLayout
();
gLayout
->
addWidget
(
label
,
0
,
0
,
1
,
4
);
gLayout
->
addWidget
(
label
,
0
,
0
,
1
,
5
);
gLayout
->
addWidget
(
searchLabel
,
1
,
0
,
1
,
2
);
gLayout
->
addWidget
(
searchLabel
,
1
,
0
,
1
,
2
);
gLayout
->
addWidget
(
actionSearch
,
1
,
2
,
1
,
2
);
gLayout
->
addWidget
(
actionSearch
,
1
,
2
,
1
,
1
);
gLayout
->
addWidget
(
table
,
2
,
0
,
1
,
4
);
gLayout
->
addWidget
(
searchOptionLabel
,
1
,
3
,
1
,
1
);
gLayout
->
addWidget
(
searchOption
,
1
,
4
,
1
,
1
);
gLayout
->
addWidget
(
table
,
2
,
0
,
1
,
5
);
l
->
addLayout
(
gLayout
,
line
,
0
,
1
,
-
1
);
l
->
addLayout
(
gLayout
,
line
,
0
,
1
,
-
1
);
}
}
...
@@ -1264,8 +1273,17 @@ void KeySelectorControl::finish()
...
@@ -1264,8 +1273,17 @@ void KeySelectorControl::finish()
void
KeySelectorControl
::
filter
(
const
QString
&
qs_search
)
void
KeySelectorControl
::
filter
(
const
QString
&
qs_search
)
{
{
QList
<
QTreeWidgetItem
*>
resultList
=
int
i_column
=
searchOption
->
itemData
(
searchOption
->
currentIndex
()
).
toInt
();
table
->
findItems
(
qs_search
,
Qt
::
MatchContains
,
ACTION_COL
);
QList
<
QTreeWidgetItem
*>
resultList
;
if
(
i_column
==
ANY_COL
)
{
for
(
int
i
=
0
;
i
<
ANY_COL
;
i
++
)
resultList
<<
table
->
findItems
(
qs_search
,
Qt
::
MatchContains
,
i
);
}
else
{
resultList
=
table
->
findItems
(
qs_search
,
Qt
::
MatchContains
,
i_column
);
}
for
(
int
i
=
0
;
i
<
table
->
topLevelItemCount
();
i
++
)
for
(
int
i
=
0
;
i
<
table
->
topLevelItemCount
();
i
++
)
{
{
table
->
topLevelItem
(
i
)
->
setHidden
(
table
->
topLevelItem
(
i
)
->
setHidden
(
...
...
modules/gui/qt4/components/preferences_widgets.hpp
View file @
28d465e8
...
@@ -507,6 +507,8 @@ private:
...
@@ -507,6 +507,8 @@ private:
QLabel
*
label
;
QLabel
*
label
;
QLabel
*
searchLabel
;
QLabel
*
searchLabel
;
SearchLineEdit
*
actionSearch
;
SearchLineEdit
*
actionSearch
;
QComboBox
*
searchOption
;
QLabel
*
searchOptionLabel
;
QTreeWidget
*
table
;
QTreeWidget
*
table
;
QList
<
module_config_t
*>
values
;
QList
<
module_config_t
*>
values
;
QSet
<
QString
>
existingkeys
;
QSet
<
QString
>
existingkeys
;
...
@@ -514,7 +516,8 @@ private:
...
@@ -514,7 +516,8 @@ private:
{
{
ACTION_COL
=
0
,
ACTION_COL
=
0
,
HOTKEY_COL
=
1
,
HOTKEY_COL
=
1
,
GLOBAL_HOTKEY_COL
=
2
GLOBAL_HOTKEY_COL
=
2
,
ANY_COL
=
3
// == count()
};
};
private
slots
:
private
slots
:
...
...
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