summaryrefslogtreecommitdiffstats
path: root/editor/find_in_files.h
diff options
context:
space:
mode:
authorDominik 'dreamsComeTrue' Jasiński <dominikjasinski@o2.pl>2020-02-09 10:10:58 +0100
committerDominik 'dreamsComeTrue' Jasiński <dominikjasinski@o2.pl>2020-02-13 23:45:05 +0100
commit4c80beab444b2734c1c1ee04b480ca1551e7db94 (patch)
treebe99b77efdde46ab19f2bd1a43ad65b3561be051 /editor/find_in_files.h
parent3679d49f4b709fd56e872633ead73008bc3e1c43 (diff)
downloadredot-engine-4c80beab444b2734c1c1ee04b480ca1551e7db94.tar.gz
Added 'Replace in files' functionality to text editors
Fixes issue #31146
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();