diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-06-08 07:55:04 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-06-08 07:55:04 -0300 |
commit | 1b3fd498a33151a1029a3235bb77e3c6bcb81a64 (patch) | |
tree | 854cd03055d34f492ba4281a5118653f75977618 | |
parent | 3d95c82669ebcbee15e04574aa179a3da2e712a3 (diff) | |
parent | be867f387781913f7ffdecc4332f7e0978789f5c (diff) |
Merge pull request #5089 from Hinsbart/resdock_copy_path
Add a "copy path" item to the filesystem dock context menu.
-rw-r--r-- | tools/editor/scenes_dock.cpp | 7 | ||||
-rw-r--r-- | tools/editor/scenes_dock.h | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/tools/editor/scenes_dock.cpp b/tools/editor/scenes_dock.cpp index 2ac439491d..7c61e3d4a1 100644 --- a/tools/editor/scenes_dock.cpp +++ b/tools/editor/scenes_dock.cpp @@ -1101,7 +1101,13 @@ void ScenesDock::_file_option(int p_option) { } } break; + case FILE_COPY_PATH: + int idx = files->get_current(); + if (idx<0 || idx>=files->get_item_count()) + break; + String path = files->get_item_metadata(idx); + OS::get_singleton()->set_clipboard(path); } } @@ -1545,6 +1551,7 @@ void ScenesDock::_files_list_rmb_select(int p_item,const Vector2& p_pos) { } if (filenames.size()==1) { + file_options->add_item(TTR("Copy Path"), FILE_COPY_PATH); file_options->add_item(TTR("Rename or Move.."),FILE_MOVE); } else { file_options->add_item(TTR("Move To.."),FILE_MOVE); diff --git a/tools/editor/scenes_dock.h b/tools/editor/scenes_dock.h index 9a0d6c87cf..ed24711abb 100644 --- a/tools/editor/scenes_dock.h +++ b/tools/editor/scenes_dock.h @@ -63,7 +63,8 @@ class ScenesDock : public VBoxContainer { FILE_REMOVE, FILE_REIMPORT, FILE_INFO, - FILE_SHOW_IN_EXPLORER + FILE_SHOW_IN_EXPLORER, + FILE_COPY_PATH }; |