unify track delegate handling
ClosedPublic

Authored by astippich on Dec 8 2017, 6:06 PM.

Details

Summary

In preparation for T6345 this diff unifies the delegates for the single album view and the all tracks view.
This makes adding i.e. new actions to both delegates a lot easier as they now share most of the code.
Two new track delegates are replacing the old ones. The delegate for the single album view only wraps around the shared code.
Included functional changes:
-animations in the single album view
-makes more data available in the models
-adds disc number handling for the all tracksview
-converted actions to use signals

Test Plan

album view and all tracks view work as before

Diff Detail

Repository
R255 Elisa
Branch
track_delegate
Lint
No Linters Available
Unit
No Unit Test Coverage
astippich requested review of this revision.Dec 8 2017, 6:06 PM
astippich created this revision.
astippich added a comment.EditedDec 8 2017, 6:16 PM

While adding the metadata view for the tracks I realized that I had to duplicate a lot of code between the AudioTrackDelegate and the MediaTracksDelegate. They mostly do the same things, and sometimes implement those even differently. Since they also differ in some aspects, sharing code was not as easy as I initially anticipated, and this is what I came up with.
One screenshot for the only (static) visual change: add a label indicating the disc number in the all track views:

mgallien requested changes to this revision.Dec 12 2017, 8:06 PM

Thanks for your work.
I have not finished reviewing this work. I noticed one thing that is broken. I cannot navigate the tracks of an album with the keyboard arrows.
Could you also test with the -reverse command line option ? I will also do it.

src/MediaTracksDelegate.qml
88

When clicking on a track inside an album, a warning is emitted by this line.

This revision now requires changes to proceed.Dec 12 2017, 8:06 PM

fixed some typos locally that eliminate those warnings, but noticed that this needs some more work, for example there are also issues with select. will update later. sorry, I put this on phabricator to soon.
btw navigation with keys up and down is supposed to work? never did here...

fixed some typos locally that eliminate those warnings, but noticed that this needs some more work, for example there are also issues with select. will update later. sorry, I put this on phabricator to soon.
btw navigation with keys up and down is supposed to work? never did here...

I did check with the master branch and it worked. I have read that qt quick controls v1 do some special handling of touch screen and my laptop has one. Maybe, it is related since my work computer under windows lacks one and lacks keyboard navigation.

astippich updated this revision to Diff 24039.Dec 17 2017, 7:27 PM
  • fix warnings and focus issues
  • do not use loader for the album track delegate
mgallien accepted this revision.Dec 19 2017, 9:29 PM

Thanks for your work. Works fine for me including keyboard navigation with my plasma running laptop.

This revision is now accepted and ready to land.Dec 19 2017, 9:29 PM
astippich updated this revision to Diff 24125.Dec 19 2017, 10:11 PM
  • merge master branch for pushing
This revision was automatically updated to reflect the committed changes.