Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
454
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
637d5b9f
Commit
637d5b9f
authored
4 years ago
by
Fatih Uzunoğlu
Committed by
Pierre Lamot
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
qml: use repeater for sortmenu model in PlaylistOverlayMenu
Signed-off-by:
Pierre Lamot
<
pierre@videolabs.io
>
parent
7f1af5ef
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/gui/qt/playlist/qml/PlaylistOverlayMenu.qml
+42
-111
42 additions, 111 deletions
modules/gui/qt/playlist/qml/PlaylistOverlayMenu.qml
with
42 additions
and
111 deletions
modules/gui/qt/playlist/qml/PlaylistOverlayMenu.qml
+
42
−
111
View file @
637d5b9f
...
...
@@ -187,120 +187,51 @@ Widgets.OverlayMenu {
// Sort menu:
function
sortOrderMarkRetriever
(
key
)
{
if
(
key
===
mainPlaylistController
.
sortKey
)
{
return
(
mainPlaylistController
.
sortOrder
===
PlaylistControllerModel
.
SORT_ORDER_ASC
?
"
↓
"
:
"
↑
"
)
}
else
{
return
null
}
}
Action
{
id
:
sortTitleAction
text
:
i18n
.
qtr
(
"
Title
"
)
onTriggered
:
mainPlaylistController
.
sort
(
key
)
readonly
property
int
key
:
PlaylistControllerModel
.
SORT_KEY_TITLE
readonly
property
string
marking
:
sortOrderMarkRetriever
(
key
)
readonly
property
bool
tickMark
:
(
key
===
mainPlaylistController
.
sortKey
)
}
Action
{
id
:
sortDurationAction
text
:
i18n
.
qtr
(
"
Duration
"
)
onTriggered
:
mainPlaylistController
.
sort
(
key
)
readonly
property
int
key
:
PlaylistControllerModel
.
SORT_KEY_DURATION
readonly
property
string
marking
:
sortOrderMarkRetriever
(
key
)
readonly
property
bool
tickMark
:
(
key
===
mainPlaylistController
.
sortKey
)
}
Action
{
id
:
sortArtistAction
text
:
i18n
.
qtr
(
"
Artist
"
)
onTriggered
:
mainPlaylistController
.
sort
(
key
)
readonly
property
int
key
:
PlaylistControllerModel
.
SORT_KEY_ARTIST
readonly
property
string
marking
:
sortOrderMarkRetriever
(
key
)
readonly
property
bool
tickMark
:
(
key
===
mainPlaylistController
.
sortKey
)
}
Action
{
id
:
sortAlbumAction
text
:
i18n
.
qtr
(
"
Album
"
)
onTriggered
:
mainPlaylistController
.
sort
(
key
)
readonly
property
int
key
:
PlaylistControllerModel
.
SORT_KEY_ALBUM
readonly
property
string
marking
:
sortOrderMarkRetriever
(
key
)
readonly
property
bool
tickMark
:
(
key
===
mainPlaylistController
.
sortKey
)
}
Action
{
id
:
sortAlbumArtistAction
text
:
i18n
.
qtr
(
"
Album Artist
"
)
onTriggered
:
mainPlaylistController
.
sort
(
key
)
readonly
property
int
key
:
PlaylistControllerModel
.
SORT_KEY_ALBUM_ARTIST
readonly
property
string
marking
:
sortOrderMarkRetriever
(
key
)
readonly
property
bool
tickMark
:
(
key
===
mainPlaylistController
.
sortKey
)
}
Action
{
id
:
sortGenreAction
text
:
i18n
.
qtr
(
"
Genre
"
)
onTriggered
:
mainPlaylistController
.
sort
(
key
)
readonly
property
int
key
:
PlaylistControllerModel
.
SORT_KEY_GENRE
readonly
property
string
marking
:
sortOrderMarkRetriever
(
key
)
readonly
property
bool
tickMark
:
(
key
===
mainPlaylistController
.
sortKey
)
}
Action
{
id
:
sortDateAction
text
:
i18n
.
qtr
(
"
Date
"
)
onTriggered
:
mainPlaylistController
.
sort
(
key
)
readonly
property
int
key
:
PlaylistControllerModel
.
SORT_KEY_DATE
readonly
property
string
marking
:
sortOrderMarkRetriever
(
key
)
readonly
property
bool
tickMark
:
(
key
===
mainPlaylistController
.
sortKey
)
}
Action
{
id
:
sortTrackNumberAction
text
:
i18n
.
qtr
(
"
Track Number
"
)
onTriggered
:
mainPlaylistController
.
sort
(
key
)
readonly
property
int
key
:
PlaylistControllerModel
.
SORT_KEY_TRACK_NUMBER
readonly
property
string
marking
:
sortOrderMarkRetriever
(
key
)
readonly
property
bool
tickMark
:
(
key
===
mainPlaylistController
.
sortKey
)
}
Action
{
id
:
sortURLAction
text
:
i18n
.
qtr
(
"
URL
"
)
onTriggered
:
mainPlaylistController
.
sort
(
key
)
readonly
property
int
key
:
PlaylistControllerModel
.
SORT_KEY_URL
readonly
property
string
marking
:
sortOrderMarkRetriever
(
key
)
readonly
property
bool
tickMark
:
(
key
===
mainPlaylistController
.
sortKey
)
}
Action
{
id
:
sortRatingAction
text
:
i18n
.
qtr
(
"
Rating
"
)
onTriggered
:
mainPlaylistController
.
sort
(
key
)
readonly
property
int
key
:
PlaylistControllerModel
.
SORT_KEY_RATING
readonly
property
string
marking
:
sortOrderMarkRetriever
(
key
)
readonly
property
bool
tickMark
:
(
key
===
mainPlaylistController
.
sortKey
)
}
property
var
sortMenu
:
({
title
:
i18n
.
qtr
(
"
Sort Menu
"
),
entries
:
[
sortTitleAction
,
sortDurationAction
,
sortArtistAction
,
sortAlbumAction
,
sortAlbumArtistAction
,
sortGenreAction
,
sortDateAction
,
sortTrackNumberAction
,
sortURLAction
,
sortRatingAction
]
entries
:
[]
})
Component
{
id
:
sortActionDelegate
Action
{
property
int
key
:
undefined
readonly
property
string
marking
:
{
if
(
key
===
mainPlaylistController
.
sortKey
)
{
return
(
mainPlaylistController
.
sortOrder
===
PlaylistControllerModel
.
SORT_ORDER_ASC
?
"
↓
"
:
"
↑
"
)
}
else
{
return
null
}
}
readonly
property
bool
tickMark
:
(
key
===
mainPlaylistController
.
sortKey
)
onTriggered
:
mainPlaylistController
.
sort
(
key
)
}
}
Repeater
{
model
:
[{
title
:
i18n
.
qtr
(
"
Title
"
),
key
:
PlaylistControllerModel
.
SORT_KEY_TITLE
},
{
title
:
i18n
.
qtr
(
"
Duration
"
),
key
:
PlaylistControllerModel
.
SORT_KEY_DURATION
},
{
title
:
i18n
.
qtr
(
"
Artist
"
),
key
:
PlaylistControllerModel
.
SORT_KEY_ARTIST
},
{
title
:
i18n
.
qtr
(
"
Album
"
),
key
:
PlaylistControllerModel
.
SORT_KEY_ALBUM
},
{
title
:
i18n
.
qtr
(
"
Album Artist
"
),
key
:
PlaylistControllerModel
.
SORT_KEY_ALBUM_ARTIST
},
{
title
:
i18n
.
qtr
(
"
Genre
"
),
key
:
PlaylistControllerModel
.
SORT_KEY_GENRE
},
{
title
:
i18n
.
qtr
(
"
Date
"
),
key
:
PlaylistControllerModel
.
SORT_KEY_DATE
},
{
title
:
i18n
.
qtr
(
"
Track Number
"
),
key
:
PlaylistControllerModel
.
SORT_KEY_TRACK_NUMBER
},
{
title
:
i18n
.
qtr
(
"
URL
"
),
key
:
PlaylistControllerModel
.
SORT_KEY_URL
},
{
title
:
i18n
.
qtr
(
"
Rating
"
),
key
:
PlaylistControllerModel
.
SORT_KEY_RATING
}]
delegate
:
Loader
{
asynchronous
:
true
sourceComponent
:
sortActionDelegate
onLoaded
:
{
item
.
text
=
modelData
.
title
item
.
key
=
modelData
.
key
overlayMenu
.
sortMenu
.
entries
.
push
(
item
)
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment