Skip to content

[ENH] OWPythonScript: dropping and pasting of python scripts#3611

Merged
janezd merged 2 commits intobiolab:masterfrom
markotoplak:script-drop
Mar 1, 2019
Merged

[ENH] OWPythonScript: dropping and pasting of python scripts#3611
janezd merged 2 commits intobiolab:masterfrom
markotoplak:script-drop

Conversation

@markotoplak
Copy link
Member

@markotoplak markotoplak commented Feb 18, 2019

Issue

Drag and drop of files did not work in the Python script widget

Description of changes

Files can be dragged and dropped (or pasted) onto the script editor or widget's control area. Nothing changed for dropping or pasting text.

Includes
  • Code changes
  • Tests
  • Documentation

@markotoplak
Copy link
Member Author

As @BlazZupan suggested, now, this widgets pop ups a dialog that asks whether to replace the current script or append to it.

Another option (that I prefer) is to never ask and always insert the text at the cursor position.

@codecov
Copy link

codecov bot commented Feb 18, 2019

Codecov Report

Merging #3611 into master will increase coverage by 0.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #3611      +/-   ##
==========================================
+ Coverage   84.24%   84.26%   +0.01%     
==========================================
  Files         370      370              
  Lines       67475    67565      +90     
==========================================
+ Hits        56844    56932      +88     
- Misses      10631    10633       +2

The current script is replaced (in an undoable way) with the pasted
script.
@markotoplak markotoplak changed the title [WIP][ENH] OWPythonScript: dropping and pasting of python scripts [ENH] OWPythonScript: dropping and pasting of python scripts Mar 1, 2019
@markotoplak
Copy link
Member Author

We talked about it with @BlazZupan and we decided that if a user drags/pastes in a file, the current script is replaced with that file (there are no pop-up dialogs asking you where to put it as in the first attempt). I took care that undo still works.

@janezd janezd merged commit b018143 into biolab:master Mar 1, 2019
@markotoplak markotoplak deleted the script-drop branch March 8, 2019 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants