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, 9 insertions, 7 deletions
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp
index 2db4f03859..625f46f9d3 100644
--- a/editor/editor_file_dialog.cpp
+++ b/editor/editor_file_dialog.cpp
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -907,25 +907,25 @@ void EditorFileDialog::update_filters() {
const int max_filters = 5;
for (int i = 0; i < MIN(max_filters, filters.size()); i++) {
- String flt = filters[i].get_slice(";", 0);
+ String flt = filters[i].get_slice(";", 0).strip_edges();
if (i > 0)
- all_filters += ",";
+ all_filters += ", ";
all_filters += flt;
}
if (max_filters < filters.size())
all_filters += ", ...";
- filter->add_item(TTR("All Recognized") + " ( " + all_filters + " )");
+ filter->add_item(TTR("All Recognized") + " (" + all_filters + ")");
}
for (int i = 0; i < filters.size(); i++) {
String flt = filters[i].get_slice(";", 0).strip_edges();
String desc = filters[i].get_slice(";", 1).strip_edges();
if (desc.length())
- filter->add_item(desc + " ( " + flt + " )");
+ filter->add_item(desc + " (" + flt + ")");
else
- filter->add_item("( " + flt + " )");
+ filter->add_item("(" + flt + ")");
}
filter->add_item(TTR("All Files (*)"));
@@ -958,6 +958,8 @@ String EditorFileDialog::get_current_path() const {
}
void EditorFileDialog::set_current_dir(const String &p_dir) {
+ if (p_dir.is_rel_path())
+ dir_access->change_dir(OS::get_singleton()->get_resource_dir());
dir_access->change_dir(p_dir);
update_dir();
invalidate();