summaryrefslogtreecommitdiff
path: root/editor/localization_editor.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-02-16 16:39:23 +0100
committerGitHub <noreply@github.com>2022-02-16 16:39:23 +0100
commit33c7f52f361961c64432cfd772909ed3ba76cd51 (patch)
tree6c86397c3797381550815c79938522a3915d58df /editor/localization_editor.cpp
parentb5c0a892d45b1a9df10aaf0f468252925ea2a4b9 (diff)
parent8824b6c5e9dc6a24a17452ded0c800ec267f812f (diff)
Merge pull request #58169 from megalobyte/update-notificatin-if-to-switch-batch-B
Diffstat (limited to 'editor/localization_editor.cpp')
-rw-r--r--editor/localization_editor.cpp36
1 files changed, 19 insertions, 17 deletions
diff --git a/editor/localization_editor.cpp b/editor/localization_editor.cpp
index 401ba02099..cd9986d527 100644
--- a/editor/localization_editor.cpp
+++ b/editor/localization_editor.cpp
@@ -40,25 +40,27 @@
#include "scene/gui/control.h"
void LocalizationEditor::_notification(int p_what) {
- if (p_what == NOTIFICATION_ENTER_TREE) {
- translation_list->connect("button_pressed", callable_mp(this, &LocalizationEditor::_translation_delete));
- translation_pot_list->connect("button_pressed", callable_mp(this, &LocalizationEditor::_pot_delete));
-
- List<String> tfn;
- ResourceLoader::get_recognized_extensions_for_type("Translation", &tfn);
- for (const String &E : tfn) {
- translation_file_open->add_filter("*." + E);
- }
+ switch (p_what) {
+ case NOTIFICATION_ENTER_TREE: {
+ translation_list->connect("button_pressed", callable_mp(this, &LocalizationEditor::_translation_delete));
+ translation_pot_list->connect("button_pressed", callable_mp(this, &LocalizationEditor::_pot_delete));
+
+ List<String> tfn;
+ ResourceLoader::get_recognized_extensions_for_type("Translation", &tfn);
+ for (const String &E : tfn) {
+ translation_file_open->add_filter("*." + E);
+ }
- List<String> rfn;
- ResourceLoader::get_recognized_extensions_for_type("Resource", &rfn);
- for (const String &E : rfn) {
- translation_res_file_open_dialog->add_filter("*." + E);
- translation_res_option_file_open_dialog->add_filter("*." + E);
- }
+ List<String> rfn;
+ ResourceLoader::get_recognized_extensions_for_type("Resource", &rfn);
+ for (const String &E : rfn) {
+ translation_res_file_open_dialog->add_filter("*." + E);
+ translation_res_option_file_open_dialog->add_filter("*." + E);
+ }
- _update_pot_file_extensions();
- pot_generate_dialog->add_filter("*.pot");
+ _update_pot_file_extensions();
+ pot_generate_dialog->add_filter("*.pot");
+ } break;
}
}