Bug 321097

Summary: Drag and drop files should open the file not paste the URL
Product: [Applications] okteta Reporter: martonmiklos <martonmiklosqdev>
Component: generalAssignee: Friedrich W. H. Kossebau <kossebau>
Status: RESOLVED NOT A BUG    
Severity: wishlist Keywords: investigated, triaged
Priority: NOR    
Version First Reported In: 0.10.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description martonmiklos 2013-06-13 09:39:59 UTC
Dropping a file onto Okteta when a file is already open causes the filename of the dropped file to be inserted into the binary.

Reproducible: Always

Steps to Reproduce:
- Open a file in Okteta.
- Drop any other file onto a byte in the binary view area.


Actual Results:  
- The URL of the file is inserted into the binary.

Expected Results:  
- The file should be opened in a new tab.

I have the ability to fix this, I just would like to get some kind of approval.
Comment 1 Friedrich W. H. Kossebau 2013-06-13 10:05:20 UTC
Hi martonmiklos,

thanks for your report and the offer to patch/fix it!

With Okteta, if you want the files behind the url(s) in the Drag'n'Drop opened you have to do the drop over either the empty canvas (if no file is loaded yet) or next to the existing tabs. (not onto existing tabs though, for some reasons they these days seem to wrongly claim to accept drops as well, have to investigate how to block that, but that is a different bug).

Dropping over existing content IMHO means inserting to that content (I really dislike it that this is not the case with KWrite etc), so that is why I implemented it this way.
What is missing there is the option to not insert the text of the url(s) but to also offer to alternatively insert the content of the file(s) behind the url(s). But that needs some extension of the existing framework I yet have to do, because the same logic should also introduce e.g. support for parsing input and converting it to a byte stream, cmp. https://bugs.kde.org/show_bug.cgi?id=230895

On my plate for this year to do this. But different bug.

So going to close this bug as INVALID, because the wanted functionality is there, just not where expected. Which means there is a problem still, because there is no indication what drops are supported and what will happen on a drop. And everyone transfers their knowledge/expectations from KWrite & Co. :/

Any good idea how to highlight dropping areas and also how to tell what will happen on the drop?
Perhaps the empty canvas could tell "Drop here to load files" and with existing tabs there could be a temporary field besides the tabs which signals to be the place to drop urls for having them loaded...

Cheers
Friedrich
Comment 2 martonmiklos 2013-06-13 10:52:14 UTC
Hello Friedrich,

I have not realized that the drag&drop works as expected next to the tabs. 
I agree with you that Okteta should support dropping the file contents, but I would like to propose different method to achieve this funcitionality.  A context menu should be shown on drop events with the following options (the KDE drag&drop also have this menu):
- Insert file contents here
- Open file in new tab

Cheers,
Miklós
Comment 3 Andrew Crouthamel 2018-09-19 14:34:27 UTC
This bug has had its resolution changed, but accidentally has been left in NEEDSINFO status. I am thus closing this bug and setting the status as RESOLVED to reflect the resolution change.