-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Remove from disk menu item #1737
Conversation
Thank you for the PR. mixxx/src/recording/recordingmanager.cpp Line 297 in 1c29f2a
|
@@ -448,6 +448,10 @@ void WTrackTableView::createActions() { | |||
connect(m_pFileBrowserAct, SIGNAL(triggered()), | |||
this, SLOT(slotOpenInFileBrowser())); | |||
|
|||
m_pFileRemoveFromDiskAct = new QAction(tr("Remove from Disk"),this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Remove word is already used. The file does not necessary stored on a disk.
How about "Delete from file system"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.
why not just 'Delete File'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an action the users should do only when it is REALY intended.
So we should make it as clear as possible. I am not sure if "File" is clear for all non technic nerds and after it is translated to various languages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer "Delete file". I'm more concerned about users not understanding what a "file system" or "disk" is than a "file".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like "Delete File" or "Move To Trash"
A "Also hide track in library" is hard to understand. This gives the chance to optimize the feature for the underlying use cases.
What are you use cases? Can we reflect that in the dialog? |
The message Box should show also the path from the file to delete. |
I am unsure how to make "Also hide track" checkbox, easier to understand. Please, feel free to write me a message. |
The 'remove from disk' can remove multiple files at a time.. so, each file should be in a list that gets displayed in the message? |
Yes. |
First we have to clarify the use cases. |
Yes, I think you've got a complete list. |
As for model, it does not stop mixxx. It prevents access to the UI, yes, but mixxx itself does not stop. Nor the UI, or the music. The only thing that the model dialog does, is prevents a mouse/keyboard event inside mixxx. And to be fair, it is asking an important question. |
Thanks for picking this up!
Please show the complete file name & path so users can be sure to remove the track from the right subfolder (.../music/AlbumXY-copy/...) and catch the file extension as well as individual appendixes like 'supertrack_preview.mp3' |
} | ||
QString filenameWithPath = trackModel->getTrackLocation(index); | ||
QFile file (filenameWithPath); | ||
file.remove(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's handle failure to remove -- keep a list of filenames that we couldn't remove and let the user know somehow...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, two lists, a to do list with the dialog, and a dialog that shows any error, with a list of files which did not get deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we find out the reason deletion failed?
File doesn't exist? no write access/rights?
The 'Success/Error' window could show either "OK" or a list:
- inexistant files
- failed deletions (try again?)
I realize it might be a not-so-common use case and hard to accomplish, but in case of deletion fails (partly) and the error window was closed, could the track view select the 'failed' tracks?
|
||
QModelIndexList indices = selectionModel()->selectedRows(); | ||
|
||
for (const QModelIndex& index : indices) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The list could contain duplicate paths -- let's de-dupe first.
} | ||
if( alsoHide.checkState() == Qt::Checked ) | ||
{ | ||
trackModel->hideTracks(indices); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be a purge? if the file is gone we should probably permanently remove the metadata too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That depends on the desired use case.
I will try to propose texts to distinguish it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to purge using trackModel->purgeTracks but.. it didn't work. not sure why. Even did hideTracks then purgeTracks. They stayed in hidden. So.. kinda stumped.
It'd be nice to add some unit tests for this feature, since it's quite dangerous, though WTrackTableView is difficult to test. |
Something like this: [ ] Delete and replace crates and playlist entried with a successor track. Not perfect, but an idea. |
[ ] Delete and replace crates and playlist entried with a successor track. [ ] Delete track and mark as missing. |
We have "hide" this is original for hiding podcasts or other non music tracks. The track is moved to hidden tracks. This prevents the track from appearing again after library scan. Than we have Purge, which removes the track from library as if it was never there. The problematic thing here is the history. Looking at the wall of possible option, it can be anoying if a user just want to delete a bad track that was just added. We can think about reverting the logic. If this is not the case we reject the delete: |
Alternative, for the case crate an playlist entried are found: [ ] Just delete track file and keep references for a successor track. |
if (!trackModel) { | ||
return; | ||
} | ||
QMessageBox msgBox (QMessageBox::Information, QObject::tr("Remove From Disk"), QObject::tr("Really delete the files from disk? (Permanent Deletion)")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a simple and explicit question, no frills. The text is too complicated for confirming an irreversible action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about: "Are you sure you want to permanently delete this file?"/"Are you sure you want to permanently delete these files?" It would be nice if the code could distinguish between having a single file selected and multiple files selected to show the appropriate string. Also, I'd like to see the paths of files before deleting them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about "This will move one or more files to the Recycle Bin, are you sure you want to continue?"
I feel that some of the less computer literate think of the Recycle Bin as a keyword almost.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a permanent deletion, from the disk. It doesn't go to the recycle bin, it's simply unlinked? @uklotzde , do you have a suggestion as to wording? This is a pretty scary action.
@@ -1061,6 +1099,7 @@ void WTrackTableView::contextMenuEvent(QContextMenuEvent* event) { | |||
m_pMenu->addAction(m_pPurgeAct); | |||
} | |||
m_pMenu->addAction(m_pFileBrowserAct); | |||
m_pMenu->addAction(m_pFileRemoveFromDiskAct); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this action is not used very often and at least not while performing. It doesn't deserve enlarging and cluttering the top level layer of the context menu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about a Hide / Delete
submenu?
Could this hold items that distinguish between Hide, Delete but keep in history, Delete & Purge etc. or is it better to decide that per file in the dialog window?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not too worried about cluttering context menu... How often do you really right-click while performing? I do most of my file selection with a hardware controller and never touch a mouse anyways. I would not want another dialog box for each file... If I selected a range, then hit purge, the software purge everything I selected...
src/widget/wtracktableview.cpp
Outdated
if (QMessageBox::Yes == msgBox.exec()) | ||
{ | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style nitpicks:
- Delete extra blank lines.
- Put brackets on same line as if/else statements:
if (condition == true) {
foo();
} else {
bar();
}
There is now a merge conflict with master. |
This works well, thank you! Any special cases that deserve further testing? |
Is it really to late to merge this into 2.3? |
The requested changes have not been resolved, yet. This action performs a destructive task that must be save to use. |
It is still unclear if the corresponding track of a deleted file should be purged from the library. |
I'm not necessarily referring to Mixxx recordings. There might also be external files from a mobile recorder or another app, also files might be quite small like aborted Mixxx recordings, or field recording snippets. |
Conflicts resolved: src/widget/wtracktableview.cpp
merge conflicts are resolved here https://github.com/WaylonR/mixxx/pull/2 |
@WaylonR would you mind merging https://github.com/WaylonR/mixxx/pull/2 ? |
Sorry if this isn't the way you like to hear it, but BUMP. This is a killer feature I'd love to have yesterday. I'm not really comfortable diving into the code on a project of this scale, but if you want to bounce UI ideas or test cases off of me, feel free. |
It's not so intimidating to get into such a big project once you have an IDE set up to navigate the code easily. I felt intimidated for a while until I got KDevelop setup. Now that we are using CMake on the master branch, most C++ IDEs are easy to set up. |
Remove from disk: merge master, fix conflicts
Looking to resolve this, I can't find the Hide action anymore? Only the Purge action. |
Converted to Draft as there are a few open UI issues before we can implement it. |
I'll pick this up soonish because I miss it in my personal builds. I'll only try to restore the current state, not sure if I find the time to add the dialogs we talked about. |
I've ported this to 2.3 https://github.com/ronso0/mixxx/tree/remove-from-disk-2.3 to have it available in my 2.3 builds I use live. Shouldn't be too hard to apply it to master. |
There are merge conflicts now. |
I'll take care of the conflicts. (seems I screwed it up earlier) |
Looking closer I think it's way easier to start over. I recommend to close this. |
please @notify me when this is picked up in another PR. might get around to doing it again, myself. I've been using a artifact from an old main branch compile, and been missing the feature. |
I just spent my time after dinner to rebuild this onto mas.. main. I'll open a draft PR during the weekend and we can discuss where else it is needed, and how to tweak the user dialog. |
...because I missed it a lot since having rebuil my Live branch onto main. |
Method to remove a track from disk, and optionally hides it from the library, moving it to 'hidden' tracks. Will go to 'missing' after a rescan.