Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick action context menu for WTrackProperty #2612

Merged
merged 54 commits into from
Apr 17, 2020

Conversation

hacksdump
Copy link
Contributor

Fixes https://bugs.launchpad.net/mixxx/+bug/1277689
Now WTrackTableView Context menu actions are also accessible from WTrackProperty widget in the player deck.
For brevity, only selected actions have been added.

@Holzhaus Holzhaus added the ui label Apr 2, 2020
Copy link
Contributor

@Be-ing Be-ing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work

CMakeLists.txt Outdated Show resolved Hide resolved
src/widget/wtrackmenu.cpp Outdated Show resolved Hide resolved
src/widget/wtrackmenu.cpp Outdated Show resolved Hide resolved
src/widget/wtrackmenu.cpp Outdated Show resolved Hide resolved
src/widget/wtracktableview.cpp Outdated Show resolved Hide resolved
src/widget/wtrackmenu.cpp Outdated Show resolved Hide resolved
src/widget/wtrackproperty.cpp Outdated Show resolved Hide resolved
src/widget/wtrackproperty.cpp Outdated Show resolved Hide resolved
src/widget/wtrackproperty.cpp Outdated Show resolved Hide resolved
@Be-ing
Copy link
Contributor

Be-ing commented Apr 5, 2020

Wow this is a big diff! WTrackTableView is down to a much more manageable 920 lines of code.

src/widget/wtrackmenu.cpp Outdated Show resolved Hide resolved
src/widget/wtrackmenu.h Outdated Show resolved Hide resolved
src/widget/wtrackmenu.cpp Outdated Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
src/widget/wtrackmenu.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@uklotzde uklotzde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a quick test run and everything seems to be working as intended. Sometimes the right-click on the track text has no effect, but I wasn't able to discover a repeatable pattern.

The new WTrackMenu is still a monster class with some flaws. Hopefully we are able to fix this later, maybe by extraction the actual tasks out of the menu and moving them into their sub-modules with a better separation of concerns. I already started to do this for the custom tags feature, which might serve as a blueprint when finished.

Good job, Harshit! Thank you for pursuing this issue and trying to incorporate all our proposed changes.

@uklotzde
Copy link
Contributor

@Be-ing LGTM. At least I don't expect any severe, unintended side-effects.

@Be-ing Be-ing merged commit f2d701f into mixxxdj:master Apr 17, 2020
@Be-ing
Copy link
Contributor

Be-ing commented Apr 17, 2020

Yay! Thank you for finally taking care of this. I have been saying for a while this would be a good little introductory project for a new contributor but no one volunteered to do it. So thanks for finally stepping up to do it. This is a big UX improvement and the code is significantly better organized too.

@hacksdump
Copy link
Contributor Author

Thanks for your prompt advice and reviews as well. I actually got to learn a lot more about code organisation and C++/Qt.

@ronso0
Copy link
Member

ronso0 commented Apr 17, 2020

Great this feature is finally implemented!!
I'll now check how to style DlgTrackInfo

@Be-ing
Copy link
Contributor

Be-ing commented Apr 17, 2020

Don't forget DlgTagFetcher too.

@ronso0
Copy link
Member

ronso0 commented Apr 17, 2020

From what I can tell from my first trials, all the styles I need to add will also allow to style the Preferences window. Ouuuweeh! A lot of work and testing required...but in the end we may have the entire Mixxx GUI themed per skin.

@uklotzde
Copy link
Contributor

Unfortunately I found a major design flaw that I didn't spot during the review. The function WTrackMenu::getTrackPointers() now loads all selected tracks into memory at once before processing them. Formerly we iterated over the TrackModel rows and loaded each single track just before processing it. After processing it was dropped (and probably saved) immediately.

This needs to be fixed before releasing 2.3.

@uklotzde
Copy link
Contributor

uklotzde commented Apr 18, 2020

Storing a potentially huge list of track pointers in memory is a bad idea.

@Be-ing
Copy link
Contributor

Be-ing commented Apr 18, 2020

I'm unclear what the problem is. WTrackMenu::getTrackPointers dynamically builds the list of TrackPointers from the TrackModel as needed; they are not stored past that.

@uklotzde
Copy link
Contributor

They are now loaded upfront instead of lazily during the iteration as before. It is only for a short time, but this will kill Mixxx for large track selections which are already an open issue.

I also found another performance hog when tracks are loaded temporarily just for collecting the model indices.

I suggest to first merge this PR before the next round of fixes. Fixing the main issue will take longer, because it requires a major rework. Maybe we can adopt the approach introduced in the Custom Tags branch. But this is still requires a lot of work.

@hacksdump
Copy link
Contributor Author

Unfortunately I found a major design flaw that I didn't spot during the review. The function WTrackMenu::getTrackPointers() now loads all selected tracks into memory at once before processing them. Formerly we iterated over the TrackModel rows and loaded each single track just before processing it. After processing it was dropped (and probably saved) immediately.

Can we use generators?

@uklotzde
Copy link
Contributor

Coroutines are a C++20 feature. Please elaborate if you have some ideas. Just mentioning buzzwords doesn't get us anywhere ;)

@uklotzde
Copy link
Contributor

@hacksdump Please don't get me wrong. It's absolutely necessary to explore the possibilities. But all those fancy features doesn't help us if we have no idea about how to leverage them.

The classical, polymorphic approach I applied in #2656 is cumbersome and requires some amount of boilerplate. Unfortunately I have no idea how to reduce this with our current set of tools, namely C++17. Any ideas?

@hacksdump
Copy link
Contributor Author

Coroutines are a C++20 feature. Please elaborate if you have some ideas. Just mentioning buzzwords doesn't get us anywhere ;)

I missed the fact that we are currently using C++17. I checked #2656 and the implementation seems promising. Thanks for pointing out the memory hogging behavior of getTrackPointers() and implementing other cleanups as well :)

I will move any further discussion to relevant PR discussion.

@daschuer
Copy link
Member

@hacksdump Thank you very much for your first contribution.
Unfortunately we have missed to ask for your permission to merge your work.
Please sign:
https://docs.google.com/a/mixxx.org/spreadsheet/viewform?formkey=dEpYN2NkVEFnWWQzbkFfM0ZYYUZ5X2c6MQ
and comment here when done.
Is is OK If we add your name to the contributor list in the Mixxx about box.

@hacksdump
Copy link
Contributor Author

Signed the form.
Sure. I'd like my name to be added in the list. Glad to be a Mixxx contributor :)

@daschuer
Copy link
Member

Done!

@LindyBalboa
Copy link
Contributor

I'm excited to try this out. Thank you!

Be-ing added a commit to Be-ing/mixxx that referenced this pull request Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants