summaryrefslogtreecommitdiff
path: root/editor/editor_file_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_file_dialog.cpp')
-rw-r--r--editor/editor_file_dialog.cpp16
1 files changed, 12 insertions, 4 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());
+ }
}
}