Registered Member
|
A feature that would greatly stream line my movie consumption (is this a good thing?) would be the ability to drag-n-drop from the file-selection dialog to my VLC playlist window.
Being a coder I decided to look at the code and see how reasonable this would be to implement. I cannot even find the actual GUI code for the file list. I can find the models, but not the code that captures UI events and things (which I need to implement drag-n-drop) I'm a fairily experience C++ coder, but this would be my first time using Qt. Links I'm using as reference: http://doc.trolltech.com/4.3/dnd.html Thank you. |
Moderator
|
Use this, most of the manual UI stuff is handled by the Model View classes :
http://doc.trolltech.com/4.4/model-view-dnd.html As for code you need to modify : TorrentFileListModel and TorrentFileTreeModel (libktcore/torrent/) FileSelectDlg (ktorrent/fileselectdlg.cpp) FileView (plugins/infowidget/fileview.cpp) |
Registered Member
|
What is the proper way to submit a patch?
Known Bugs: Directories in treeview are not supported. They will "drag" an empty string. |
Registered Member
|
It seems I may have spoken too soon.
For mutli-file torrents I can do indexToFile(index)->getPathOnDisk(); But for single file torrents this returns an empty string. Right now I am doing: tc->getDataDir() + tc->getStats().torrent_name; This only seems to work if the file view is set to list and not tree. |
Registered Member
|
I found the code I needed in FileView::open for directories and single file torrents.
Now the only caveat is that if you dragged a file from KTorrent to say Dolphin it would be the same as dragging a file from one Dolphin window to another. So if the user chooses "move" (the default) it will move the file to the specified location w/o updating KTorrent of the file's new location. I'm not sure if there is a way around this. I've already specified the action as "copy only" but apparently that only applies to the URL data itself not the data that it is pointing to. There is also no discrimination between complete, incomplete, preview-able, etc. I'm not sure if this is desired behavior or not either. However, I am happy with it. |
Moderator
|
Just send it by e-mail |
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft