You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-06 17:25:19 +00:00
Add "Replace in Files" functionality to text editors
The Soft Reload Script shortcut was changed from Ctrl + Shift + R to Ctrl + Alt + R to avoid conflicts.
This commit is contained in:
committed by
Hugo Locurcio
parent
c3606a87fe
commit
7bd0eae635
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user