summaryrefslogtreecommitdiff
path: root/editor/find_in_files.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-02-14 20:30:53 +0100
committerGitHub <noreply@github.com>2020-02-14 20:30:53 +0100
commit710d8298868259afc8eb06d19f5f362f70f6b5bc (patch)
tree1ce33e4950fd5bc2eadd71040330702b6f94faf0 /editor/find_in_files.h
parentca877916880cfd5544640d5ba115ee250ad58d8e (diff)
parent4c80beab444b2734c1c1ee04b480ca1551e7db94 (diff)
Merge pull request #36044 from dreamsComeTrue/fix-replace-all-shortcut
Added 'Replace in files' functionality to text editors
Diffstat (limited to 'editor/find_in_files.h')
-rw-r--r--editor/find_in_files.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/editor/find_in_files.h b/editor/find_in_files.h
index 327c3f1b5a..243f59096a 100644
--- a/editor/find_in_files.h
+++ b/editor/find_in_files.h
@@ -97,14 +97,23 @@ class FindInFilesDialog : public AcceptDialog {
GDCLASS(FindInFilesDialog, AcceptDialog);
public:
+ enum FindInFilesMode {
+ SEARCH_MODE,
+ REPLACE_MODE
+ };
+
static const char *SIGNAL_FIND_REQUESTED;
static const char *SIGNAL_REPLACE_REQUESTED;
FindInFilesDialog();
void set_search_text(String text);
+ void set_replace_text(String text);
+
+ void set_find_in_files_mode(FindInFilesMode p_mode);
String get_search_text() const;
+ String get_replace_text() const;
bool is_match_case() const;
bool is_whole_words() const;
String get_folder() const;
@@ -121,8 +130,14 @@ private:
void _on_folder_selected(String path);
void _on_search_text_modified(String text);
void _on_search_text_entered(String text);
+ void _on_replace_text_entered(String text);
+ FindInFilesMode _mode;
LineEdit *_search_text_line_edit;
+
+ Label *_replace_label;
+ LineEdit *_replace_text_line_edit;
+
LineEdit *_folder_line_edit;
CheckBox *_match_case_checkbox;
CheckBox *_whole_words_checkbox;
@@ -151,6 +166,7 @@ public:
FindInFiles *get_finder() const { return _finder; }
void set_with_replace(bool with_replace);
+ void set_replace_text(String text);
void start_search();
void stop_search();