This commit is contained in:
Spartan322
2025-02-11 19:47:38 -05:00
512 changed files with 465820 additions and 117157 deletions

View File

@@ -666,9 +666,11 @@ void FileDialog::_tree_selected() {
} else {
set_ok_button_text(ETR("Open"));
}
} else if (mode == FILE_MODE_OPEN_DIR || mode == FILE_MODE_OPEN_ANY) {
} else if (mode == FILE_MODE_OPEN_DIR || mode == FILE_MODE_OPEN_ANY || !dir_access->file_exists(file->get_text())) {
file->set_text("");
set_ok_button_text(ETR("Select This Folder"));
if (mode == FILE_MODE_OPEN_DIR || mode == FILE_MODE_OPEN_ANY) {
set_ok_button_text(ETR("Select This Folder"));
}
}
get_ok_button()->set_disabled(_is_open_should_be_disabled());
@@ -933,6 +935,7 @@ void FileDialog::update_file_list() {
// Select the first file from list if nothing is selected.
if (tree->get_root() && tree->get_root()->get_first_child() && tree->get_selected() == nullptr) {
tree->get_root()->get_first_child()->select(0);
_tree_selected();
}
}
}
@@ -951,6 +954,7 @@ void FileDialog::_filename_filter_changed() {
void FileDialog::_tree_select_first() {
if (tree->get_root() && tree->get_root()->get_first_child()) {
tree->get_root()->get_first_child()->select(0);
_tree_selected();
}
}