diff options
Diffstat (limited to 'editor/find_in_files.cpp')
-rw-r--r-- | editor/find_in_files.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index 8d3f0eb21f..076b873eac 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -86,11 +86,6 @@ static bool find_next(const String &line, String pattern, int from, bool match_c } //-------------------------------------------------------------------------------- -FindInFiles::FindInFiles() { - _searching = false; - _whole_words = true; - _match_case = true; -} void FindInFiles::set_search_text(String p_pattern) { _pattern = p_pattern; @@ -388,7 +383,7 @@ FindInFilesDialog::FindInFilesDialog() { _replace_button = add_button(TTR("Replace..."), false, "replace"); _replace_button->set_disabled(true); - Button *cancel_button = get_ok(); + Button *cancel_button = get_ok_button(); cancel_button->set_text(TTR("Cancel")); _mode = SEARCH_MODE; @@ -784,7 +779,19 @@ void FindInFilesPanel::_on_item_edited() { } void FindInFilesPanel::_on_finished() { - _status_label->set_text(TTR("Search complete")); + String results_text; + int result_count = _result_items.size(); + int file_count = _file_items.size(); + + if (result_count == 1 && file_count == 1) { + results_text = vformat(TTR("%d match in %d file."), result_count, file_count); + } else if (result_count != 1 && file_count == 1) { + results_text = vformat(TTR("%d matches in %d file."), result_count, file_count); + } else { + results_text = vformat(TTR("%d matches in %d files."), result_count, file_count); + } + + _status_label->set_text(results_text); update_replace_buttons(); set_progress_visible(false); _refresh_button->show(); |