Merge pull request #8515 from attilix/folder-file-manager

Right-clicking a folder now gives the option Show in file manager
This commit is contained in:
Rémi Verschelde 2017-04-27 08:11:05 +02:00 committed by GitHub
commit d730ee66a4
2 changed files with 10 additions and 1 deletions

View file

@ -1065,6 +1065,11 @@ void FileSystemDock::_folder_option(int p_option) {
child = child->get_next(); child = child->get_next();
} }
break; break;
case FOLDER_SHOW_IN_EXPLORER:
String path = item->get_metadata(tree->get_selected_column());
String dir = GlobalConfig::get_singleton()->globalize_path(path);
OS::get_singleton()->shell_open(String("file://") + dir);
return;
} }
} }
@ -1103,6 +1108,9 @@ void FileSystemDock::_dir_rmb_pressed(const Vector2 &p_pos) {
folder_options->add_item(TTR("Expand all"), FOLDER_EXPAND_ALL); folder_options->add_item(TTR("Expand all"), FOLDER_EXPAND_ALL);
folder_options->add_item(TTR("Collapse all"), FOLDER_COLLAPSE_ALL); folder_options->add_item(TTR("Collapse all"), FOLDER_COLLAPSE_ALL);
folder_options->add_separator();
folder_options->add_item(TTR("Show In File Manager"), FOLDER_SHOW_IN_EXPLORER);
folder_options->set_position(tree->get_global_position() + p_pos); folder_options->set_position(tree->get_global_position() + p_pos);
folder_options->popup(); folder_options->popup();
} }

View file

@ -76,7 +76,8 @@ private:
enum FolderMenu { enum FolderMenu {
FOLDER_EXPAND_ALL, FOLDER_EXPAND_ALL,
FOLDER_COLLAPSE_ALL FOLDER_COLLAPSE_ALL,
FOLDER_SHOW_IN_EXPLORER
}; };
VBoxContainer *scanning_vb; VBoxContainer *scanning_vb;