diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_file_dialog.cpp | 16 | ||||
-rw-r--r-- | editor/editor_file_dialog.h | 2 |
2 files changed, 13 insertions, 5 deletions
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 33c6c77e53..b6d8ea5bd6 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -230,7 +230,14 @@ Vector<String> EditorFileDialog::get_selected_files() const { void EditorFileDialog::update_dir() { if (drives->is_visible()) { - drives->select(dir_access->get_current_drive()); + if (dir_access->get_current_dir().is_network_share_path()) { + _update_drives(false); + drives->add_item(RTR("Network")); + drives->set_item_disabled(drives->get_item_count() - 1, true); + drives->select(drives->get_item_count() - 1); + } else { + drives->select(dir_access->get_current_drive()); + } } dir->set_text(dir_access->get_current_dir(false)); @@ -1152,7 +1159,7 @@ void EditorFileDialog::_select_drive(int p_idx) { _push_history(); } -void EditorFileDialog::_update_drives() { +void EditorFileDialog::_update_drives(bool p_select) { int dc = dir_access->get_drive_count(); if (dc == 0 || access != ACCESS_FILESYSTEM) { drives->hide(); @@ -1170,8 +1177,9 @@ void EditorFileDialog::_update_drives() { String d = dir_access->get_drive(i); drives->add_item(dir_access->get_drive(i)); } - - drives->select(dir_access->get_current_drive()); + if (p_select) { + drives->select(dir_access->get_current_drive()); + } } } diff --git a/editor/editor_file_dialog.h b/editor/editor_file_dialog.h index 16077cbfb9..6cfdf53780 100644 --- a/editor/editor_file_dialog.h +++ b/editor/editor_file_dialog.h @@ -180,7 +180,7 @@ private: void _delete_items(); - void _update_drives(); + void _update_drives(bool p_select = true); void _go_up(); void _go_back(); |