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

Filesystem drag & drop moving fixes #12402

Merged
merged 2 commits into from
Nov 10, 2017

Conversation

ghost
Copy link

@ghost ghost commented Oct 25, 2017

Fixes to drag & drop functionality regarding dragging items / resources around the filesystem dock.

  • Disallow dragging a folder into itself from being a valid move (One issue in Editor: FileSystem drawer UI improvements #12322)
  • Fix dragging a file/folder onto the "Favourites:" item starting an invalid move (Mentioned in Filesystem dock folder handling #11428)
  • Fix the save as functionality when dragging a resource onto the filesystem.
    This used to fail on clicking save with the error:
    ERROR: EditorNode::_dialog_action: Condition ' !Object::cast_to<Resource>(current_obj) ' is true. At: editor\editor_node.cpp:1189
  • Allow dragging folders/files onto of files / empty space in the files list. This will just use the currently open folder.
  • Don't show moving a file to the location it currently is in as invalid.
  • Pulled some common code out into a helper method.

@akien-mga
Copy link
Member

@MillionOstrich This PR and the yet unmerged #10261 will surely conflict as there must be a lot of overlap. Could you help review that one to speed up the process? cc @Cradmon

@ghost
Copy link
Author

ghost commented Oct 26, 2017

As a heads up #12390 may also conflict with that PR but from a quick scan through in both cases the conflict should be straight forward to fix if you want to merge #10261 first. I can have a closer look at that PR in more detail this evening.

@Cradmon
Copy link
Contributor

Cradmon commented Oct 26, 2017

After reviewing the mentioned PRs. The changes I made that are overlapping are minor refactoring only, so should be relatively easy to merge.

@akien-mga
Copy link
Member

Needs rebasing after #10261.

MillionOstrich added 2 commits November 3, 2017 20:49
If a folder would be moved to an invalid location disallow the drag
Don't treat dragging a file/folder to its current location as invalid
Allow dragging onto empty space / files in the files list
Fix dragging a folder onto "Favourites" starting an invalid move
Call push_item before save_resource_as because the save button uses editor_history current.
Reject the drop in can_drop_data if it isn't on a folder or the files list.
Removed some duplicated code
@ghost ghost force-pushed the filesystem-drag-move branch from 61a6809 to 078371c Compare November 3, 2017 21:18
@akien-mga akien-mga merged commit 98d9423 into godotengine:master Nov 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants