summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2016-05-21 11:29:40 +0200
committerRémi Verschelde <remi@verschelde.fr>2016-05-21 11:29:40 +0200
commit674cfe21d3b4e8db0aac548c4c579a55503201a0 (patch)
treedbe4ca4cc1cc7ff5b2c13dcfe2335e81cbaa385d /tools/editor
parentbc8df8feaafd4e9ce0daa383f772ff111073c672 (diff)
parent5ad648097930e46df3d23f514e8bc08fa00b31f5 (diff)
Merge pull request #4700 from Geequlim/filesystem-show_in_explore
Add 'Show In System' option into filesystem RMB menu
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/scenes_dock.cpp17
-rw-r--r--tools/editor/scenes_dock.h3
2 files changed, 18 insertions, 2 deletions
diff --git a/tools/editor/scenes_dock.cpp b/tools/editor/scenes_dock.cpp
index e00f470bc4..a068bdf58b 100644
--- a/tools/editor/scenes_dock.cpp
+++ b/tools/editor/scenes_dock.cpp
@@ -944,6 +944,7 @@ void ScenesDock::_file_option(int p_option) {
switch(p_option) {
+ case FILE_SHOW_IN_EXPLORER:
case FILE_OPEN: {
int idx=-1;
for(int i=0;i<files->get_item_count();i++) {
@@ -959,6 +960,17 @@ void ScenesDock::_file_option(int p_option) {
String path = files->get_item_metadata(idx);
+ if (p_option == FILE_SHOW_IN_EXPLORER) {
+ String dir = DirAccess::get_full_path("res://", DirAccess::ACCESS_FILESYSTEM);
+ const int res_begin = String("res://").length();
+ const int last_sep = path.find_last("/");
+ if (last_sep > res_begin) {
+ dir += "/";
+ dir += path.substr(res_begin, last_sep - res_begin);
+ }
+ OS::get_singleton()->shell_open(String("file://")+dir);
+ return;
+ }
if (path.ends_with("/")) {
if (path!="res://") {
@@ -1416,6 +1428,10 @@ void ScenesDock::_files_list_rmb_select(int p_item,const Vector2& p_pos) {
file_options->add_item(TTR("Delete"),FILE_REMOVE);
//file_options->add_item(TTR("Info"),FILE_INFO);
+
+ file_options->add_separator();
+ file_options->add_item(TTR("Show In System"),FILE_SHOW_IN_EXPLORER);
+
file_options->set_pos(files->get_global_pos() + p_pos);
file_options->popup();
@@ -1635,4 +1651,3 @@ ScenesDock::ScenesDock(EditorNode *p_editor) {
ScenesDock::~ScenesDock() {
}
-
diff --git a/tools/editor/scenes_dock.h b/tools/editor/scenes_dock.h
index 327e5a25f0..42c1374be1 100644
--- a/tools/editor/scenes_dock.h
+++ b/tools/editor/scenes_dock.h
@@ -62,7 +62,8 @@ class ScenesDock : public VBoxContainer {
FILE_MOVE,
FILE_REMOVE,
FILE_REIMPORT,
- FILE_INFO
+ FILE_INFO,
+ FILE_SHOW_IN_EXPLORER
};