diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp index f70730d54012..73ccfd0564ef 100644 --- a/editor/action_map_editor.cpp +++ b/editor/action_map_editor.cpp @@ -614,7 +614,7 @@ ActionMapEditor::ActionMapEditor() { // Adding event dialog event_config_dialog = memnew(InputEventConfigurationDialog); - event_config_dialog->connect("confirmed", callable_mp(this, &ActionMapEditor::_event_config_confirmed)); + event_config_dialog->connect(SceneStringName(confirmed), callable_mp(this, &ActionMapEditor::_event_config_confirmed)); add_child(event_config_dialog); message = memnew(AcceptDialog); diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 8e7d1e30cd33..f2575f2e1d2b 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -7314,7 +7314,7 @@ AnimationTrackEditor::AnimationTrackEditor() { snap_mode->add_item(TTR("Seconds")); snap_mode->add_item(TTR("FPS")); bottom_hb->add_child(snap_mode); - snap_mode->connect("item_selected", callable_mp(this, &AnimationTrackEditor::_snap_mode_changed)); + snap_mode->connect(SceneStringName(item_selected), callable_mp(this, &AnimationTrackEditor::_snap_mode_changed)); snap_mode->set_disabled(true); bottom_hb->add_child(memnew(VSeparator)); @@ -7406,7 +7406,7 @@ AnimationTrackEditor::AnimationTrackEditor() { insert_confirm = memnew(ConfirmationDialog); add_child(insert_confirm); - insert_confirm->connect("confirmed", callable_mp(this, &AnimationTrackEditor::_confirm_insert_list)); + insert_confirm->connect(SceneStringName(confirmed), callable_mp(this, &AnimationTrackEditor::_confirm_insert_list)); VBoxContainer *icvb = memnew(VBoxContainer); insert_confirm->add_child(icvb); insert_confirm_text = memnew(Label); @@ -7463,7 +7463,7 @@ AnimationTrackEditor::AnimationTrackEditor() { optimize_vb->add_margin_child(TTR("Max Precision Error:"), optimize_precision_error); optimize_dialog->set_ok_button_text(TTR("Optimize")); - optimize_dialog->connect("confirmed", callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_OPTIMIZE_ANIMATION_CONFIRM)); + optimize_dialog->connect(SceneStringName(confirmed), callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_OPTIMIZE_ANIMATION_CONFIRM)); // cleanup_dialog = memnew(ConfirmationDialog); @@ -7498,7 +7498,7 @@ AnimationTrackEditor::AnimationTrackEditor() { cleanup_dialog->set_title(TTR("Clean-Up Animation(s) (NO UNDO!)")); cleanup_dialog->set_ok_button_text(TTR("Clean-Up")); - cleanup_dialog->connect("confirmed", callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_CLEAN_UP_ANIMATION_CONFIRM)); + cleanup_dialog->connect(SceneStringName(confirmed), callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_CLEAN_UP_ANIMATION_CONFIRM)); // scale_dialog = memnew(ConfirmationDialog); @@ -7510,13 +7510,13 @@ AnimationTrackEditor::AnimationTrackEditor() { scale->set_max(99999); scale->set_step(0.001); vbc->add_margin_child(TTR("Scale Ratio:"), scale); - scale_dialog->connect("confirmed", callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_SCALE_CONFIRM)); + scale_dialog->connect(SceneStringName(confirmed), callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_SCALE_CONFIRM)); add_child(scale_dialog); // ease_dialog = memnew(ConfirmationDialog); ease_dialog->set_title(TTR("Select Transition and Easing")); - ease_dialog->connect("confirmed", callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_EASE_CONFIRM)); + ease_dialog->connect(SceneStringName(confirmed), callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_EASE_CONFIRM)); add_child(ease_dialog); GridContainer *ease_grid = memnew(GridContainer); ease_grid->set_columns(2); @@ -7558,7 +7558,7 @@ AnimationTrackEditor::AnimationTrackEditor() { // bake_dialog = memnew(ConfirmationDialog); bake_dialog->set_title(TTR("Animation Baker")); - bake_dialog->connect("confirmed", callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_BAKE_ANIMATION_CONFIRM)); + bake_dialog->connect(SceneStringName(confirmed), callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_BAKE_ANIMATION_CONFIRM)); add_child(bake_dialog); GridContainer *bake_grid = memnew(GridContainer); bake_grid->set_columns(2); @@ -7603,7 +7603,7 @@ AnimationTrackEditor::AnimationTrackEditor() { track_copy_select->set_v_size_flags(SIZE_EXPAND_FILL); track_copy_select->set_hide_root(true); track_copy_vbox->add_child(track_copy_select); - track_copy_dialog->connect("confirmed", callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_COPY_TRACKS_CONFIRM)); + track_copy_dialog->connect(SceneStringName(confirmed), callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_COPY_TRACKS_CONFIRM)); } AnimationTrackEditor::~AnimationTrackEditor() { diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index b7afa1096b6e..4966fd362a65 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -776,7 +776,7 @@ ConnectDialog::ConnectDialog() { method_tree->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); method_tree->set_v_size_flags(Control::SIZE_EXPAND_FILL); method_tree->set_hide_root(true); - method_tree->connect("item_selected", callable_mp(this, &ConnectDialog::_method_selected)); + method_tree->connect(SceneStringName(item_selected), callable_mp(this, &ConnectDialog::_method_selected)); method_tree->connect("item_activated", callable_mp((Window *)method_popup, &Window::hide)); empty_tree_label = memnew(Label(TTR("No method found matching given filters."))); @@ -1613,7 +1613,7 @@ ConnectionsDock::ConnectionsDock() { disconnect_all_dialog = memnew(ConfirmationDialog); add_child(disconnect_all_dialog); - disconnect_all_dialog->connect("confirmed", callable_mp(this, &ConnectionsDock::_disconnect_all)); + disconnect_all_dialog->connect(SceneStringName(confirmed), callable_mp(this, &ConnectionsDock::_disconnect_all)); disconnect_all_dialog->set_text(TTR("Are you sure you want to remove all connections from this signal?")); class_menu = memnew(PopupMenu); @@ -1641,7 +1641,7 @@ ConnectionsDock::ConnectionsDock() { add_child(slot_menu); connect_dialog->connect("connected", callable_mp(this, &ConnectionsDock::_make_or_edit_connection)); - tree->connect("item_selected", callable_mp(this, &ConnectionsDock::_tree_item_selected)); + tree->connect(SceneStringName(item_selected), callable_mp(this, &ConnectionsDock::_tree_item_selected)); tree->connect("item_activated", callable_mp(this, &ConnectionsDock::_tree_item_activated)); tree->connect(SceneStringName(gui_input), callable_mp(this, &ConnectionsDock::_tree_gui_input)); diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 2b36b9254cca..3aaae9d52c66 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -447,11 +447,11 @@ void CreateDialog::_sbox_input(const Ref &p_ie) { void CreateDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - connect("confirmed", callable_mp(this, &CreateDialog::_confirmed)); + connect(SceneStringName(confirmed), callable_mp(this, &CreateDialog::_confirmed)); } break; case NOTIFICATION_EXIT_TREE: { - disconnect("confirmed", callable_mp(this, &CreateDialog::_confirmed)); + disconnect(SceneStringName(confirmed), callable_mp(this, &CreateDialog::_confirmed)); } break; case NOTIFICATION_VISIBILITY_CHANGED: { @@ -777,7 +777,7 @@ CreateDialog::CreateDialog() { recent->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); rec_vb->add_margin_child(TTR("Recent:"), recent, true); recent->set_allow_reselect(true); - recent->connect("item_selected", callable_mp(this, &CreateDialog::_history_selected)); + recent->connect(SceneStringName(item_selected), callable_mp(this, &CreateDialog::_history_selected)); recent->connect("item_activated", callable_mp(this, &CreateDialog::_history_activated)); recent->add_theme_constant_override("draw_guides", 1); diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp index 1a1817d69d3c..4c4318a89efd 100644 --- a/editor/debugger/editor_profiler.cpp +++ b/editor/debugger/editor_profiler.cpp @@ -640,7 +640,7 @@ EditorProfiler::EditorProfiler() { display_mode->add_item(TTR("Average Time (ms)")); display_mode->add_item(TTR("Frame %")); display_mode->add_item(TTR("Physics Frame %")); - display_mode->connect("item_selected", callable_mp(this, &EditorProfiler::_combo_changed)); + display_mode->connect(SceneStringName(item_selected), callable_mp(this, &EditorProfiler::_combo_changed)); hb->add_child(display_mode); @@ -652,7 +652,7 @@ EditorProfiler::EditorProfiler() { // TRANSLATORS: This is an option in the profiler to display the time spent in a function, exincluding the time spent in other functions called by that function. display_time->add_item(TTR("Self")); display_time->set_tooltip_text(TTR("Inclusive: Includes time from other functions called by this function.\nUse this to spot bottlenecks.\n\nSelf: Only count the time spent in the function itself, not in other functions called by that function.\nUse this to find individual functions to optimize.")); - display_time->connect("item_selected", callable_mp(this, &EditorProfiler::_combo_changed)); + display_time->connect(SceneStringName(item_selected), callable_mp(this, &EditorProfiler::_combo_changed)); hb->add_child(display_time); diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp index 7e105c516a50..53c6cd748a9d 100644 --- a/editor/debugger/editor_visual_profiler.cpp +++ b/editor/debugger/editor_visual_profiler.cpp @@ -750,7 +750,7 @@ EditorVisualProfiler::EditorVisualProfiler() { display_mode = memnew(OptionButton); display_mode->add_item(TTR("Frame Time (ms)")); display_mode->add_item(TTR("Frame %")); - display_mode->connect("item_selected", callable_mp(this, &EditorVisualProfiler::_combo_changed)); + display_mode->connect(SceneStringName(item_selected), callable_mp(this, &EditorVisualProfiler::_combo_changed)); hb->add_child(display_mode); diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index ff9b4c73a66b..b062b20000a9 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -851,7 +851,7 @@ void ScriptEditorDebugger::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { le_set->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::_live_edit_set)); le_clear->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::_live_edit_clear)); - error_tree->connect("item_selected", callable_mp(this, &ScriptEditorDebugger::_error_selected)); + error_tree->connect(SceneStringName(item_selected), callable_mp(this, &ScriptEditorDebugger::_error_selected)); error_tree->connect("item_activated", callable_mp(this, &ScriptEditorDebugger::_error_activated)); breakpoints_tree->connect("item_activated", callable_mp(this, &ScriptEditorDebugger::_breakpoint_tree_clicked)); [[fallthrough]]; @@ -1886,7 +1886,7 @@ ScriptEditorDebugger::ScriptEditorDebugger() { threads = memnew(OptionButton); thread_hb->add_child(threads); threads->set_h_size_flags(SIZE_EXPAND_FILL); - threads->connect("item_selected", callable_mp(this, &ScriptEditorDebugger::_select_thread)); + threads->connect(SceneStringName(item_selected), callable_mp(this, &ScriptEditorDebugger::_select_thread)); stack_dump = memnew(Tree); stack_dump->set_allow_reselect(true); diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp index 0c870baec1ec..c83e677b37f5 100644 --- a/editor/dependency_editor.cpp +++ b/editor/dependency_editor.cpp @@ -327,7 +327,7 @@ void DependencyEditorOwners::_select_file(int p_idx) { EditorNode::get_singleton()->load_resource(fpath); } hide(); - emit_signal(SNAME("confirmed")); + emit_signal(SceneStringName(confirmed)); } void DependencyEditorOwners::_empty_clicked(const Vector2 &p_pos, MouseButton p_mouse_button_index) { @@ -875,7 +875,7 @@ OrphanResourcesDialog::OrphanResourcesDialog() { add_child(delete_confirm); dep_edit = memnew(DependencyEditor); add_child(dep_edit); - delete_confirm->connect("confirmed", callable_mp(this, &OrphanResourcesDialog::_delete_confirm)); + delete_confirm->connect(SceneStringName(confirmed), callable_mp(this, &OrphanResourcesDialog::_delete_confirm)); set_hide_on_ok(false); VBoxContainer *vbc = memnew(VBoxContainer); diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp index 6893b2878b51..dc943fc783c0 100644 --- a/editor/editor_about.cpp +++ b/editor/editor_about.cpp @@ -359,7 +359,7 @@ EditorAbout::EditorAbout() { _tpl_text->set_v_size_flags(Control::SIZE_EXPAND_FILL); tpl_hbc->add_child(_tpl_text); - _tpl_tree->connect("item_selected", callable_mp(this, &EditorAbout::_license_tree_selected)); + _tpl_tree->connect(SceneStringName(item_selected), callable_mp(this, &EditorAbout::_license_tree_selected)); tpl_ti_all->select(0); _tpl_text->set_text(tpl_ti_all->get_metadata(0)); } diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index db59606ffc63..4323b3d0af64 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -938,7 +938,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { send = memnew(OptionButton); send->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); send->set_clip_text(true); - send->connect("item_selected", callable_mp(this, &EditorAudioBus::_send_selected)); + send->connect(SceneStringName(item_selected), callable_mp(this, &EditorAudioBus::_send_selected)); vb->add_child(send); set_focus_mode(FOCUS_CLICK); diff --git a/editor/editor_build_profile.cpp b/editor/editor_build_profile.cpp index 799bda78ab0d..f4185fa4ae2d 100644 --- a/editor/editor_build_profile.cpp +++ b/editor/editor_build_profile.cpp @@ -864,7 +864,7 @@ EditorBuildProfileManager::EditorBuildProfileManager() { confirm_dialog = memnew(ConfirmationDialog); add_child(confirm_dialog); confirm_dialog->set_title(TTR("Please Confirm:")); - confirm_dialog->connect("confirmed", callable_mp(this, &EditorBuildProfileManager::_action_confirm)); + confirm_dialog->connect(SceneStringName(confirmed), callable_mp(this, &EditorBuildProfileManager::_action_confirm)); import_profile = memnew(EditorFileDialog); add_child(import_profile); diff --git a/editor/editor_command_palette.cpp b/editor/editor_command_palette.cpp index 9e100b6a6742..60226bf9713b 100644 --- a/editor/editor_command_palette.cpp +++ b/editor/editor_command_palette.cpp @@ -342,7 +342,7 @@ EditorCommandPalette *EditorCommandPalette::get_singleton() { EditorCommandPalette::EditorCommandPalette() { set_hide_on_ok(false); - connect("confirmed", callable_mp(this, &EditorCommandPalette::_confirmed)); + connect(SceneStringName(confirmed), callable_mp(this, &EditorCommandPalette::_confirmed)); VBoxContainer *vbc = memnew(VBoxContainer); add_child(vbc); @@ -360,7 +360,7 @@ EditorCommandPalette::EditorCommandPalette() { search_options = memnew(Tree); search_options->connect("item_activated", callable_mp(this, &EditorCommandPalette::_confirmed)); - search_options->connect("item_selected", callable_mp((BaseButton *)get_ok_button(), &BaseButton::set_disabled).bind(false)); + search_options->connect(SceneStringName(item_selected), callable_mp((BaseButton *)get_ok_button(), &BaseButton::set_disabled).bind(false)); search_options->connect("nothing_selected", callable_mp((BaseButton *)get_ok_button(), &BaseButton::set_disabled).bind(true)); search_options->create_item(); search_options->set_hide_root(true); diff --git a/editor/editor_feature_profile.cpp b/editor/editor_feature_profile.cpp index ba04f36abe57..37cd74d2acb5 100644 --- a/editor/editor_feature_profile.cpp +++ b/editor/editor_feature_profile.cpp @@ -936,7 +936,7 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { profile_list->set_h_size_flags(Control::SIZE_EXPAND_FILL); profile_list->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); profiles_hbc->add_child(profile_list); - profile_list->connect("item_selected", callable_mp(this, &EditorFeatureProfileManager::_profile_selected)); + profile_list->connect(SceneStringName(item_selected), callable_mp(this, &EditorFeatureProfileManager::_profile_selected)); profile_actions[PROFILE_NEW] = memnew(Button(TTR("Create Profile"))); profiles_hbc->add_child(profile_actions[PROFILE_NEW]); @@ -1026,14 +1026,14 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { new_profile_vb->add_child(new_profile_name); new_profile_name->set_custom_minimum_size(Size2(300 * EDSCALE, 1)); add_child(new_profile_dialog); - new_profile_dialog->connect("confirmed", callable_mp(this, &EditorFeatureProfileManager::_create_new_profile)); + new_profile_dialog->connect(SceneStringName(confirmed), callable_mp(this, &EditorFeatureProfileManager::_create_new_profile)); new_profile_dialog->register_text_enter(new_profile_name); new_profile_dialog->set_ok_button_text(TTR("Create")); erase_profile_dialog = memnew(ConfirmationDialog); add_child(erase_profile_dialog); erase_profile_dialog->set_title(TTR("Remove Profile")); - erase_profile_dialog->connect("confirmed", callable_mp(this, &EditorFeatureProfileManager::_erase_selected_profile)); + erase_profile_dialog->connect(SceneStringName(confirmed), callable_mp(this, &EditorFeatureProfileManager::_erase_selected_profile)); import_profiles = memnew(EditorFileDialog); add_child(import_profiles); diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index f42cc62fe259..98dee5eca407 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -212,7 +212,7 @@ void EditorHelpSearch::_notification(int p_what) { } break; case NOTIFICATION_READY: { - connect("confirmed", callable_mp(this, &EditorHelpSearch::_confirmed)); + connect(SceneStringName(confirmed), callable_mp(this, &EditorHelpSearch::_confirmed)); } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { @@ -351,7 +351,7 @@ EditorHelpSearch::EditorHelpSearch() { filter_combo->add_item(TTR("Constants Only"), SEARCH_CONSTANTS); filter_combo->add_item(TTR("Properties Only"), SEARCH_PROPERTIES); filter_combo->add_item(TTR("Theme Properties Only"), SEARCH_THEME_ITEMS); - filter_combo->connect("item_selected", callable_mp(this, &EditorHelpSearch::_filter_combo_item_selected)); + filter_combo->connect(SceneStringName(item_selected), callable_mp(this, &EditorHelpSearch::_filter_combo_item_selected)); hbox->add_child(filter_combo); // Create the results tree. @@ -369,7 +369,7 @@ EditorHelpSearch::EditorHelpSearch() { results_tree->set_hide_root(true); results_tree->set_select_mode(Tree::SELECT_ROW); results_tree->connect("item_activated", callable_mp(this, &EditorHelpSearch::_confirmed)); - results_tree->connect("item_selected", callable_mp((BaseButton *)get_ok_button(), &BaseButton::set_disabled).bind(false)); + results_tree->connect(SceneStringName(item_selected), callable_mp((BaseButton *)get_ok_button(), &BaseButton::set_disabled).bind(false)); vbox->add_child(results_tree, true); } diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 9e85b276befa..e897bdb270fc 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -2471,7 +2471,7 @@ EditorInspectorArray::EditorInspectorArray(bool p_read_only) { resize_dialog = memnew(AcceptDialog); resize_dialog->set_title(TTRC("Resize Array")); resize_dialog->add_cancel_button(); - resize_dialog->connect("confirmed", callable_mp(this, &EditorInspectorArray::_resize_dialog_confirmed)); + resize_dialog->connect(SceneStringName(confirmed), callable_mp(this, &EditorInspectorArray::_resize_dialog_confirmed)); add_child(resize_dialog); VBoxContainer *resize_dialog_vbox = memnew(VBoxContainer); @@ -4292,7 +4292,7 @@ void EditorInspector::_show_add_meta_dialog() { add_meta_dialog->set_ok_button_text(TTR("Add")); add_child(add_meta_dialog); add_meta_dialog->register_text_enter(add_meta_name); - add_meta_dialog->connect("confirmed", callable_mp(this, &EditorInspector::_add_meta_confirm)); + add_meta_dialog->connect(SceneStringName(confirmed), callable_mp(this, &EditorInspector::_add_meta_confirm)); validation_panel = memnew(EditorValidationPanel); vbc->add_child(validation_panel); diff --git a/editor/editor_locale_dialog.cpp b/editor/editor_locale_dialog.cpp index e97e4ac777b5..f8fd05bf1e32 100644 --- a/editor/editor_locale_dialog.cpp +++ b/editor/editor_locale_dialog.cpp @@ -399,7 +399,7 @@ EditorLocaleDialog::EditorLocaleDialog() { filter_mode->set_h_size_flags(Control::SIZE_EXPAND_FILL); filter_mode->add_item(TTR("Show Selected Locales Only"), SHOW_ONLY_SELECTED_LOCALES); filter_mode->select(0); - filter_mode->connect("item_selected", callable_mp(this, &EditorLocaleDialog::_filter_mode_changed)); + filter_mode->connect(SceneStringName(item_selected), callable_mp(this, &EditorLocaleDialog::_filter_mode_changed)); hb_filter->add_child(filter_mode); } { diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 54ba06afd804..205ec87a5ba3 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -5292,7 +5292,7 @@ bool EditorNode::immediate_confirmation_dialog(const String &p_text, const Strin cd->get_label()->set_custom_minimum_size(Size2(p_wrap_width, 0) * EDSCALE); } - cd->connect("confirmed", callable_mp(singleton, &EditorNode::_immediate_dialog_confirmed)); + cd->connect(SceneStringName(confirmed), callable_mp(singleton, &EditorNode::_immediate_dialog_confirmed)); singleton->gui_base->add_child(cd); cd->popup_centered(); @@ -6846,7 +6846,7 @@ EditorNode::EditorNode() { save_accept = memnew(AcceptDialog); save_accept->set_unparent_when_invisible(true); - save_accept->connect("confirmed", callable_mp(this, &EditorNode::_menu_option).bind((int)MenuOptions::FILE_SAVE_AS_SCENE)); + save_accept->connect(SceneStringName(confirmed), callable_mp(this, &EditorNode::_menu_option).bind((int)MenuOptions::FILE_SAVE_AS_SCENE)); project_export = memnew(ProjectExportDialog); gui_base->add_child(project_export); @@ -7138,7 +7138,7 @@ EditorNode::EditorNode() { // Add the renderers name to the UI. if (current_renderer_ps == current_renderer_os) { - renderer->connect("item_selected", callable_mp(this, &EditorNode::_renderer_selected)); + renderer->connect(SceneStringName(item_selected), callable_mp(this, &EditorNode::_renderer_selected)); // As we are doing string comparisons, keep in standard case to prevent problems with capitals // "vulkan" in particular uses lowercase "v" in the code, and uppercase in the UI. PackedStringArray renderers = ProjectSettings::get_singleton()->get_custom_property_info().get(StringName("rendering/renderer/rendering_method")).hint_string.split(",", false); @@ -7164,7 +7164,7 @@ EditorNode::EditorNode() { video_restart_dialog = memnew(ConfirmationDialog); video_restart_dialog->set_ok_button_text(TTR("Save & Restart")); - video_restart_dialog->connect("confirmed", callable_mp(this, &EditorNode::_menu_option).bind(SET_RENDERER_NAME_SAVE_AND_RESTART)); + video_restart_dialog->connect(SceneStringName(confirmed), callable_mp(this, &EditorNode::_menu_option).bind(SET_RENDERER_NAME_SAVE_AND_RESTART)); gui_base->add_child(video_restart_dialog); progress_hb = memnew(BackgroundProgress); @@ -7266,13 +7266,13 @@ EditorNode::EditorNode() { confirmation = memnew(ConfirmationDialog); gui_base->add_child(confirmation); - confirmation->connect("confirmed", callable_mp(this, &EditorNode::_menu_confirm_current)); + confirmation->connect(SceneStringName(confirmed), callable_mp(this, &EditorNode::_menu_confirm_current)); save_confirmation = memnew(ConfirmationDialog); save_confirmation->add_button(TTR("Don't Save"), DisplayServer::get_singleton()->get_swap_cancel_ok(), "discard"); gui_base->add_child(save_confirmation); save_confirmation->set_min_size(Vector2(450.0 * EDSCALE, 0)); - save_confirmation->connect("confirmed", callable_mp(this, &EditorNode::_menu_confirm_current)); + save_confirmation->connect(SceneStringName(confirmed), callable_mp(this, &EditorNode::_menu_confirm_current)); save_confirmation->connect("custom_action", callable_mp(this, &EditorNode::_discard_changes)); save_confirmation->connect("canceled", callable_mp(this, &EditorNode::_cancel_close_scene_tab)); @@ -7280,7 +7280,7 @@ EditorNode::EditorNode() { gradle_build_manage_templates->set_text(TTR("Android build template is missing, please install relevant templates.")); gradle_build_manage_templates->set_ok_button_text(TTR("Manage Templates")); gradle_build_manage_templates->add_button(TTR("Install from file"))->connect(SceneStringName(pressed), callable_mp(this, &EditorNode::_menu_option).bind(SETTINGS_INSTALL_ANDROID_BUILD_TEMPLATE)); - gradle_build_manage_templates->connect("confirmed", callable_mp(this, &EditorNode::_menu_option).bind(SETTINGS_MANAGE_EXPORT_TEMPLATES)); + gradle_build_manage_templates->connect(SceneStringName(confirmed), callable_mp(this, &EditorNode::_menu_option).bind(SETTINGS_MANAGE_EXPORT_TEMPLATES)); gui_base->add_child(gradle_build_manage_templates); file_android_build_source = memnew(EditorFileDialog); @@ -7299,12 +7299,12 @@ EditorNode::EditorNode() { vbox->add_child(install_android_build_template_message); choose_android_export_profile = memnew(OptionButton); - choose_android_export_profile->connect("item_selected", callable_mp(this, &EditorNode::_android_export_preset_selected)); + choose_android_export_profile->connect(SceneStringName(item_selected), callable_mp(this, &EditorNode::_android_export_preset_selected)); vbox->add_child(choose_android_export_profile); install_android_build_template = memnew(ConfirmationDialog); install_android_build_template->set_ok_button_text(TTR("Install")); - install_android_build_template->connect("confirmed", callable_mp(this, &EditorNode::_menu_confirm_current)); + install_android_build_template->connect(SceneStringName(confirmed), callable_mp(this, &EditorNode::_menu_confirm_current)); install_android_build_template->add_child(vbox); install_android_build_template->set_min_size(Vector2(500.0 * EDSCALE, 0)); gui_base->add_child(install_android_build_template); @@ -7312,7 +7312,7 @@ EditorNode::EditorNode() { remove_android_build_template = memnew(ConfirmationDialog); remove_android_build_template->set_ok_button_text(TTR("Show in File Manager")); - remove_android_build_template->connect("confirmed", callable_mp(this, &EditorNode::_menu_option).bind(FILE_EXPLORE_ANDROID_BUILD_TEMPLATES)); + remove_android_build_template->connect(SceneStringName(confirmed), callable_mp(this, &EditorNode::_menu_option).bind(FILE_EXPLORE_ANDROID_BUILD_TEMPLATES)); gui_base->add_child(remove_android_build_template); file_templates = memnew(EditorFileDialog); @@ -7378,8 +7378,8 @@ EditorNode::EditorNode() { vbc->add_child(disk_changed_list); disk_changed_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); - disk_changed->connect("confirmed", callable_mp(this, &EditorNode::_reload_modified_scenes)); - disk_changed->connect("confirmed", callable_mp(this, &EditorNode::_reload_project_settings)); + disk_changed->connect(SceneStringName(confirmed), callable_mp(this, &EditorNode::_reload_modified_scenes)); + disk_changed->connect(SceneStringName(confirmed), callable_mp(this, &EditorNode::_reload_project_settings)); disk_changed->set_ok_button_text(TTR("Discard local changes and reload")); disk_changed->add_button(TTR("Keep local changes and overwrite"), !DisplayServer::get_singleton()->get_swap_cancel_ok(), "resave"); @@ -7512,7 +7512,7 @@ EditorNode::EditorNode() { open_imported = memnew(ConfirmationDialog); open_imported->set_ok_button_text(TTR("Open Anyway")); new_inherited_button = open_imported->add_button(TTR("New Inherited"), !DisplayServer::get_singleton()->get_swap_cancel_ok(), "inherit"); - open_imported->connect("confirmed", callable_mp(this, &EditorNode::_open_imported)); + open_imported->connect(SceneStringName(confirmed), callable_mp(this, &EditorNode::_open_imported)); open_imported->connect("custom_action", callable_mp(this, &EditorNode::_inherit_imported)); gui_base->add_child(open_imported); @@ -7548,7 +7548,7 @@ EditorNode::EditorNode() { pick_main_scene = memnew(ConfirmationDialog); gui_base->add_child(pick_main_scene); pick_main_scene->set_ok_button_text(TTR("Select")); - pick_main_scene->connect("confirmed", callable_mp(this, &EditorNode::_menu_option).bind(SETTINGS_PICK_MAIN_SCENE)); + pick_main_scene->connect(SceneStringName(confirmed), callable_mp(this, &EditorNode::_menu_option).bind(SETTINGS_PICK_MAIN_SCENE)); select_current_scene_button = pick_main_scene->add_button(TTR("Select Current"), true, "select_current"); pick_main_scene->connect("custom_action", callable_mp(this, &EditorNode::_pick_main_scene_custom_action)); diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 54d1e0a51392..fa1584822d90 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -376,7 +376,7 @@ EditorPropertyTextEnum::EditorPropertyTextEnum() { option_button->set_flat(true); option_button->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); default_layout->add_child(option_button); - option_button->connect("item_selected", callable_mp(this, &EditorPropertyTextEnum::_option_selected)); + option_button->connect(SceneStringName(item_selected), callable_mp(this, &EditorPropertyTextEnum::_option_selected)); edit_button = memnew(Button); edit_button->set_flat(true); @@ -735,7 +735,7 @@ EditorPropertyEnum::EditorPropertyEnum() { options->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); add_child(options); add_focusable(options); - options->connect("item_selected", callable_mp(this, &EditorPropertyEnum::_option_selected)); + options->connect(SceneStringName(item_selected), callable_mp(this, &EditorPropertyEnum::_option_selected)); } ///////////////////// FLAGS ///////////////////////// @@ -850,7 +850,7 @@ EditorPropertyLayersGrid::EditorPropertyLayersGrid() { rename_dialog->set_ok_button_text(TTR("Rename")); add_child(rename_dialog); rename_dialog->register_text_enter(rename_dialog_text); - rename_dialog->connect("confirmed", callable_mp(this, &EditorPropertyLayersGrid::_rename_operation_confirm)); + rename_dialog->connect(SceneStringName(confirmed), callable_mp(this, &EditorPropertyLayersGrid::_rename_operation_confirm)); layer_rename = memnew(PopupMenu); layer_rename->add_item(TTR("Rename layer"), 0); add_child(layer_rename); diff --git a/editor/editor_quick_open.cpp b/editor/editor_quick_open.cpp index 356055c457cf..ba32be606c4c 100644 --- a/editor/editor_quick_open.cpp +++ b/editor/editor_quick_open.cpp @@ -261,7 +261,7 @@ String EditorQuickOpen::get_base_type() const { void EditorQuickOpen::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - connect("confirmed", callable_mp(this, &EditorQuickOpen::_confirmed)); + connect(SceneStringName(confirmed), callable_mp(this, &EditorQuickOpen::_confirmed)); search_box->set_clear_button_enabled(true); } break; @@ -278,7 +278,7 @@ void EditorQuickOpen::_notification(int p_what) { } break; case NOTIFICATION_EXIT_TREE: { - disconnect("confirmed", callable_mp(this, &EditorQuickOpen::_confirmed)); + disconnect(SceneStringName(confirmed), callable_mp(this, &EditorQuickOpen::_confirmed)); } break; } } diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp index 8cde63039b06..46fe2225d0e1 100644 --- a/editor/editor_resource_picker.cpp +++ b/editor/editor_resource_picker.cpp @@ -373,7 +373,7 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) { duplicate_resources_dialog = memnew(ConfirmationDialog); add_child(duplicate_resources_dialog); duplicate_resources_dialog->set_title(TTR("Make Unique (Recursive)")); - duplicate_resources_dialog->connect("confirmed", callable_mp(this, &EditorResourcePicker::_duplicate_selected_resources)); + duplicate_resources_dialog->connect(SceneStringName(confirmed), callable_mp(this, &EditorResourcePicker::_duplicate_selected_resources)); VBoxContainer *vb = memnew(VBoxContainer); duplicate_resources_dialog->add_child(vb); diff --git a/editor/editor_run_native.cpp b/editor/editor_run_native.cpp index 715f310b5ba9..548eac173753 100644 --- a/editor/editor_run_native.cpp +++ b/editor/editor_run_native.cpp @@ -205,7 +205,7 @@ EditorRunNative::EditorRunNative() { run_native_confirm = memnew(ConfirmationDialog); add_child(run_native_confirm); - run_native_confirm->connect("confirmed", callable_mp(this, &EditorRunNative::_confirm_run_native)); + run_native_confirm->connect(SceneStringName(confirmed), callable_mp(this, &EditorRunNative::_confirm_run_native)); set_process(true); } diff --git a/editor/editor_settings_dialog.cpp b/editor/editor_settings_dialog.cpp index 51138171fbb3..778deed7b28e 100644 --- a/editor/editor_settings_dialog.cpp +++ b/editor/editor_settings_dialog.cpp @@ -809,7 +809,7 @@ EditorSettingsDialog::EditorSettingsDialog() { // Adding event dialog shortcut_editor = memnew(InputEventConfigurationDialog); - shortcut_editor->connect("confirmed", callable_mp(this, &EditorSettingsDialog::_event_config_confirmed)); + shortcut_editor->connect(SceneStringName(confirmed), callable_mp(this, &EditorSettingsDialog::_event_config_confirmed)); shortcut_editor->set_allowed_input_types(INPUT_KEY); add_child(shortcut_editor); diff --git a/editor/export/export_template_manager.cpp b/editor/export/export_template_manager.cpp index e84044f7e1de..a6f6c87ee100 100644 --- a/editor/export/export_template_manager.cpp +++ b/editor/export/export_template_manager.cpp @@ -1051,7 +1051,7 @@ ExportTemplateManager::ExportTemplateManager() { uninstall_confirm = memnew(ConfirmationDialog); uninstall_confirm->set_title(TTR("Uninstall Template")); add_child(uninstall_confirm); - uninstall_confirm->connect("confirmed", callable_mp(this, &ExportTemplateManager::_uninstall_template_confirmed)); + uninstall_confirm->connect(SceneStringName(confirmed), callable_mp(this, &ExportTemplateManager::_uninstall_template_confirmed)); install_file_dialog = memnew(FileDialog); install_file_dialog->set_title(TTR("Select Template File")); @@ -1065,5 +1065,5 @@ ExportTemplateManager::ExportTemplateManager() { hide_dialog_accept = memnew(AcceptDialog); hide_dialog_accept->set_text(TTR("The templates will continue to download.\nYou may experience a short editor freeze when they finish.")); add_child(hide_dialog_accept); - hide_dialog_accept->connect("confirmed", callable_mp(this, &ExportTemplateManager::_hide_dialog)); + hide_dialog_accept->connect(SceneStringName(confirmed), callable_mp(this, &ExportTemplateManager::_hide_dialog)); } diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp index 4266c0f69c25..fe20f57eac6d 100644 --- a/editor/export/project_export.cpp +++ b/editor/export/project_export.cpp @@ -107,7 +107,7 @@ void ProjectExportDialog::_notification(int p_what) { case NOTIFICATION_READY: { duplicate_preset->set_icon(presets->get_editor_theme_icon(SNAME("Duplicate"))); delete_preset->set_icon(presets->get_editor_theme_icon(SNAME("Remove"))); - connect("confirmed", callable_mp(this, &ProjectExportDialog::_export_pck_zip)); + connect(SceneStringName(confirmed), callable_mp(this, &ProjectExportDialog::_export_pck_zip)); _update_export_all(); } break; } @@ -1246,7 +1246,7 @@ ProjectExportDialog::ProjectExportDialog() { presets->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); SET_DRAG_FORWARDING_GCD(presets, ProjectExportDialog); mc->add_child(presets); - presets->connect("item_selected", callable_mp(this, &ProjectExportDialog::_edit_preset)); + presets->connect(SceneStringName(item_selected), callable_mp(this, &ProjectExportDialog::_edit_preset)); duplicate_preset = memnew(Button); duplicate_preset->set_tooltip_text(TTR("Duplicate")); duplicate_preset->set_flat(true); @@ -1328,7 +1328,7 @@ ProjectExportDialog::ProjectExportDialog() { export_filter->add_item(TTR("Export all resources in the project except resources checked below")); export_filter->add_item(TTR("Export as dedicated server")); resources_vb->add_margin_child(TTR("Export Mode:"), export_filter); - export_filter->connect("item_selected", callable_mp(this, &ProjectExportDialog::_export_type_changed)); + export_filter->connect(SceneStringName(item_selected), callable_mp(this, &ProjectExportDialog::_export_type_changed)); include_label = memnew(Label); include_label->set_text(TTR("Resources to export:")); @@ -1461,7 +1461,7 @@ ProjectExportDialog::ProjectExportDialog() { script_mode->add_item(TTR("Text (easier debugging)"), (int)EditorExportPreset::MODE_SCRIPT_TEXT); script_mode->add_item(TTR("Binary tokens (faster loading)"), (int)EditorExportPreset::MODE_SCRIPT_BINARY_TOKENS); script_mode->add_item(TTR("Compressed binary tokens (smaller files)"), (int)EditorExportPreset::MODE_SCRIPT_BINARY_TOKENS_COMPRESSED); - script_mode->connect("item_selected", callable_mp(this, &ProjectExportDialog::_script_export_mode_changed)); + script_mode->connect(SceneStringName(item_selected), callable_mp(this, &ProjectExportDialog::_script_export_mode_changed)); sections->add_child(script_vb); @@ -1483,7 +1483,7 @@ ProjectExportDialog::ProjectExportDialog() { delete_confirm = memnew(ConfirmationDialog); add_child(delete_confirm); delete_confirm->set_ok_button_text(TTR("Delete")); - delete_confirm->connect("confirmed", callable_mp(this, &ProjectExportDialog::_delete_preset_confirm)); + delete_confirm->connect(SceneStringName(confirmed), callable_mp(this, &ProjectExportDialog::_delete_preset_confirm)); // Export buttons, dialogs and errors. diff --git a/editor/fbx_importer_manager.cpp b/editor/fbx_importer_manager.cpp index a8dbb3212ce0..a25c286d6c20 100644 --- a/editor/fbx_importer_manager.cpp +++ b/editor/fbx_importer_manager.cpp @@ -44,7 +44,7 @@ void FBXImporterManager::_notification(int p_what) { } break; case NOTIFICATION_READY: { - connect("confirmed", callable_mp(this, &FBXImporterManager::_path_confirmed)); + connect(SceneStringName(confirmed), callable_mp(this, &FBXImporterManager::_path_confirmed)); } break; } } diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index f8a82187b9d5..3e16c9352e15 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -4111,7 +4111,7 @@ FileSystemDock::FileSystemDock() { add_child(overwrite_dialog); overwrite_dialog->set_ok_button_text(TTR("Overwrite")); overwrite_dialog->add_button(TTR("Keep Both"), true)->connect(SceneStringName(pressed), callable_mp(this, &FileSystemDock::_overwrite_dialog_action).bind(false)); - overwrite_dialog->connect("confirmed", callable_mp(this, &FileSystemDock::_overwrite_dialog_action).bind(true)); + overwrite_dialog->connect(SceneStringName(confirmed), callable_mp(this, &FileSystemDock::_overwrite_dialog_action).bind(true)); VBoxContainer *overwrite_dialog_vb = memnew(VBoxContainer); overwrite_dialog->add_child(overwrite_dialog_vb); @@ -4138,7 +4138,7 @@ FileSystemDock::FileSystemDock() { duplicate_dialog->set_ok_button_text(TTR("Duplicate")); add_child(duplicate_dialog); duplicate_dialog->register_text_enter(duplicate_dialog_text); - duplicate_dialog->connect("confirmed", callable_mp(this, &FileSystemDock::_duplicate_operation_confirm)); + duplicate_dialog->connect(SceneStringName(confirmed), callable_mp(this, &FileSystemDock::_duplicate_operation_confirm)); make_dir_dialog = memnew(DirectoryCreateDialog); add_child(make_dir_dialog); @@ -4146,7 +4146,7 @@ FileSystemDock::FileSystemDock() { make_scene_dialog = memnew(SceneCreateDialog); add_child(make_scene_dialog); - make_scene_dialog->connect("confirmed", callable_mp(this, &FileSystemDock::_make_scene_confirm)); + make_scene_dialog->connect(SceneStringName(confirmed), callable_mp(this, &FileSystemDock::_make_scene_confirm)); make_script_dialog = memnew(ScriptCreateDialog); make_script_dialog->set_title(TTR("Create Script")); diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index 17b6eb5081bc..1e55010411f2 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -624,7 +624,7 @@ FindInFilesPanel::FindInFilesPanel() { _results_display = memnew(Tree); _results_display->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); _results_display->set_v_size_flags(SIZE_EXPAND_FILL); - _results_display->connect("item_selected", callable_mp(this, &FindInFilesPanel::_on_result_selected)); + _results_display->connect(SceneStringName(item_selected), callable_mp(this, &FindInFilesPanel::_on_result_selected)); _results_display->connect("item_edited", callable_mp(this, &FindInFilesPanel::_on_item_edited)); _results_display->set_hide_root(true); _results_display->set_select_mode(Tree::SELECT_ROW); diff --git a/editor/group_settings_editor.cpp b/editor/group_settings_editor.cpp index 981a84742852..6415b0a5da7a 100644 --- a/editor/group_settings_editor.cpp +++ b/editor/group_settings_editor.cpp @@ -400,7 +400,7 @@ void GroupSettingsEditor::show_message(const String &p_message) { void GroupSettingsEditor::_show_remove_dialog() { if (!remove_dialog) { remove_dialog = memnew(ConfirmationDialog); - remove_dialog->connect("confirmed", callable_mp(this, &GroupSettingsEditor::_confirm_delete)); + remove_dialog->connect(SceneStringName(confirmed), callable_mp(this, &GroupSettingsEditor::_confirm_delete)); VBoxContainer *vbox = memnew(VBoxContainer); remove_label = memnew(Label); @@ -431,7 +431,7 @@ void GroupSettingsEditor::_show_rename_dialog() { if (!rename_group_dialog) { rename_group_dialog = memnew(ConfirmationDialog); rename_group_dialog->set_title(TTR("Rename Group")); - rename_group_dialog->connect("confirmed", callable_mp(this, &GroupSettingsEditor::_confirm_rename)); + rename_group_dialog->connect(SceneStringName(confirmed), callable_mp(this, &GroupSettingsEditor::_confirm_rename)); VBoxContainer *vbc = memnew(VBoxContainer); rename_group_dialog->add_child(vbc); diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp index ed83ae98f37b..1ec4b3df4c17 100644 --- a/editor/groups_editor.cpp +++ b/editor/groups_editor.cpp @@ -607,7 +607,7 @@ void GroupsEditor::_show_add_group_dialog() { if (!add_group_dialog) { add_group_dialog = memnew(ConfirmationDialog); add_group_dialog->set_title(TTR("Create New Group")); - add_group_dialog->connect("confirmed", callable_mp(this, &GroupsEditor::_confirm_add)); + add_group_dialog->connect(SceneStringName(confirmed), callable_mp(this, &GroupsEditor::_confirm_add)); VBoxContainer *vbc = memnew(VBoxContainer); add_group_dialog->add_child(vbc); @@ -673,7 +673,7 @@ void GroupsEditor::_show_rename_group_dialog() { if (!rename_group_dialog) { rename_group_dialog = memnew(ConfirmationDialog); rename_group_dialog->set_title(TTR("Rename Group")); - rename_group_dialog->connect("confirmed", callable_mp(this, &GroupsEditor::_confirm_rename)); + rename_group_dialog->connect(SceneStringName(confirmed), callable_mp(this, &GroupsEditor::_confirm_rename)); VBoxContainer *vbc = memnew(VBoxContainer); rename_group_dialog->add_child(vbc); @@ -729,7 +729,7 @@ void GroupsEditor::_show_rename_group_dialog() { void GroupsEditor::_show_remove_group_dialog() { if (!remove_group_dialog) { remove_group_dialog = memnew(ConfirmationDialog); - remove_group_dialog->connect("confirmed", callable_mp(this, &GroupsEditor::_confirm_delete)); + remove_group_dialog->connect(SceneStringName(confirmed), callable_mp(this, &GroupsEditor::_confirm_delete)); VBoxContainer *vbox = memnew(VBoxContainer); remove_label = memnew(Label); diff --git a/editor/gui/editor_file_dialog.cpp b/editor/gui/editor_file_dialog.cpp index 97c54e8f4843..3e94310c8337 100644 --- a/editor/gui/editor_file_dialog.cpp +++ b/editor/gui/editor_file_dialog.cpp @@ -1786,7 +1786,7 @@ void EditorFileDialog::_update_option_controls() { } ob->select(opt.default_idx); grid_options->add_child(ob); - ob->connect("item_selected", callable_mp(this, &EditorFileDialog::_option_changed_item_selected).bind(opt.name)); + ob->connect(SceneStringName(item_selected), callable_mp(this, &EditorFileDialog::_option_changed_item_selected).bind(opt.name)); selected_options[opt.name] = opt.default_idx; } } @@ -2173,7 +2173,7 @@ EditorFileDialog::EditorFileDialog() { pathhb->add_child(shortcuts_container); drives = memnew(OptionButton); - drives->connect("item_selected", callable_mp(this, &EditorFileDialog::_select_drive)); + drives->connect(SceneStringName(item_selected), callable_mp(this, &EditorFileDialog::_select_drive)); pathhb->add_child(drives); pathhb->add_child(memnew(VSeparator)); @@ -2225,7 +2225,7 @@ EditorFileDialog::EditorFileDialog() { favorites->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); fav_vb->add_child(favorites); favorites->set_v_size_flags(Control::SIZE_EXPAND_FILL); - favorites->connect("item_selected", callable_mp(this, &EditorFileDialog::_favorite_selected)); + favorites->connect(SceneStringName(item_selected), callable_mp(this, &EditorFileDialog::_favorite_selected)); VBoxContainer *rec_vb = memnew(VBoxContainer); vsc->add_child(rec_vb); @@ -2235,7 +2235,7 @@ EditorFileDialog::EditorFileDialog() { recent->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); recent->set_allow_reselect(true); rec_vb->add_margin_child(TTR("Recent:"), recent, true); - recent->connect("item_selected", callable_mp(this, &EditorFileDialog::_recent_selected)); + recent->connect(SceneStringName(item_selected), callable_mp(this, &EditorFileDialog::_recent_selected)); VBoxContainer *item_vb = memnew(VBoxContainer); list_hb->add_child(item_vb); @@ -2300,25 +2300,25 @@ EditorFileDialog::EditorFileDialog() { dir_access = DirAccess::create(DirAccess::ACCESS_RESOURCES); _update_drives(); - connect("confirmed", callable_mp(this, &EditorFileDialog::_action_pressed)); - item_list->connect("item_selected", callable_mp(this, &EditorFileDialog::_item_selected), CONNECT_DEFERRED); + connect(SceneStringName(confirmed), callable_mp(this, &EditorFileDialog::_action_pressed)); + item_list->connect(SceneStringName(item_selected), callable_mp(this, &EditorFileDialog::_item_selected), CONNECT_DEFERRED); item_list->connect("multi_selected", callable_mp(this, &EditorFileDialog::_multi_selected), CONNECT_DEFERRED); item_list->connect("item_activated", callable_mp(this, &EditorFileDialog::_item_dc_selected).bind()); item_list->connect("empty_clicked", callable_mp(this, &EditorFileDialog::_items_clear_selection)); dir->connect("text_submitted", callable_mp(this, &EditorFileDialog::_dir_submitted)); file->connect("text_submitted", callable_mp(this, &EditorFileDialog::_file_submitted)); - filter->connect("item_selected", callable_mp(this, &EditorFileDialog::_filter_selected)); + filter->connect(SceneStringName(item_selected), callable_mp(this, &EditorFileDialog::_filter_selected)); confirm_save = memnew(ConfirmationDialog); add_child(confirm_save); - confirm_save->connect("confirmed", callable_mp(this, &EditorFileDialog::_save_confirm_pressed)); + confirm_save->connect(SceneStringName(confirmed), callable_mp(this, &EditorFileDialog::_save_confirm_pressed)); dep_remove_dialog = memnew(DependencyRemoveDialog); add_child(dep_remove_dialog); global_remove_dialog = memnew(ConfirmationDialog); global_remove_dialog->set_text(TTR("Remove the selected files? For safety only files and empty directories can be deleted from here. (Cannot be undone.)\nDepending on your filesystem configuration, the files will either be moved to the system trash or deleted permanently.")); - global_remove_dialog->connect("confirmed", callable_mp(this, &EditorFileDialog::_delete_files_global)); + global_remove_dialog->connect(SceneStringName(confirmed), callable_mp(this, &EditorFileDialog::_delete_files_global)); add_child(global_remove_dialog); makedialog = memnew(ConfirmationDialog); @@ -2331,7 +2331,7 @@ EditorFileDialog::EditorFileDialog() { makevb->add_margin_child(TTR("Name:"), makedirname); add_child(makedialog); makedialog->register_text_enter(makedirname); - makedialog->connect("confirmed", callable_mp(this, &EditorFileDialog::_make_dir_confirm)); + makedialog->connect(SceneStringName(confirmed), callable_mp(this, &EditorFileDialog::_make_dir_confirm)); error_dialog = memnew(AcceptDialog); add_child(error_dialog); diff --git a/editor/gui/scene_tree_editor.cpp b/editor/gui/scene_tree_editor.cpp index fc52d7a0aea2..aab2149eff96 100644 --- a/editor/gui/scene_tree_editor.cpp +++ b/editor/gui/scene_tree_editor.cpp @@ -1690,7 +1690,7 @@ void SceneTreeDialog::_notification(int p_what) { } break; case NOTIFICATION_ENTER_TREE: { - connect("confirmed", callable_mp(this, &SceneTreeDialog::_select)); + connect(SceneStringName(confirmed), callable_mp(this, &SceneTreeDialog::_select)); } break; case NOTIFICATION_THEME_CHANGED: { @@ -1702,7 +1702,7 @@ void SceneTreeDialog::_notification(int p_what) { } break; case NOTIFICATION_EXIT_TREE: { - disconnect("confirmed", callable_mp(this, &SceneTreeDialog::_select)); + disconnect(SceneStringName(confirmed), callable_mp(this, &SceneTreeDialog::_select)); } break; } } diff --git a/editor/history_dock.cpp b/editor/history_dock.cpp index 6bbc46e76c8c..5a64fba78808 100644 --- a/editor/history_dock.cpp +++ b/editor/history_dock.cpp @@ -262,5 +262,5 @@ HistoryDock::HistoryDock() { action_list->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); add_child(action_list); action_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); - action_list->connect("item_selected", callable_mp(this, &HistoryDock::seek_history)); + action_list->connect(SceneStringName(item_selected), callable_mp(this, &HistoryDock::seek_history)); } diff --git a/editor/import/3d/scene_import_settings.cpp b/editor/import/3d/scene_import_settings.cpp index 3d1eae26af70..d066e687130b 100644 --- a/editor/import/3d/scene_import_settings.cpp +++ b/editor/import/3d/scene_import_settings.cpp @@ -1256,7 +1256,7 @@ void SceneImportSettingsDialog::_update_theme_item_cache() { void SceneImportSettingsDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: { - connect("confirmed", callable_mp(this, &SceneImportSettingsDialog::_re_import)); + connect(SceneStringName(confirmed), callable_mp(this, &SceneImportSettingsDialog::_re_import)); } break; case NOTIFICATION_THEME_CHANGED: { @@ -1810,7 +1810,7 @@ SceneImportSettingsDialog::SceneImportSettingsDialog() { external_path_tree = memnew(Tree); external_paths->add_child(external_path_tree); external_path_tree->connect("button_clicked", callable_mp(this, &SceneImportSettingsDialog::_browse_save_callback)); - external_paths->connect("confirmed", callable_mp(this, &SceneImportSettingsDialog::_save_dir_confirm)); + external_paths->connect(SceneStringName(confirmed), callable_mp(this, &SceneImportSettingsDialog::_save_dir_confirm)); external_path_tree->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); external_path_tree->set_columns(3); external_path_tree->set_column_titles_visible(true); diff --git a/editor/import/audio_stream_import_settings.cpp b/editor/import/audio_stream_import_settings.cpp index 7b30e6815594..3b345573225d 100644 --- a/editor/import/audio_stream_import_settings.cpp +++ b/editor/import/audio_stream_import_settings.cpp @@ -41,7 +41,7 @@ void AudioStreamImportSettingsDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: { AudioStreamPreviewGenerator::get_singleton()->connect("preview_updated", callable_mp(this, &AudioStreamImportSettingsDialog::_preview_changed)); - connect("confirmed", callable_mp(this, &AudioStreamImportSettingsDialog::_reimport)); + connect(SceneStringName(confirmed), callable_mp(this, &AudioStreamImportSettingsDialog::_reimport)); } break; case NOTIFICATION_THEME_CHANGED: { diff --git a/editor/import/dynamic_font_import_settings.cpp b/editor/import/dynamic_font_import_settings.cpp index 7f7f27343fd3..00ce3d6a7a5d 100644 --- a/editor/import/dynamic_font_import_settings.cpp +++ b/editor/import/dynamic_font_import_settings.cpp @@ -924,7 +924,7 @@ String DynamicFontImportSettingsDialog::_pad_zeros(const String &p_hex) const { void DynamicFontImportSettingsDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: { - connect("confirmed", callable_mp(this, &DynamicFontImportSettingsDialog::_re_import)); + connect(SceneStringName(confirmed), callable_mp(this, &DynamicFontImportSettingsDialog::_re_import)); } break; case NOTIFICATION_THEME_CHANGED: { @@ -1385,7 +1385,7 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() { vars_list->set_column_custom_minimum_width(1, 50 * EDSCALE); vars_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); page2_side_vb->add_child(vars_list); - vars_list->connect("item_selected", callable_mp(this, &DynamicFontImportSettingsDialog::_variation_selected)); + vars_list->connect(SceneStringName(item_selected), callable_mp(this, &DynamicFontImportSettingsDialog::_variation_selected)); vars_list->connect("button_clicked", callable_mp(this, &DynamicFontImportSettingsDialog::_variation_remove)); inspector_vars = memnew(EditorInspector); @@ -1538,7 +1538,7 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() { } glyphs_split->add_child(glyph_tree); glyph_tree->connect("item_activated", callable_mp(this, &DynamicFontImportSettingsDialog::_range_edited)); - glyph_tree->connect("item_selected", callable_mp(this, &DynamicFontImportSettingsDialog::_range_selected)); + glyph_tree->connect(SceneStringName(item_selected), callable_mp(this, &DynamicFontImportSettingsDialog::_range_selected)); // Common diff --git a/editor/import_defaults_editor.cpp b/editor/import_defaults_editor.cpp index ab7988109f97..31e3022f6b9d 100644 --- a/editor/import_defaults_editor.cpp +++ b/editor/import_defaults_editor.cpp @@ -207,7 +207,7 @@ ImportDefaultsEditor::ImportDefaultsEditor() { importers = memnew(OptionButton); hb->add_child(importers); hb->add_spacer(); - importers->connect("item_selected", callable_mp(this, &ImportDefaultsEditor::_importer_selected)); + importers->connect(SceneStringName(item_selected), callable_mp(this, &ImportDefaultsEditor::_importer_selected)); reset_defaults = memnew(Button); reset_defaults->set_text(TTR("Reset to Defaults")); reset_defaults->set_disabled(true); diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp index 9dc7c43684b0..846456ea5510 100644 --- a/editor/import_dock.cpp +++ b/editor/import_dock.cpp @@ -787,7 +787,7 @@ ImportDock::ImportDock() { import_as->set_fit_to_longest_item(false); import_as->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_ELLIPSIS); import_as->set_h_size_flags(SIZE_EXPAND_FILL); - import_as->connect("item_selected", callable_mp(this, &ImportDock::_importer_selected)); + import_as->connect(SceneStringName(item_selected), callable_mp(this, &ImportDock::_importer_selected)); hb->add_child(import_as); import_as->set_h_size_flags(SIZE_EXPAND_FILL); preset = memnew(MenuButton); @@ -834,7 +834,7 @@ ImportDock::ImportDock() { reimport_confirm = memnew(ConfirmationDialog); content->add_child(reimport_confirm); - reimport_confirm->connect("confirmed", callable_mp(this, &ImportDock::_reimport_and_cleanup)); + reimport_confirm->connect(SceneStringName(confirmed), callable_mp(this, &ImportDock::_reimport_and_cleanup)); VBoxContainer *vbc_confirm = memnew(VBoxContainer()); cleanup_warning = memnew(Label(TTR("The imported resource is currently loaded. All instances will be replaced and undo history will be cleared."))); diff --git a/editor/input_event_configuration_dialog.cpp b/editor/input_event_configuration_dialog.cpp index f23d593fb7e1..a9335b2a73b6 100644 --- a/editor/input_event_configuration_dialog.cpp +++ b/editor/input_event_configuration_dialog.cpp @@ -676,7 +676,7 @@ InputEventConfigurationDialog::InputEventConfigurationDialog() { input_list_tree->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); input_list_tree->set_custom_minimum_size(Size2(0, 100 * EDSCALE)); // Min height for tree input_list_tree->connect("item_activated", callable_mp(this, &InputEventConfigurationDialog::_input_list_item_activated)); - input_list_tree->connect("item_selected", callable_mp(this, &InputEventConfigurationDialog::_input_list_item_selected)); + input_list_tree->connect(SceneStringName(item_selected), callable_mp(this, &InputEventConfigurationDialog::_input_list_item_selected)); input_list_tree->set_v_size_flags(Control::SIZE_EXPAND_FILL); manual_vbox->add_child(input_list_tree); @@ -708,7 +708,7 @@ InputEventConfigurationDialog::InputEventConfigurationDialog() { for (int i = -1; i < 8; i++) { device_id_option->add_item(EventListenerLineEdit::get_device_string(i)); } - device_id_option->connect("item_selected", callable_mp(this, &InputEventConfigurationDialog::_device_selection_changed)); + device_id_option->connect(SceneStringName(item_selected), callable_mp(this, &InputEventConfigurationDialog::_device_selection_changed)); _set_current_device(InputMap::ALL_DEVICES); device_container->add_child(device_id_option); @@ -744,7 +744,7 @@ InputEventConfigurationDialog::InputEventConfigurationDialog() { key_mode->add_item(TTR("Keycode (Latin Equivalent)"), KEYMODE_KEYCODE); key_mode->add_item(TTR("Physical Keycode (Position on US QWERTY Keyboard)"), KEYMODE_PHY_KEYCODE); key_mode->add_item(TTR("Key Label (Unicode, Case-Insensitive)"), KEYMODE_UNICODE); - key_mode->connect("item_selected", callable_mp(this, &InputEventConfigurationDialog::_key_mode_selected)); + key_mode->connect(SceneStringName(item_selected), callable_mp(this, &InputEventConfigurationDialog::_key_mode_selected)); key_mode->hide(); additional_options_container->add_child(key_mode); @@ -762,7 +762,7 @@ InputEventConfigurationDialog::InputEventConfigurationDialog() { key_location->add_item(TTR("Any"), (int)KeyLocation::UNSPECIFIED); key_location->add_item(TTR("Left"), (int)KeyLocation::LEFT); key_location->add_item(TTR("Right"), (int)KeyLocation::RIGHT); - key_location->connect("item_selected", callable_mp(this, &InputEventConfigurationDialog::_key_location_selected)); + key_location->connect(SceneStringName(item_selected), callable_mp(this, &InputEventConfigurationDialog::_key_location_selected)); location_container->add_child(key_location); additional_options_container->add_child(location_container); diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index 43b5cb711edf..b71f0f1bb66e 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -774,7 +774,7 @@ InspectorDock::InspectorDock(EditorData &p_editor_data) { bottom_label->set_text(TTR("This cannot be undone. Are you sure?")); container->add_child(bottom_label); - unique_resources_confirmation->connect("confirmed", callable_mp(this, &InspectorDock::_menu_confirm_current)); + unique_resources_confirmation->connect(SceneStringName(confirmed), callable_mp(this, &InspectorDock::_menu_confirm_current)); info_dialog = memnew(AcceptDialog); EditorNode::get_singleton()->get_gui_base()->add_child(info_dialog); diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp index fbdf42a71791..97f628c4a42c 100644 --- a/editor/plugins/abstract_polygon_2d_editor.cpp +++ b/editor/plugins/abstract_polygon_2d_editor.cpp @@ -169,7 +169,7 @@ void AbstractPolygon2DEditor::_notification(int p_what) { button_edit->set_pressed(true); get_tree()->connect("node_removed", callable_mp(this, &AbstractPolygon2DEditor::_node_removed)); - create_resource->connect("confirmed", callable_mp(this, &AbstractPolygon2DEditor::_create_resource)); + create_resource->connect(SceneStringName(confirmed), callable_mp(this, &AbstractPolygon2DEditor::_create_resource)); } break; } } diff --git a/editor/plugins/animation_blend_space_1d_editor.cpp b/editor/plugins/animation_blend_space_1d_editor.cpp index de031c1a57c9..c4dbee973eb0 100644 --- a/editor/plugins/animation_blend_space_1d_editor.cpp +++ b/editor/plugins/animation_blend_space_1d_editor.cpp @@ -720,7 +720,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { top_hb->add_child(memnew(Label(TTR("Blend:")))); interpolation = memnew(OptionButton); top_hb->add_child(interpolation); - interpolation->connect("item_selected", callable_mp(this, &AnimationNodeBlendSpace1DEditor::_config_changed)); + interpolation->connect(SceneStringName(item_selected), callable_mp(this, &AnimationNodeBlendSpace1DEditor::_config_changed)); edit_hb = memnew(HBoxContainer); top_hb->add_child(edit_hb); diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp index 318e132095d2..4ca776cc0ae2 100644 --- a/editor/plugins/animation_blend_space_2d_editor.cpp +++ b/editor/plugins/animation_blend_space_2d_editor.cpp @@ -968,7 +968,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { top_hb->add_child(memnew(Label(TTR("Blend:")))); interpolation = memnew(OptionButton); top_hb->add_child(interpolation); - interpolation->connect("item_selected", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_config_changed)); + interpolation->connect(SceneStringName(item_selected), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_config_changed)); edit_hb = memnew(HBoxContainer); top_hb->add_child(edit_hb); diff --git a/editor/plugins/animation_library_editor.cpp b/editor/plugins/animation_library_editor.cpp index a00dbe27547e..22c552d89ef1 100644 --- a/editor/plugins/animation_library_editor.cpp +++ b/editor/plugins/animation_library_editor.cpp @@ -804,7 +804,7 @@ AnimationLibraryEditor::AnimationLibraryEditor() { add_library_validate = memnew(Label); dialog_vb->add_child(add_library_validate); add_library_dialog->add_child(dialog_vb); - add_library_dialog->connect("confirmed", callable_mp(this, &AnimationLibraryEditor::_add_library_confirm)); + add_library_dialog->connect(SceneStringName(confirmed), callable_mp(this, &AnimationLibraryEditor::_add_library_confirm)); add_library_dialog->register_text_enter(add_library_name); VBoxContainer *vb = memnew(VBoxContainer); diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index 0a2c192ea407..a85f54b11e6b 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -125,7 +125,7 @@ void AnimationPlayerEditor::_notification(int p_what) { onion_skinning->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &AnimationPlayerEditor::_onion_skinning_menu)); - blend_editor.next->connect(SNAME("item_selected"), callable_mp(this, &AnimationPlayerEditor::_blend_editor_next_changed)); + blend_editor.next->connect(SceneStringName(item_selected), callable_mp(this, &AnimationPlayerEditor::_blend_editor_next_changed)); get_tree()->connect(SNAME("node_removed"), callable_mp(this, &AnimationPlayerEditor::_node_removed)); @@ -1951,7 +1951,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(AnimationPlayerEditorPlugin *p_plug delete_dialog = memnew(ConfirmationDialog); add_child(delete_dialog); - delete_dialog->connect(SNAME("confirmed"), callable_mp(this, &AnimationPlayerEditor::_animation_remove_confirmed)); + delete_dialog->connect(SceneStringName(confirmed), callable_mp(this, &AnimationPlayerEditor::_animation_remove_confirmed)); tool_anim = memnew(MenuButton); tool_anim->set_shortcut_context(this); @@ -2056,7 +2056,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(AnimationPlayerEditorPlugin *p_plug error_dialog->set_title(TTR("Error!")); name_dialog->add_child(error_dialog); - name_dialog->connect(SNAME("confirmed"), callable_mp(this, &AnimationPlayerEditor::_animation_name_edited)); + name_dialog->connect(SceneStringName(confirmed), callable_mp(this, &AnimationPlayerEditor::_animation_name_edited)); blend_editor.dialog = memnew(AcceptDialog); blend_editor.dialog->set_title(TTR("Cross-Animation Blend Times")); @@ -2090,7 +2090,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(AnimationPlayerEditorPlugin *p_plug play_bw_from->connect(SceneStringName(pressed), callable_mp(this, &AnimationPlayerEditor::_play_bw_from_pressed)); stop->connect(SceneStringName(pressed), callable_mp(this, &AnimationPlayerEditor::_stop_pressed)); - animation->connect(SNAME("item_selected"), callable_mp(this, &AnimationPlayerEditor::_animation_selected)); + animation->connect(SceneStringName(item_selected), callable_mp(this, &AnimationPlayerEditor::_animation_selected)); frame->connect(SNAME("value_changed"), callable_mp(this, &AnimationPlayerEditor::_seek_value_changed).bind(false)); scale->connect(SNAME("text_submitted"), callable_mp(this, &AnimationPlayerEditor::_scale_changed)); diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 2dce0904e4b2..cd7fa7133da0 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -620,7 +620,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() { asset_installer = memnew(EditorAssetInstaller); panel->add_child(asset_installer); - asset_installer->connect("confirmed", callable_mp(this, &EditorAssetLibraryItemDownload::_close)); + asset_installer->connect(SceneStringName(confirmed), callable_mp(this, &EditorAssetLibraryItemDownload::_close)); prev_status = -1; @@ -1427,7 +1427,7 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const description = memnew(EditorAssetLibraryItemDescription); add_child(description); - description->connect("confirmed", callable_mp(this, &EditorAssetLibrary::_install_asset)); + description->connect(SceneStringName(confirmed), callable_mp(this, &EditorAssetLibrary::_install_asset)); description->configure(r["title"], r["asset_id"], category_map[r["category_id"]], r["category_id"], r["author"], r["author_id"], r["cost"], r["version"], r["version_string"], r["description"], r["download_url"], r["browse_url"], r["download_hash"]); @@ -1643,7 +1643,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { sort->set_h_size_flags(Control::SIZE_EXPAND_FILL); sort->set_clip_text(true); - sort->connect("item_selected", callable_mp(this, &EditorAssetLibrary::_rerun_search)); + sort->connect(SceneStringName(item_selected), callable_mp(this, &EditorAssetLibrary::_rerun_search)); search_hb2->add_child(memnew(VSeparator)); @@ -1653,7 +1653,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { search_hb2->add_child(categories); categories->set_h_size_flags(Control::SIZE_EXPAND_FILL); categories->set_clip_text(true); - categories->connect("item_selected", callable_mp(this, &EditorAssetLibrary::_rerun_search)); + categories->connect(SceneStringName(item_selected), callable_mp(this, &EditorAssetLibrary::_rerun_search)); search_hb2->add_child(memnew(VSeparator)); @@ -1662,7 +1662,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { _update_repository_options(); - repository->connect("item_selected", callable_mp(this, &EditorAssetLibrary::_repository_changed)); + repository->connect(SceneStringName(item_selected), callable_mp(this, &EditorAssetLibrary::_repository_changed)); search_hb2->add_child(repository); repository->set_h_size_flags(Control::SIZE_EXPAND_FILL); diff --git a/editor/plugins/bone_map_editor_plugin.cpp b/editor/plugins/bone_map_editor_plugin.cpp index c7207a6eab0e..c00436b01f83 100644 --- a/editor/plugins/bone_map_editor_plugin.cpp +++ b/editor/plugins/bone_map_editor_plugin.cpp @@ -273,7 +273,7 @@ BonePicker::~BonePicker() { void BoneMapper::create_editor() { // Create Bone picker. picker = memnew(BonePicker(skeleton)); - picker->connect("confirmed", callable_mp(this, &BoneMapper::_apply_picker_selection)); + picker->connect(SceneStringName(confirmed), callable_mp(this, &BoneMapper::_apply_picker_selection)); add_child(picker, false, INTERNAL_MODE_FRONT); profile_selector = memnew(EditorPropertyResource); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 196df7f33e48..0356493e089f 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -5609,7 +5609,7 @@ CanvasItemEditor::CanvasItemEditor() { p->add_shortcut(ED_SHORTCUT("canvas_item_editor/anim_clear_pose", TTR("Clear Pose"), KeyModifierMask::SHIFT | Key::K), ANIM_CLEAR_POSE); snap_dialog = memnew(SnapDialog); - snap_dialog->connect("confirmed", callable_mp(this, &CanvasItemEditor::_snap_changed)); + snap_dialog->connect(SceneStringName(confirmed), callable_mp(this, &CanvasItemEditor::_snap_changed)); add_child(snap_dialog); select_sb = Ref(memnew(StyleBoxTexture)); @@ -6266,7 +6266,7 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(CanvasItemEditor *p_canvas_it texture_node_type_selector = memnew(AcceptDialog); EditorNode::get_singleton()->get_gui_base()->add_child(texture_node_type_selector); texture_node_type_selector->set_title(TTR("Change Default Type")); - texture_node_type_selector->connect("confirmed", callable_mp(this, &CanvasItemEditorViewport::_on_change_type_confirmed)); + texture_node_type_selector->connect(SceneStringName(confirmed), callable_mp(this, &CanvasItemEditorViewport::_on_change_type_confirmed)); texture_node_type_selector->connect("canceled", callable_mp(this, &CanvasItemEditorViewport::_on_change_type_closed)); VBoxContainer *vbc = memnew(VBoxContainer); diff --git a/editor/plugins/control_editor_plugin.cpp b/editor/plugins/control_editor_plugin.cpp index 3479d222672a..df20395ac5ab 100644 --- a/editor/plugins/control_editor_plugin.cpp +++ b/editor/plugins/control_editor_plugin.cpp @@ -214,7 +214,7 @@ EditorPropertyAnchorsPreset::EditorPropertyAnchorsPreset() { options->set_flat(true); add_child(options); add_focusable(options); - options->connect("item_selected", callable_mp(this, &EditorPropertyAnchorsPreset::_option_selected)); + options->connect(SceneStringName(item_selected), callable_mp(this, &EditorPropertyAnchorsPreset::_option_selected)); } void EditorPropertySizeFlags::_set_read_only(bool p_read_only) { @@ -397,7 +397,7 @@ EditorPropertySizeFlags::EditorPropertySizeFlags() { vb->add_child(flag_presets); add_focusable(flag_presets); set_label_reference(flag_presets); - flag_presets->connect("item_selected", callable_mp(this, &EditorPropertySizeFlags::_preset_selected)); + flag_presets->connect(SceneStringName(item_selected), callable_mp(this, &EditorPropertySizeFlags::_preset_selected)); flag_options = memnew(VBoxContainer); flag_options->hide(); diff --git a/editor/plugins/cpu_particles_2d_editor_plugin.cpp b/editor/plugins/cpu_particles_2d_editor_plugin.cpp index 1c0d93248d9d..92c0fd847b6b 100644 --- a/editor/plugins/cpu_particles_2d_editor_plugin.cpp +++ b/editor/plugins/cpu_particles_2d_editor_plugin.cpp @@ -305,7 +305,7 @@ CPUParticles2DEditorPlugin::CPUParticles2DEditorPlugin() { toolbar->add_child(emission_mask); - emission_mask->connect("confirmed", callable_mp(this, &CPUParticles2DEditorPlugin::_generate_emission_mask)); + emission_mask->connect(SceneStringName(confirmed), callable_mp(this, &CPUParticles2DEditorPlugin::_generate_emission_mask)); } CPUParticles2DEditorPlugin::~CPUParticles2DEditorPlugin() { diff --git a/editor/plugins/cpu_particles_3d_editor_plugin.cpp b/editor/plugins/cpu_particles_3d_editor_plugin.cpp index f01bc542da7a..be2847d1d761 100644 --- a/editor/plugins/cpu_particles_3d_editor_plugin.cpp +++ b/editor/plugins/cpu_particles_3d_editor_plugin.cpp @@ -187,7 +187,7 @@ CPUParticles3DEditor::CPUParticles3DEditor() { add_child(generate_aabb); - generate_aabb->connect("confirmed", callable_mp(this, &CPUParticles3DEditor::_generate_aabb)); + generate_aabb->connect(SceneStringName(confirmed), callable_mp(this, &CPUParticles3DEditor::_generate_aabb)); } void CPUParticles3DEditorPlugin::edit(Object *p_object) { diff --git a/editor/plugins/gpu_particles_2d_editor_plugin.cpp b/editor/plugins/gpu_particles_2d_editor_plugin.cpp index 5376dfd95647..b70c34b78575 100644 --- a/editor/plugins/gpu_particles_2d_editor_plugin.cpp +++ b/editor/plugins/gpu_particles_2d_editor_plugin.cpp @@ -401,7 +401,7 @@ GPUParticles2DEditorPlugin::GPUParticles2DEditorPlugin() { toolbar->add_child(generate_visibility_rect); - generate_visibility_rect->connect("confirmed", callable_mp(this, &GPUParticles2DEditorPlugin::_generate_visibility_rect)); + generate_visibility_rect->connect(SceneStringName(confirmed), callable_mp(this, &GPUParticles2DEditorPlugin::_generate_visibility_rect)); emission_mask = memnew(ConfirmationDialog); emission_mask->set_title(TTR("Load Emission Mask")); @@ -423,7 +423,7 @@ GPUParticles2DEditorPlugin::GPUParticles2DEditorPlugin() { toolbar->add_child(emission_mask); - emission_mask->connect("confirmed", callable_mp(this, &GPUParticles2DEditorPlugin::_generate_emission_mask)); + emission_mask->connect(SceneStringName(confirmed), callable_mp(this, &GPUParticles2DEditorPlugin::_generate_emission_mask)); } GPUParticles2DEditorPlugin::~GPUParticles2DEditorPlugin() { diff --git a/editor/plugins/gpu_particles_3d_editor_plugin.cpp b/editor/plugins/gpu_particles_3d_editor_plugin.cpp index b1dd1b2182c1..00c5332464ae 100644 --- a/editor/plugins/gpu_particles_3d_editor_plugin.cpp +++ b/editor/plugins/gpu_particles_3d_editor_plugin.cpp @@ -221,7 +221,7 @@ GPUParticles3DEditorBase::GPUParticles3DEditorBase() { emd_vb->add_margin_child(TTR("Emission Source:"), emission_fill); emission_dialog->set_ok_button_text(TTR("Create")); - emission_dialog->connect("confirmed", callable_mp(this, &GPUParticles3DEditorBase::_generate_emission_points)); + emission_dialog->connect(SceneStringName(confirmed), callable_mp(this, &GPUParticles3DEditorBase::_generate_emission_points)); emission_tree_dialog = memnew(SceneTreeDialog); Vector valid_types; @@ -434,7 +434,7 @@ GPUParticles3DEditor::GPUParticles3DEditor() { add_child(generate_aabb); - generate_aabb->connect("confirmed", callable_mp(this, &GPUParticles3DEditor::_generate_aabb)); + generate_aabb->connect(SceneStringName(confirmed), callable_mp(this, &GPUParticles3DEditor::_generate_aabb)); } void GPUParticles3DEditorPlugin::edit(Object *p_object) { diff --git a/editor/plugins/input_event_editor_plugin.cpp b/editor/plugins/input_event_editor_plugin.cpp index 1f6bb1192987..5a90d2de61ab 100644 --- a/editor/plugins/input_event_editor_plugin.cpp +++ b/editor/plugins/input_event_editor_plugin.cpp @@ -94,7 +94,7 @@ InputEventConfigContainer::InputEventConfigContainer() { add_child(memnew(Control)); config_dialog = memnew(InputEventConfigurationDialog); - config_dialog->connect("confirmed", callable_mp(this, &InputEventConfigContainer::_config_dialog_confirmed)); + config_dialog->connect(SceneStringName(confirmed), callable_mp(this, &InputEventConfigContainer::_config_dialog_confirmed)); add_child(config_dialog); } diff --git a/editor/plugins/mesh_instance_3d_editor_plugin.cpp b/editor/plugins/mesh_instance_3d_editor_plugin.cpp index 6eae3b975a84..4ebacbd0b37e 100644 --- a/editor/plugins/mesh_instance_3d_editor_plugin.cpp +++ b/editor/plugins/mesh_instance_3d_editor_plugin.cpp @@ -558,7 +558,7 @@ MeshInstance3DEditor::MeshInstance3DEditor() { outline_dialog_vbc->add_margin_child(TTR("Outline Size:"), outline_size); add_child(outline_dialog); - outline_dialog->connect("confirmed", callable_mp(this, &MeshInstance3DEditor::_create_outline_mesh)); + outline_dialog->connect(SceneStringName(confirmed), callable_mp(this, &MeshInstance3DEditor::_create_outline_mesh)); shape_dialog = memnew(ConfirmationDialog); shape_dialog->set_title(TTR("Create Collision Shape")); @@ -596,7 +596,7 @@ MeshInstance3DEditor::MeshInstance3DEditor() { shape_dialog_vbc->add_child(shape_type); add_child(shape_dialog); - shape_dialog->connect("confirmed", callable_mp(this, &MeshInstance3DEditor::_create_collision_shape)); + shape_dialog->connect(SceneStringName(confirmed), callable_mp(this, &MeshInstance3DEditor::_create_collision_shape)); err_dialog = memnew(AcceptDialog); add_child(err_dialog); diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 0887075e8b3c..41adbcf08c2d 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -8720,7 +8720,7 @@ Node3DEditor::Node3DEditor() { snap_dialog = memnew(ConfirmationDialog); snap_dialog->set_title(TTR("Snap Settings")); add_child(snap_dialog); - snap_dialog->connect("confirmed", callable_mp(this, &Node3DEditor::_snap_changed)); + snap_dialog->connect(SceneStringName(confirmed), callable_mp(this, &Node3DEditor::_snap_changed)); snap_dialog->get_cancel_button()->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_snap_update)); VBoxContainer *snap_dialog_vbc = memnew(VBoxContainer); @@ -8773,7 +8773,7 @@ Node3DEditor::Node3DEditor() { settings_vbc->add_margin_child(TTR("View Z-Far:"), settings_zfar); for (uint32_t i = 0; i < VIEWPORTS_COUNT; ++i) { - settings_dialog->connect("confirmed", callable_mp(viewports[i], &Node3DEditorViewport::_view_settings_confirmed).bind(0.0)); + settings_dialog->connect(SceneStringName(confirmed), callable_mp(viewports[i], &Node3DEditorViewport::_view_settings_confirmed).bind(0.0)); } /* XFORM DIALOG */ @@ -8837,7 +8837,7 @@ Node3DEditor::Node3DEditor() { xform_type->add_item(TTR("Post")); xform_vbc->add_child(xform_type); - xform_dialog->connect("confirmed", callable_mp(this, &Node3DEditor::_xform_dialog_action)); + xform_dialog->connect(SceneStringName(confirmed), callable_mp(this, &Node3DEditor::_xform_dialog_action)); selected = nullptr; diff --git a/editor/plugins/path_2d_editor_plugin.cpp b/editor/plugins/path_2d_editor_plugin.cpp index ccb4e4921ba3..5b23cf44d038 100644 --- a/editor/plugins/path_2d_editor_plugin.cpp +++ b/editor/plugins/path_2d_editor_plugin.cpp @@ -688,7 +688,7 @@ Path2DEditor::Path2DEditor() { clear_points_dialog = memnew(ConfirmationDialog); clear_points_dialog->set_title(TTR("Please Confirm...")); clear_points_dialog->set_text(TTR("Remove all curve points?")); - clear_points_dialog->connect("confirmed", callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_CLEAR_POINTS)); + clear_points_dialog->connect(SceneStringName(confirmed), callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_CLEAR_POINTS)); add_child(clear_points_dialog); PopupMenu *menu; diff --git a/editor/plugins/path_3d_editor_plugin.cpp b/editor/plugins/path_3d_editor_plugin.cpp index 447e82f70d23..240206e12452 100644 --- a/editor/plugins/path_3d_editor_plugin.cpp +++ b/editor/plugins/path_3d_editor_plugin.cpp @@ -881,7 +881,7 @@ Path3DEditorPlugin::Path3DEditorPlugin() { clear_points_dialog = memnew(ConfirmationDialog); clear_points_dialog->set_title(TTR("Please Confirm...")); clear_points_dialog->set_text(TTR("Remove all curve points?")); - clear_points_dialog->connect("confirmed", callable_mp(this, &Path3DEditorPlugin::_clear_points)); + clear_points_dialog->connect(SceneStringName(confirmed), callable_mp(this, &Path3DEditorPlugin::_clear_points)); topmenu_bar->add_child(clear_points_dialog); handle_menu = memnew(MenuButton); diff --git a/editor/plugins/plugin_config_dialog.cpp b/editor/plugins/plugin_config_dialog.cpp index fda06c3eec2c..a2a617e23d50 100644 --- a/editor/plugins/plugin_config_dialog.cpp +++ b/editor/plugins/plugin_config_dialog.cpp @@ -160,7 +160,7 @@ void PluginConfigDialog::_notification(int p_what) { } break; case NOTIFICATION_READY: { - connect("confirmed", callable_mp(this, &PluginConfigDialog::_on_confirmed)); + connect(SceneStringName(confirmed), callable_mp(this, &PluginConfigDialog::_on_confirmed)); get_cancel_button()->connect(SceneStringName(pressed), callable_mp(this, &PluginConfigDialog::_on_canceled)); } break; } @@ -335,7 +335,7 @@ PluginConfigDialog::PluginConfigDialog() { validation_panel->set_update_callback(callable_mp(this, &PluginConfigDialog::_on_required_text_changed)); validation_panel->set_accept_button(get_ok_button()); - script_option_edit->connect("item_selected", callable_mp(validation_panel, &EditorValidationPanel::update).unbind(1)); + script_option_edit->connect(SceneStringName(item_selected), callable_mp(validation_panel, &EditorValidationPanel::update).unbind(1)); name_edit->connect("text_changed", callable_mp(validation_panel, &EditorValidationPanel::update).unbind(1)); subfolder_edit->connect("text_changed", callable_mp(validation_panel, &EditorValidationPanel::update).unbind(1)); script_edit->connect("text_changed", callable_mp(validation_panel, &EditorValidationPanel::update).unbind(1)); diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index 61bd21db6717..1fb9ad9bdd37 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -1308,7 +1308,7 @@ Polygon2DEditor::Polygon2DEditor() { uv_edit = memnew(AcceptDialog); add_child(uv_edit); uv_edit->set_title(TTR("Polygon 2D UV Editor")); - uv_edit->connect("confirmed", callable_mp(this, &Polygon2DEditor::_uv_edit_popup_hide)); + uv_edit->connect(SceneStringName(confirmed), callable_mp(this, &Polygon2DEditor::_uv_edit_popup_hide)); uv_edit->connect("canceled", callable_mp(this, &Polygon2DEditor::_uv_edit_popup_hide)); VBoxContainer *uv_main_vb = memnew(VBoxContainer); diff --git a/editor/plugins/root_motion_editor_plugin.cpp b/editor/plugins/root_motion_editor_plugin.cpp index 4d0156eb5b5a..8b31aa92b34e 100644 --- a/editor/plugins/root_motion_editor_plugin.cpp +++ b/editor/plugins/root_motion_editor_plugin.cpp @@ -212,7 +212,7 @@ EditorPropertyRootMotion::EditorPropertyRootMotion() { filter_dialog = memnew(ConfirmationDialog); add_child(filter_dialog); filter_dialog->set_title(TTR("Edit Filtered Tracks:")); - filter_dialog->connect("confirmed", callable_mp(this, &EditorPropertyRootMotion::_confirmed)); + filter_dialog->connect(SceneStringName(confirmed), callable_mp(this, &EditorPropertyRootMotion::_confirmed)); filters = memnew(Tree); filter_dialog->add_child(filters); diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index f4e354ac4869..9bd4112d9d11 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -399,7 +399,7 @@ void ScriptEditorQuickOpen::_confirmed() { void ScriptEditorQuickOpen::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - connect("confirmed", callable_mp(this, &ScriptEditorQuickOpen::_confirmed)); + connect(SceneStringName(confirmed), callable_mp(this, &ScriptEditorQuickOpen::_confirmed)); search_box->set_clear_button_enabled(true); [[fallthrough]]; @@ -409,7 +409,7 @@ void ScriptEditorQuickOpen::_notification(int p_what) { } break; case NOTIFICATION_EXIT_TREE: { - disconnect("confirmed", callable_mp(this, &ScriptEditorQuickOpen::_confirmed)); + disconnect(SceneStringName(confirmed), callable_mp(this, &ScriptEditorQuickOpen::_confirmed)); } break; } } @@ -1759,10 +1759,10 @@ void ScriptEditor::_notification(int p_what) { EditorNode::get_singleton()->connect("scene_saved", callable_mp(this, &ScriptEditor::_scene_saved_callback)); FileSystemDock::get_singleton()->connect("files_moved", callable_mp(this, &ScriptEditor::_files_moved)); FileSystemDock::get_singleton()->connect("file_removed", callable_mp(this, &ScriptEditor::_file_removed)); - script_list->connect("item_selected", callable_mp(this, &ScriptEditor::_script_selected)); + script_list->connect(SceneStringName(item_selected), callable_mp(this, &ScriptEditor::_script_selected)); - members_overview->connect("item_selected", callable_mp(this, &ScriptEditor::_members_overview_selected)); - help_overview->connect("item_selected", callable_mp(this, &ScriptEditor::_help_overview_selected)); + members_overview->connect(SceneStringName(item_selected), callable_mp(this, &ScriptEditor::_members_overview_selected)); + help_overview->connect(SceneStringName(item_selected), callable_mp(this, &ScriptEditor::_help_overview_selected)); script_split->connect("dragged", callable_mp(this, &ScriptEditor::_split_dragged)); list_split->connect("dragged", callable_mp(this, &ScriptEditor::_split_dragged)); @@ -4247,7 +4247,7 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) { erase_tab_confirm = memnew(ConfirmationDialog); erase_tab_confirm->set_ok_button_text(TTR("Save")); erase_tab_confirm->add_button(TTR("Discard"), DisplayServer::get_singleton()->get_swap_cancel_ok(), "discard"); - erase_tab_confirm->connect("confirmed", callable_mp(this, &ScriptEditor::_close_current_tab).bind(true, true)); + erase_tab_confirm->connect(SceneStringName(confirmed), callable_mp(this, &ScriptEditor::_close_current_tab).bind(true, true)); erase_tab_confirm->connect("custom_action", callable_mp(this, &ScriptEditor::_close_discard_current_tab)); add_child(erase_tab_confirm); @@ -4284,7 +4284,7 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) { disk_changed_list->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); disk_changed_list->set_v_size_flags(SIZE_EXPAND_FILL); - disk_changed->connect("confirmed", callable_mp(this, &ScriptEditor::reload_scripts).bind(false)); + disk_changed->connect(SceneStringName(confirmed), callable_mp(this, &ScriptEditor::reload_scripts).bind(false)); disk_changed->set_ok_button_text(TTR("Discard local changes and reload")); disk_changed->add_button(TTR("Keep local changes and overwrite"), !DisplayServer::get_singleton()->get_swap_cancel_ok(), "resave"); diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 8dc398138ce3..a8daec7ccbf6 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -725,7 +725,7 @@ ShaderEditorPlugin::ShaderEditorPlugin() { shader_list->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); shader_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); vb->add_child(shader_list); - shader_list->connect("item_selected", callable_mp(this, &ShaderEditorPlugin::_shader_selected)); + shader_list->connect(SceneStringName(item_selected), callable_mp(this, &ShaderEditorPlugin::_shader_selected)); shader_list->connect("item_clicked", callable_mp(this, &ShaderEditorPlugin::_shader_list_clicked)); SET_DRAG_FORWARDING_GCD(shader_list, ShaderEditorPlugin); diff --git a/editor/plugins/shader_file_editor_plugin.cpp b/editor/plugins/shader_file_editor_plugin.cpp index dac55921130a..05919fb0f657 100644 --- a/editor/plugins/shader_file_editor_plugin.cpp +++ b/editor/plugins/shader_file_editor_plugin.cpp @@ -258,7 +258,7 @@ ShaderFileEditor::ShaderFileEditor() { versions = memnew(ItemList); versions->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); - versions->connect("item_selected", callable_mp(this, &ShaderFileEditor::_version_selected)); + versions->connect(SceneStringName(item_selected), callable_mp(this, &ShaderFileEditor::_version_selected)); versions->set_custom_minimum_size(Size2i(200 * EDSCALE, 0)); main_hs->add_child(versions); diff --git a/editor/plugins/skeleton_3d_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp index e4eaab732505..f5ae695aa44d 100644 --- a/editor/plugins/skeleton_3d_editor_plugin.cpp +++ b/editor/plugins/skeleton_3d_editor_plugin.cpp @@ -838,7 +838,7 @@ void Skeleton3DEditor::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { update_joint_tree(); - joint_tree->connect("item_selected", callable_mp(this, &Skeleton3DEditor::_joint_tree_selection_changed)); + joint_tree->connect(SceneStringName(item_selected), callable_mp(this, &Skeleton3DEditor::_joint_tree_selection_changed)); joint_tree->connect("item_mouse_selected", callable_mp(this, &Skeleton3DEditor::_joint_tree_rmb_select)); #ifdef TOOLS_ENABLED skeleton->connect(SceneStringName(pose_updated), callable_mp(this, &Skeleton3DEditor::_draw_gizmo)); diff --git a/editor/plugins/sprite_2d_editor_plugin.cpp b/editor/plugins/sprite_2d_editor_plugin.cpp index c7a89484f03c..a3f167d77895 100644 --- a/editor/plugins/sprite_2d_editor_plugin.cpp +++ b/editor/plugins/sprite_2d_editor_plugin.cpp @@ -618,7 +618,7 @@ Sprite2DEditor::Sprite2DEditor() { debug_uv->add_child(h_scroll); h_scroll->connect("value_changed", callable_mp(this, &Sprite2DEditor::_update_zoom_and_pan).unbind(1).bind(false)); - debug_uv_dialog->connect("confirmed", callable_mp(this, &Sprite2DEditor::_create_node)); + debug_uv_dialog->connect(SceneStringName(confirmed), callable_mp(this, &Sprite2DEditor::_create_node)); HBoxContainer *hb = memnew(HBoxContainer); hb->add_child(memnew(Label(TTR("Simplification:")))); diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index d1da61e5fcd4..844518187b58 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -2058,12 +2058,12 @@ SpriteFramesEditor::SpriteFramesEditor() { delete_dialog = memnew(ConfirmationDialog); add_child(delete_dialog); - delete_dialog->connect("confirmed", callable_mp(this, &SpriteFramesEditor::_animation_remove_confirmed)); + delete_dialog->connect(SceneStringName(confirmed), callable_mp(this, &SpriteFramesEditor::_animation_remove_confirmed)); split_sheet_dialog = memnew(ConfirmationDialog); add_child(split_sheet_dialog); split_sheet_dialog->set_title(TTR("Select Frames")); - split_sheet_dialog->connect("confirmed", callable_mp(this, &SpriteFramesEditor::_sheet_add_frames)); + split_sheet_dialog->connect(SceneStringName(confirmed), callable_mp(this, &SpriteFramesEditor::_sheet_add_frames)); HBoxContainer *split_sheet_hb = memnew(HBoxContainer); split_sheet_dialog->add_child(split_sheet_hb); @@ -2091,7 +2091,7 @@ SpriteFramesEditor::SpriteFramesEditor() { split_sheet_order->add_item(TTR("Top to Bottom, Right to Left"), FRAME_ORDER_TOP_BOTTOM_RIGHT_LEFT); split_sheet_order->add_item(TTR("Bottom to Top, Left to Right"), FRAME_ORDER_BOTTOM_TOP_LEFT_RIGHT); split_sheet_order->add_item(TTR("Bottom to Top, Right to Left"), FRAME_ORDER_BOTTOM_TOP_RIGHT_LEFT); - split_sheet_order->connect("item_selected", callable_mp(this, &SpriteFramesEditor::_sheet_order_selected)); + split_sheet_order->connect(SceneStringName(item_selected), callable_mp(this, &SpriteFramesEditor::_sheet_order_selected)); split_sheet_menu_hb->add_child(split_sheet_order); Button *select_all = memnew(Button); diff --git a/editor/plugins/text_shader_editor.cpp b/editor/plugins/text_shader_editor.cpp index 6c47f3aadba3..276c57533f72 100644 --- a/editor/plugins/text_shader_editor.cpp +++ b/editor/plugins/text_shader_editor.cpp @@ -1246,7 +1246,7 @@ TextShaderEditor::TextShaderEditor() { dl->set_text(TTR("This shader has been modified on disk.\nWhat action should be taken?")); vbc->add_child(dl); - disk_changed->connect("confirmed", callable_mp(this, &TextShaderEditor::_reload)); + disk_changed->connect(SceneStringName(confirmed), callable_mp(this, &TextShaderEditor::_reload)); disk_changed->set_ok_button_text(TTR("Reload")); disk_changed->add_button(TTR("Resave"), !DisplayServer::get_singleton()->get_swap_cancel_ok(), "resave"); diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 799d7c757d03..c61a8715f4cc 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -1138,7 +1138,7 @@ TextureRegionEditor::TextureRegionEditor() { snap_mode_button->add_item(TTR("Grid Snap"), 2); snap_mode_button->add_item(TTR("Auto Slice"), 3); snap_mode_button->select(snap_mode); - snap_mode_button->connect("item_selected", callable_mp(this, &TextureRegionEditor::_set_snap_mode)); + snap_mode_button->connect(SceneStringName(item_selected), callable_mp(this, &TextureRegionEditor::_set_snap_mode)); hb_grid = memnew(HBoxContainer); hb_tools->add_child(hb_grid); diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index 1fd6c3589e8c..ecb2b4f1a492 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -1935,7 +1935,7 @@ ThemeItemEditorDialog::ThemeItemEditorDialog(ThemeTypeEditor *p_theme_type_edito edit_type_list->set_columns(1); edit_type_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); edit_dialog_side_vb->add_child(edit_type_list); - edit_type_list->connect("item_selected", callable_mp(this, &ThemeItemEditorDialog::_edited_type_selected)); + edit_type_list->connect(SceneStringName(item_selected), callable_mp(this, &ThemeItemEditorDialog::_edited_type_selected)); edit_type_list->connect("button_clicked", callable_mp(this, &ThemeItemEditorDialog::_edited_type_button_pressed)); Label *edit_add_type_label = memnew(Label); @@ -2068,7 +2068,7 @@ ThemeItemEditorDialog::ThemeItemEditorDialog(ThemeTypeEditor *p_theme_type_edito theme_item_name = memnew(LineEdit); edit_theme_item_vb->add_child(theme_item_name); theme_item_name->connect(SceneStringName(gui_input), callable_mp(this, &ThemeItemEditorDialog::_edit_theme_item_gui_input)); - edit_theme_item_dialog->connect("confirmed", callable_mp(this, &ThemeItemEditorDialog::_confirm_edit_theme_item)); + edit_theme_item_dialog->connect(SceneStringName(confirmed), callable_mp(this, &ThemeItemEditorDialog::_confirm_edit_theme_item)); // Import Items tab. TabContainer *import_tc = memnew(TabContainer); @@ -2120,7 +2120,7 @@ ThemeItemEditorDialog::ThemeItemEditorDialog(ThemeTypeEditor *p_theme_type_edito confirm_closing_dialog = memnew(ConfirmationDialog); confirm_closing_dialog->set_autowrap(true); add_child(confirm_closing_dialog); - confirm_closing_dialog->connect("confirmed", callable_mp(this, &ThemeItemEditorDialog::_close_dialog)); + confirm_closing_dialog->connect(SceneStringName(confirmed), callable_mp(this, &ThemeItemEditorDialog::_close_dialog)); } /////////////////////// @@ -2254,13 +2254,13 @@ ThemeTypeDialog::ThemeTypeDialog() { add_type_options->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); add_type_options->set_v_size_flags(Control::SIZE_EXPAND_FILL); add_type_vb->add_child(add_type_options); - add_type_options->connect("item_selected", callable_mp(this, &ThemeTypeDialog::_add_type_options_cbk)); + add_type_options->connect(SceneStringName(item_selected), callable_mp(this, &ThemeTypeDialog::_add_type_options_cbk)); add_type_options->connect("item_activated", callable_mp(this, &ThemeTypeDialog::_add_type_dialog_activated)); add_type_confirmation = memnew(ConfirmationDialog); add_type_confirmation->set_title(TTR("Type name is empty!")); add_type_confirmation->set_text(TTR("Are you sure you want to create an empty type?")); - add_type_confirmation->connect("confirmed", callable_mp(this, &ThemeTypeDialog::_add_type_confirmed)); + add_type_confirmation->connect(SceneStringName(confirmed), callable_mp(this, &ThemeTypeDialog::_add_type_confirmed)); add_child(add_type_confirmation); } @@ -3441,7 +3441,7 @@ ThemeTypeEditor::ThemeTypeEditor() { theme_type_list->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_ELLIPSIS); theme_type_list->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); type_list_hb->add_child(theme_type_list); - theme_type_list->connect("item_selected", callable_mp(this, &ThemeTypeEditor::_list_type_selected)); + theme_type_list->connect(SceneStringName(item_selected), callable_mp(this, &ThemeTypeEditor::_list_type_selected)); add_type_button = memnew(Button); add_type_button->set_tooltip_text(TTR("Add a type from a list of available types or create a new one.")); diff --git a/editor/plugins/tiles/tile_map_layer_editor.cpp b/editor/plugins/tiles/tile_map_layer_editor.cpp index fa06c52e3eef..9fd781a530ca 100644 --- a/editor/plugins/tiles/tile_map_layer_editor.cpp +++ b/editor/plugins/tiles/tile_map_layer_editor.cpp @@ -242,7 +242,7 @@ void TileMapLayerEditorTilesPlugin::_update_tile_set_sources_list() { } else { sources_list->set_current(0); } - sources_list->emit_signal(SNAME("item_selected"), sources_list->get_current()); + sources_list->emit_signal(SceneStringName(item_selected), sources_list->get_current()); } // Synchronize the lists. @@ -2405,8 +2405,8 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() { sources_list->set_stretch_ratio(0.25); sources_list->set_custom_minimum_size(Size2(70, 0) * EDSCALE); sources_list->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST); - sources_list->connect("item_selected", callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_source_display).unbind(1)); - sources_list->connect("item_selected", callable_mp(TilesEditorUtils::get_singleton(), &TilesEditorUtils::set_sources_lists_current)); + sources_list->connect(SceneStringName(item_selected), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_source_display).unbind(1)); + sources_list->connect(SceneStringName(item_selected), callable_mp(TilesEditorUtils::get_singleton(), &TilesEditorUtils::set_sources_lists_current)); sources_list->connect("item_activated", callable_mp(TilesEditorUtils::get_singleton(), &TilesEditorUtils::display_tile_set_editor_panel).unbind(1)); sources_list->connect(SceneStringName(visibility_changed), callable_mp(TilesEditorUtils::get_singleton(), &TilesEditorUtils::synchronize_sources_list).bind(sources_list, source_sort_button)); sources_list->add_user_signal(MethodInfo("sort_request")); @@ -2471,7 +2471,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() { patterns_item_list->set_fixed_icon_size(Size2(thumbnail_size, thumbnail_size)); patterns_item_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); patterns_item_list->connect(SceneStringName(gui_input), callable_mp(this, &TileMapLayerEditorTilesPlugin::_patterns_item_list_gui_input)); - patterns_item_list->connect("item_selected", callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_selection_pattern_from_tileset_pattern_selection).unbind(1)); + patterns_item_list->connect(SceneStringName(item_selected), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_selection_pattern_from_tileset_pattern_selection).unbind(1)); patterns_item_list->connect("item_activated", callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_selection_pattern_from_tileset_pattern_selection).unbind(1)); patterns_item_list->connect("empty_clicked", callable_mp(this, &TileMapLayerEditorTilesPlugin::patterns_item_list_empty_clicked)); patterns_bottom_panel->add_child(patterns_item_list); @@ -3521,7 +3521,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() { terrains_tree->set_custom_minimum_size(Size2(70, 0) * EDSCALE); terrains_tree->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST); terrains_tree->set_hide_root(true); - terrains_tree->connect("item_selected", callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_tiles_list)); + terrains_tree->connect(SceneStringName(item_selected), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_tiles_list)); tilemap_tab_terrains->add_child(terrains_tree); terrains_tile_list = memnew(ItemList); @@ -4444,7 +4444,7 @@ TileMapLayerEditor::TileMapLayerEditor() { layers_selection_button->set_custom_minimum_size(Size2(200, 0)); layers_selection_button->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_ELLIPSIS); layers_selection_button->set_tooltip_text(TTR("TileMap Layers")); - layers_selection_button->connect("item_selected", callable_mp(this, &TileMapLayerEditor::_layers_selection_item_selected)); + layers_selection_button->connect(SceneStringName(item_selected), callable_mp(this, &TileMapLayerEditor::_layers_selection_item_selected)); layer_selection_hbox->add_child(layers_selection_button); select_previous_layer = memnew(Button); diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index 0003900ac963..94e68ccc7c6c 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -2595,7 +2595,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { tile_data_editors_tree->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT); tile_data_editors_tree->set_h_scroll_enabled(false); tile_data_editors_tree->set_v_scroll_enabled(false); - tile_data_editors_tree->connect("item_selected", callable_mp(this, &TileSetAtlasSourceEditor::_tile_data_editors_tree_selected)); + tile_data_editors_tree->connect(SceneStringName(item_selected), callable_mp(this, &TileSetAtlasSourceEditor::_tile_data_editors_tree_selected)); tile_data_editors_popup->add_child(tile_data_editors_tree); tile_data_painting_editor_container = memnew(VBoxContainer); @@ -2733,7 +2733,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { confirm_auto_create_tiles->set_text(TTR("The atlas's texture was modified.\nWould you like to automatically create tiles in the atlas?")); confirm_auto_create_tiles->set_ok_button_text(TTR("Yes")); confirm_auto_create_tiles->add_cancel_button()->set_text(TTR("No")); - confirm_auto_create_tiles->connect("confirmed", callable_mp(this, &TileSetAtlasSourceEditor::_auto_create_tiles)); + confirm_auto_create_tiles->connect(SceneStringName(confirmed), callable_mp(this, &TileSetAtlasSourceEditor::_auto_create_tiles)); confirm_auto_create_tiles->connect("canceled", callable_mp(this, &TileSetAtlasSourceEditor::_cancel_auto_create_tiles)); add_child(confirm_auto_create_tiles); diff --git a/editor/plugins/tiles/tile_set_editor.cpp b/editor/plugins/tiles/tile_set_editor.cpp index a20bd5132812..263e9cfa3b4a 100644 --- a/editor/plugins/tiles/tile_set_editor.cpp +++ b/editor/plugins/tiles/tile_set_editor.cpp @@ -218,7 +218,7 @@ void TileSetEditor::_update_sources_list(int force_selected_id) { sources_list->set_current(i); sources_list->ensure_current_is_visible(); if (old_selected != to_select) { - sources_list->emit_signal(SNAME("item_selected"), sources_list->get_current()); + sources_list->emit_signal(SceneStringName(item_selected), sources_list->get_current()); } break; } @@ -229,7 +229,7 @@ void TileSetEditor::_update_sources_list(int force_selected_id) { if (sources_list->get_current() < 0 && sources_list->get_item_count() > 0) { sources_list->set_current(0); if (old_selected != int(sources_list->get_item_metadata(0))) { - sources_list->emit_signal(SNAME("item_selected"), sources_list->get_current()); + sources_list->emit_signal(SceneStringName(item_selected), sources_list->get_current()); } } @@ -861,8 +861,8 @@ TileSetEditor::TileSetEditor() { sources_list->set_fixed_icon_size(Size2(60, 60) * EDSCALE); sources_list->set_h_size_flags(SIZE_EXPAND_FILL); sources_list->set_v_size_flags(SIZE_EXPAND_FILL); - sources_list->connect("item_selected", callable_mp(this, &TileSetEditor::_source_selected)); - sources_list->connect("item_selected", callable_mp(TilesEditorUtils::get_singleton(), &TilesEditorUtils::set_sources_lists_current)); + sources_list->connect(SceneStringName(item_selected), callable_mp(this, &TileSetEditor::_source_selected)); + sources_list->connect(SceneStringName(item_selected), callable_mp(TilesEditorUtils::get_singleton(), &TilesEditorUtils::set_sources_lists_current)); sources_list->connect(SceneStringName(visibility_changed), callable_mp(TilesEditorUtils::get_singleton(), &TilesEditorUtils::synchronize_sources_list).bind(sources_list, source_sort_button)); sources_list->add_user_signal(MethodInfo("sort_request")); sources_list->connect("sort_request", callable_mp(this, &TileSetEditor::_update_sources_list).bind(-1)); @@ -983,7 +983,7 @@ void TileSourceInspectorPlugin::_show_id_edit_dialog(Object *p_for_source) { vbox->add_child(id_input); id_input->set_max(INT_MAX); - id_edit_dialog->connect("confirmed", callable_mp(this, &TileSourceInspectorPlugin::_confirm_change_id)); + id_edit_dialog->connect(SceneStringName(confirmed), callable_mp(this, &TileSourceInspectorPlugin::_confirm_change_id)); } edited_source = p_for_source; id_input->set_value(p_for_source->get("id")); diff --git a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp index 88c117272c15..22ef779b8d90 100644 --- a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp @@ -562,8 +562,8 @@ TileSetScenesCollectionSourceEditor::TileSetScenesCollectionSourceEditor() { scene_tiles_list->set_h_size_flags(SIZE_EXPAND_FILL); scene_tiles_list->set_v_size_flags(SIZE_EXPAND_FILL); SET_DRAG_FORWARDING_CDU(scene_tiles_list, TileSetScenesCollectionSourceEditor); - scene_tiles_list->connect("item_selected", callable_mp(this, &TileSetScenesCollectionSourceEditor::_update_tile_inspector).unbind(1)); - scene_tiles_list->connect("item_selected", callable_mp(this, &TileSetScenesCollectionSourceEditor::_update_action_buttons).unbind(1)); + scene_tiles_list->connect(SceneStringName(item_selected), callable_mp(this, &TileSetScenesCollectionSourceEditor::_update_tile_inspector).unbind(1)); + scene_tiles_list->connect(SceneStringName(item_selected), callable_mp(this, &TileSetScenesCollectionSourceEditor::_update_action_buttons).unbind(1)); scene_tiles_list->connect("item_activated", callable_mp(this, &TileSetScenesCollectionSourceEditor::_scenes_list_item_activated)); scene_tiles_list->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST); right_vbox_container->add_child(scene_tiles_list); diff --git a/editor/plugins/tiles/tiles_editor_plugin.cpp b/editor/plugins/tiles/tiles_editor_plugin.cpp index f1cc69ce180c..3213c290fd1f 100644 --- a/editor/plugins/tiles/tiles_editor_plugin.cpp +++ b/editor/plugins/tiles/tiles_editor_plugin.cpp @@ -183,7 +183,7 @@ void TilesEditorUtils::synchronize_sources_list(Object *p_current_list, Object * } else { item_list->set_current(atlas_sources_lists_current); item_list->ensure_current_is_visible(); - item_list->emit_signal(SNAME("item_selected"), atlas_sources_lists_current); + item_list->emit_signal(SceneStringName(item_selected), atlas_sources_lists_current); } } } diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp index 3dfd2bcc04bd..d1febbded7ab 100644 --- a/editor/plugins/version_control_editor_plugin.cpp +++ b/editor/plugins/version_control_editor_plugin.cpp @@ -1194,7 +1194,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { unstaged_files->set_h_size_flags(Tree::SIZE_EXPAND_FILL); unstaged_files->set_v_size_flags(Tree::SIZE_EXPAND_FILL); unstaged_files->set_select_mode(Tree::SELECT_ROW); - unstaged_files->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_load_diff).bind(unstaged_files)); + unstaged_files->connect(SceneStringName(item_selected), callable_mp(this, &VersionControlEditorPlugin::_load_diff).bind(unstaged_files)); unstaged_files->connect(SNAME("item_activated"), callable_mp(this, &VersionControlEditorPlugin::_item_activated).bind(unstaged_files)); unstaged_files->connect(SNAME("button_clicked"), callable_mp(this, &VersionControlEditorPlugin::_cell_button_pressed)); unstaged_files->create_item(); @@ -1224,7 +1224,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { staged_files->set_h_size_flags(Tree::SIZE_EXPAND_FILL); staged_files->set_v_size_flags(Tree::SIZE_EXPAND_FILL); staged_files->set_select_mode(Tree::SELECT_ROW); - staged_files->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_load_diff).bind(staged_files)); + staged_files->connect(SceneStringName(item_selected), callable_mp(this, &VersionControlEditorPlugin::_load_diff).bind(staged_files)); staged_files->connect(SNAME("button_clicked"), callable_mp(this, &VersionControlEditorPlugin::_cell_button_pressed)); staged_files->connect(SNAME("item_activated"), callable_mp(this, &VersionControlEditorPlugin::_item_activated).bind(staged_files)); staged_files->create_item(); @@ -1281,7 +1281,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { commit_list_size_button->set_item_metadata(1, 20); commit_list_size_button->add_item("30"); commit_list_size_button->set_item_metadata(2, 30); - commit_list_size_button->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_set_commit_list_size)); + commit_list_size_button->connect(SceneStringName(item_selected), callable_mp(this, &VersionControlEditorPlugin::_set_commit_list_size)); commit_list_hbc->add_child(commit_list_size_button); commit_list = memnew(Tree); @@ -1294,7 +1294,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { commit_list->set_columns(2); // Commit msg, author commit_list->set_column_custom_minimum_width(0, 40); commit_list->set_column_custom_minimum_width(1, 20); - commit_list->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_load_diff).bind(commit_list)); + commit_list->connect(SceneStringName(item_selected), callable_mp(this, &VersionControlEditorPlugin::_load_diff).bind(commit_list)); version_commit_dock->add_child(commit_list); version_commit_dock->add_child(memnew(HSeparator)); @@ -1307,7 +1307,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { branch_select = memnew(OptionButton); branch_select->set_tooltip_text(TTR("Branches")); branch_select->set_h_size_flags(Control::SIZE_EXPAND_FILL); - branch_select->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_branch_item_selected)); + branch_select->connect(SceneStringName(item_selected), callable_mp(this, &VersionControlEditorPlugin::_branch_item_selected)); branch_select->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_refresh_branch_list)); menu_bar->add_child(branch_select); @@ -1352,7 +1352,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { remote_select = memnew(OptionButton); remote_select->set_tooltip_text(TTR("Remotes")); remote_select->set_h_size_flags(Control::SIZE_EXPAND_FILL); - remote_select->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_remote_selected)); + remote_select->connect(SceneStringName(item_selected), callable_mp(this, &VersionControlEditorPlugin::_remote_selected)); remote_select->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_refresh_remote_list)); menu_bar->add_child(remote_select); @@ -1492,7 +1492,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { diff_view_type_select = memnew(OptionButton); diff_view_type_select->add_item(TTR("Split"), DIFF_VIEW_TYPE_SPLIT); diff_view_type_select->add_item(TTR("Unified"), DIFF_VIEW_TYPE_UNIFIED); - diff_view_type_select->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_display_diff)); + diff_view_type_select->connect(SceneStringName(item_selected), callable_mp(this, &VersionControlEditorPlugin::_display_diff)); diff_heading->add_child(diff_view_type_select); diff = memnew(RichTextLabel); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 0f98c45ac1bb..c36700bda3b7 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -876,7 +876,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool OptionButton *op = memnew(OptionButton); hbox->add_child(op); op->set_h_size_flags(Control::SIZE_EXPAND_FILL); - op->connect("item_selected", callable_mp(editor, &VisualShaderEditor::_set_custom_node_option).bind(p_id, i), CONNECT_DEFERRED); + op->connect(SceneStringName(item_selected), callable_mp(editor, &VisualShaderEditor::_set_custom_node_option).bind(p_id, i), CONNECT_DEFERRED); for (const String &s : dp.options) { op->add_item(s); @@ -1124,7 +1124,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool type_box->add_item(TTR("Sampler")); type_box->select(group_node->get_input_port_type(j)); type_box->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); - type_box->connect("item_selected", callable_mp(editor, &VisualShaderEditor::_change_input_port_type).bind(p_id, j), CONNECT_DEFERRED); + type_box->connect(SceneStringName(item_selected), callable_mp(editor, &VisualShaderEditor::_change_input_port_type).bind(p_id, j), CONNECT_DEFERRED); LineEdit *name_box = memnew(LineEdit); hb->add_child(name_box); @@ -1188,7 +1188,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool type_box->add_item(TTR("Transform")); type_box->select(group_node->get_output_port_type(i)); type_box->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); - type_box->connect("item_selected", callable_mp(editor, &VisualShaderEditor::_change_output_port_type).bind(p_id, i), CONNECT_DEFERRED); + type_box->connect(SceneStringName(item_selected), callable_mp(editor, &VisualShaderEditor::_change_output_port_type).bind(p_id, i), CONNECT_DEFERRED); } else { Label *label = memnew(Label); label->set_auto_translate_mode(Node::AUTO_TRANSLATE_MODE_DISABLED); // TODO: Implement proper translation switch. @@ -6150,24 +6150,24 @@ VisualShaderEditor::VisualShaderEditor() { edit_type_standard->add_item(TTR("Fragment")); edit_type_standard->add_item(TTR("Light")); edit_type_standard->select(1); - edit_type_standard->connect("item_selected", callable_mp(this, &VisualShaderEditor::_mode_selected)); + edit_type_standard->connect(SceneStringName(item_selected), callable_mp(this, &VisualShaderEditor::_mode_selected)); edit_type_particles = memnew(OptionButton); edit_type_particles->add_item(TTR("Start")); edit_type_particles->add_item(TTR("Process")); edit_type_particles->add_item(TTR("Collide")); edit_type_particles->select(0); - edit_type_particles->connect("item_selected", callable_mp(this, &VisualShaderEditor::_mode_selected)); + edit_type_particles->connect(SceneStringName(item_selected), callable_mp(this, &VisualShaderEditor::_mode_selected)); edit_type_sky = memnew(OptionButton); edit_type_sky->add_item(TTR("Sky")); edit_type_sky->select(0); - edit_type_sky->connect("item_selected", callable_mp(this, &VisualShaderEditor::_mode_selected)); + edit_type_sky->connect(SceneStringName(item_selected), callable_mp(this, &VisualShaderEditor::_mode_selected)); edit_type_fog = memnew(OptionButton); edit_type_fog->add_item(TTR("Fog")); edit_type_fog->select(0); - edit_type_fog->connect("item_selected", callable_mp(this, &VisualShaderEditor::_mode_selected)); + edit_type_fog->connect(SceneStringName(item_selected), callable_mp(this, &VisualShaderEditor::_mode_selected)); edit_type = edit_type_standard; @@ -6300,7 +6300,7 @@ VisualShaderEditor::VisualShaderEditor() { members->set_hide_folding(false); members->set_custom_minimum_size(Size2(180 * EDSCALE, 200 * EDSCALE)); members->connect("item_activated", callable_mp(this, &VisualShaderEditor::_member_create)); - members->connect("item_selected", callable_mp(this, &VisualShaderEditor::_member_selected)); + members->connect(SceneStringName(item_selected), callable_mp(this, &VisualShaderEditor::_member_selected)); members->connect("nothing_selected", callable_mp(this, &VisualShaderEditor::_member_unselected)); HBoxContainer *desc_hbox = memnew(HBoxContainer); @@ -6403,7 +6403,7 @@ VisualShaderEditor::VisualShaderEditor() { varyings->set_hide_folding(false); varyings->set_custom_minimum_size(Size2(180 * EDSCALE, 200 * EDSCALE)); varyings->connect("item_activated", callable_mp(this, &VisualShaderEditor::_varying_deleted)); - varyings->connect("item_selected", callable_mp(this, &VisualShaderEditor::_varying_selected)); + varyings->connect(SceneStringName(item_selected), callable_mp(this, &VisualShaderEditor::_varying_selected)); varyings->connect("nothing_selected", callable_mp(this, &VisualShaderEditor::_varying_unselected)); } @@ -7133,7 +7133,7 @@ class VisualShaderNodePluginInputEditor : public OptionButton { void _notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: { - connect("item_selected", callable_mp(this, &VisualShaderNodePluginInputEditor::_item_selected)); + connect(SceneStringName(item_selected), callable_mp(this, &VisualShaderNodePluginInputEditor::_item_selected)); } break; } } @@ -7183,7 +7183,7 @@ class VisualShaderNodePluginVaryingEditor : public OptionButton { public: void _notification(int p_what) { if (p_what == NOTIFICATION_READY) { - connect("item_selected", callable_mp(this, &VisualShaderNodePluginVaryingEditor::_item_selected)); + connect(SceneStringName(item_selected), callable_mp(this, &VisualShaderNodePluginVaryingEditor::_item_selected)); } } @@ -7262,7 +7262,7 @@ class VisualShaderNodePluginParameterRefEditor : public OptionButton { void _notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: { - connect("item_selected", callable_mp(this, &VisualShaderNodePluginParameterRefEditor::_item_selected)); + connect(SceneStringName(item_selected), callable_mp(this, &VisualShaderNodePluginParameterRefEditor::_item_selected)); } break; } } @@ -7648,7 +7648,7 @@ EditorPropertyVisualShaderMode::EditorPropertyVisualShaderMode() { options->set_clip_text(true); add_child(options); add_focusable(options); - options->connect("item_selected", callable_mp(this, &EditorPropertyVisualShaderMode::_option_selected)); + options->connect(SceneStringName(item_selected), callable_mp(this, &EditorPropertyVisualShaderMode::_option_selected)); } bool EditorInspectorVisualShaderModePlugin::can_handle(Object *p_object) { diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index be979f0f150e..b4b8d58e01f4 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1253,7 +1253,7 @@ ProjectManager::ProjectManager() { filter_option->set_clip_text(true); filter_option->set_h_size_flags(Control::SIZE_EXPAND_FILL); filter_option->set_stretch_ratio(0.3); - filter_option->connect("item_selected", callable_mp(this, &ProjectManager::_on_order_option_changed)); + filter_option->connect(SceneStringName(item_selected), callable_mp(this, &ProjectManager::_on_order_option_changed)); hb->add_child(filter_option); Vector sort_filter_titles; @@ -1486,7 +1486,7 @@ ProjectManager::ProjectManager() { ask_full_convert_dialog = memnew(ConfirmationDialog); ask_full_convert_dialog->set_autowrap(true); ask_full_convert_dialog->set_text(TTR("This option will perform full project conversion, updating scenes, resources and scripts from Godot 3 to work in Godot 4.\n\nNote that this is a best-effort conversion, i.e. it makes upgrading the project easier, but it will not open out-of-the-box and will still require manual adjustments.\n\nIMPORTANT: Make sure to backup your project before converting, as this operation makes it impossible to open it in older versions of Godot.")); - ask_full_convert_dialog->connect("confirmed", callable_mp(this, &ProjectManager::_perform_full_project_conversion)); + ask_full_convert_dialog->connect(SceneStringName(confirmed), callable_mp(this, &ProjectManager::_perform_full_project_conversion)); add_child(ask_full_convert_dialog); project_dialog = memnew(ProjectDialog); diff --git a/editor/project_manager/quick_settings_dialog.cpp b/editor/project_manager/quick_settings_dialog.cpp index 59b329c73929..05e8523518e3 100644 --- a/editor/project_manager/quick_settings_dialog.cpp +++ b/editor/project_manager/quick_settings_dialog.cpp @@ -221,7 +221,7 @@ QuickSettingsDialog::QuickSettingsDialog() { { language_option_button = memnew(OptionButton); language_option_button->set_fit_to_longest_item(false); - language_option_button->connect("item_selected", callable_mp(this, &QuickSettingsDialog::_language_selected)); + language_option_button->connect(SceneStringName(item_selected), callable_mp(this, &QuickSettingsDialog::_language_selected)); for (int i = 0; i < editor_languages.size(); i++) { const String &lang_value = editor_languages[i]; @@ -237,7 +237,7 @@ QuickSettingsDialog::QuickSettingsDialog() { { theme_option_button = memnew(OptionButton); theme_option_button->set_fit_to_longest_item(false); - theme_option_button->connect("item_selected", callable_mp(this, &QuickSettingsDialog::_theme_selected)); + theme_option_button->connect(SceneStringName(item_selected), callable_mp(this, &QuickSettingsDialog::_theme_selected)); for (int i = 0; i < editor_themes.size(); i++) { const String &theme_value = editor_themes[i]; @@ -260,7 +260,7 @@ QuickSettingsDialog::QuickSettingsDialog() { { scale_option_button = memnew(OptionButton); scale_option_button->set_fit_to_longest_item(false); - scale_option_button->connect("item_selected", callable_mp(this, &QuickSettingsDialog::_scale_selected)); + scale_option_button->connect(SceneStringName(item_selected), callable_mp(this, &QuickSettingsDialog::_scale_selected)); for (int i = 0; i < editor_scales.size(); i++) { const String &scale_value = editor_scales[i]; @@ -274,7 +274,7 @@ QuickSettingsDialog::QuickSettingsDialog() { { network_mode_option_button = memnew(OptionButton); network_mode_option_button->set_fit_to_longest_item(false); - network_mode_option_button->connect("item_selected", callable_mp(this, &QuickSettingsDialog::_network_mode_selected)); + network_mode_option_button->connect(SceneStringName(item_selected), callable_mp(this, &QuickSettingsDialog::_network_mode_selected)); for (int i = 0; i < editor_network_modes.size(); i++) { const String &network_mode_value = editor_network_modes[i]; diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 26b5797d4465..208b10d02729 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -673,7 +673,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { feature_box = memnew(OptionButton); feature_box->set_custom_minimum_size(Size2(120, 0) * EDSCALE); - feature_box->connect("item_selected", callable_mp(this, &ProjectSettingsEditor::_feature_selected)); + feature_box->connect(SceneStringName(item_selected), callable_mp(this, &ProjectSettingsEditor::_feature_selected)); custom_properties->add_child(feature_box); type_box = memnew(OptionButton); diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp index a5157bd394b7..9bb156214810 100644 --- a/editor/property_selector.cpp +++ b/editor/property_selector.cpp @@ -410,11 +410,11 @@ void PropertySelector::_hide_requested() { void PropertySelector::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - connect("confirmed", callable_mp(this, &PropertySelector::_confirmed)); + connect(SceneStringName(confirmed), callable_mp(this, &PropertySelector::_confirmed)); } break; case NOTIFICATION_EXIT_TREE: { - disconnect("confirmed", callable_mp(this, &PropertySelector::_confirmed)); + disconnect(SceneStringName(confirmed), callable_mp(this, &PropertySelector::_confirmed)); } break; } } diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp index 9259ab13ab99..54ade75162dd 100644 --- a/editor/rename_dialog.cpp +++ b/editor/rename_dialog.cpp @@ -326,8 +326,8 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor) { spn_count_start->connect("value_changed", callable_mp(this, &RenameDialog::_update_preview_int)); spn_count_step->connect("value_changed", callable_mp(this, &RenameDialog::_update_preview_int)); spn_count_padding->connect("value_changed", callable_mp(this, &RenameDialog::_update_preview_int)); - opt_style->connect("item_selected", callable_mp(this, &RenameDialog::_update_preview_int)); - opt_case->connect("item_selected", callable_mp(this, &RenameDialog::_update_preview_int)); + opt_style->connect(SceneStringName(item_selected), callable_mp(this, &RenameDialog::_update_preview_int)); + opt_case->connect(SceneStringName(item_selected), callable_mp(this, &RenameDialog::_update_preview_int)); cbut_substitute->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_update_preview).bind("")); cbut_regex->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_update_preview).bind("")); cbut_process->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_update_preview).bind("")); diff --git a/editor/reparent_dialog.cpp b/editor/reparent_dialog.cpp index a139d180f041..a725508bc468 100644 --- a/editor/reparent_dialog.cpp +++ b/editor/reparent_dialog.cpp @@ -38,11 +38,11 @@ void ReparentDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - connect("confirmed", callable_mp(this, &ReparentDialog::_reparent)); + connect(SceneStringName(confirmed), callable_mp(this, &ReparentDialog::_reparent)); } break; case NOTIFICATION_EXIT_TREE: { - disconnect("confirmed", callable_mp(this, &ReparentDialog::_reparent)); + disconnect(SceneStringName(confirmed), callable_mp(this, &ReparentDialog::_reparent)); } break; } } diff --git a/editor/scene_create_dialog.cpp b/editor/scene_create_dialog.cpp index fe773378b065..36455be0bb1f 100644 --- a/editor/scene_create_dialog.cpp +++ b/editor/scene_create_dialog.cpp @@ -72,7 +72,7 @@ void SceneCreateDialog::config(const String &p_dir) { void SceneCreateDialog::accept_create() { if (!get_ok_button()->is_disabled()) { hide(); - emit_signal(SNAME("confirmed")); + emit_signal(SceneStringName(confirmed)); } } diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 11e477e04435..ef73be2399ac 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -1597,12 +1597,12 @@ void SceneTreeDock::_notification(int p_what) { } break; case NOTIFICATION_ENTER_TREE: { - clear_inherit_confirm->connect("confirmed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_SCENE_CLEAR_INHERITANCE_CONFIRM, false)); + clear_inherit_confirm->connect(SceneStringName(confirmed), callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_SCENE_CLEAR_INHERITANCE_CONFIRM, false)); scene_tree->set_auto_expand_selected(EDITOR_GET("docks/scene_tree/auto_expand_to_selected"), false); } break; case NOTIFICATION_EXIT_TREE: { - clear_inherit_confirm->disconnect("confirmed", callable_mp(this, &SceneTreeDock::_tool_selected)); + clear_inherit_confirm->disconnect(SceneStringName(confirmed), callable_mp(this, &SceneTreeDock::_tool_selected)); } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { @@ -2453,13 +2453,13 @@ void SceneTreeDock::_shader_created(Ref p_shader) { void SceneTreeDock::_script_creation_closed() { script_create_dialog->disconnect("script_created", callable_mp(this, &SceneTreeDock::_script_created)); - script_create_dialog->disconnect("confirmed", callable_mp(this, &SceneTreeDock::_script_creation_closed)); + script_create_dialog->disconnect(SceneStringName(confirmed), callable_mp(this, &SceneTreeDock::_script_creation_closed)); script_create_dialog->disconnect("canceled", callable_mp(this, &SceneTreeDock::_script_creation_closed)); } void SceneTreeDock::_shader_creation_closed() { shader_create_dialog->disconnect("shader_created", callable_mp(this, &SceneTreeDock::_shader_created)); - shader_create_dialog->disconnect("confirmed", callable_mp(this, &SceneTreeDock::_shader_creation_closed)); + shader_create_dialog->disconnect(SceneStringName(confirmed), callable_mp(this, &SceneTreeDock::_shader_creation_closed)); shader_create_dialog->disconnect("canceled", callable_mp(this, &SceneTreeDock::_shader_creation_closed)); } @@ -3860,7 +3860,7 @@ void SceneTreeDock::attach_script_to_selected(bool p_extend) { } script_create_dialog->connect("script_created", callable_mp(this, &SceneTreeDock::_script_created)); - script_create_dialog->connect("confirmed", callable_mp(this, &SceneTreeDock::_script_creation_closed)); + script_create_dialog->connect(SceneStringName(confirmed), callable_mp(this, &SceneTreeDock::_script_creation_closed)); script_create_dialog->connect("canceled", callable_mp(this, &SceneTreeDock::_script_creation_closed)); script_create_dialog->set_inheritance_base_type("Node"); script_create_dialog->config(inherits, path); @@ -3902,7 +3902,7 @@ void SceneTreeDock::attach_shader_to_selected(int p_preferred_mode) { } shader_create_dialog->connect("shader_created", callable_mp(this, &SceneTreeDock::_shader_created)); - shader_create_dialog->connect("confirmed", callable_mp(this, &SceneTreeDock::_shader_creation_closed)); + shader_create_dialog->connect(SceneStringName(confirmed), callable_mp(this, &SceneTreeDock::_shader_creation_closed)); shader_create_dialog->connect("canceled", callable_mp(this, &SceneTreeDock::_shader_creation_closed)); shader_create_dialog->config(path, true, true, -1, p_preferred_mode); shader_create_dialog->popup_centered(); @@ -4550,7 +4550,7 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec delete_dialog = memnew(ConfirmationDialog); add_child(delete_dialog); - delete_dialog->connect("confirmed", callable_mp(this, &SceneTreeDock::_delete_confirm).bind(false)); + delete_dialog->connect(SceneStringName(confirmed), callable_mp(this, &SceneTreeDock::_delete_confirm).bind(false)); VBoxContainer *vb = memnew(VBoxContainer); delete_dialog->add_child(vb); @@ -4564,11 +4564,11 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec editable_instance_remove_dialog = memnew(ConfirmationDialog); add_child(editable_instance_remove_dialog); - editable_instance_remove_dialog->connect("confirmed", callable_mp(this, &SceneTreeDock::_toggle_editable_children_from_selection)); + editable_instance_remove_dialog->connect(SceneStringName(confirmed), callable_mp(this, &SceneTreeDock::_toggle_editable_children_from_selection)); placeholder_editable_instance_remove_dialog = memnew(ConfirmationDialog); add_child(placeholder_editable_instance_remove_dialog); - placeholder_editable_instance_remove_dialog->connect("confirmed", callable_mp(this, &SceneTreeDock::_toggle_placeholder_from_selection)); + placeholder_editable_instance_remove_dialog->connect(SceneStringName(confirmed), callable_mp(this, &SceneTreeDock::_toggle_placeholder_from_selection)); new_scene_from_dialog = memnew(EditorFileDialog); new_scene_from_dialog->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 13fc5413b342..a056d531c19d 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -871,7 +871,7 @@ ScriptCreateDialog::ScriptCreateDialog() { language_menu->select(default_language); } - language_menu->connect("item_selected", callable_mp(this, &ScriptCreateDialog::_language_changed)); + language_menu->connect(SceneStringName(item_selected), callable_mp(this, &ScriptCreateDialog::_language_changed)); /* Inherits */ @@ -907,7 +907,7 @@ ScriptCreateDialog::ScriptCreateDialog() { template_menu = memnew(OptionButton); template_menu->set_h_size_flags(Control::SIZE_EXPAND_FILL); - template_menu->connect("item_selected", callable_mp(this, &ScriptCreateDialog::_template_changed)); + template_menu->connect(SceneStringName(item_selected), callable_mp(this, &ScriptCreateDialog::_template_changed)); template_hb->add_child(template_menu); gc->add_child(template_hb); diff --git a/editor/shader_create_dialog.cpp b/editor/shader_create_dialog.cpp index 6657aa612108..49e057eb6fda 100644 --- a/editor/shader_create_dialog.cpp +++ b/editor/shader_create_dialog.cpp @@ -606,7 +606,7 @@ ShaderCreateDialog::ShaderCreateDialog() { type_menu->select(default_type); } current_type = default_type; - type_menu->connect("item_selected", callable_mp(this, &ShaderCreateDialog::_type_changed)); + type_menu->connect(SceneStringName(item_selected), callable_mp(this, &ShaderCreateDialog::_type_changed)); // Modes. @@ -616,14 +616,14 @@ ShaderCreateDialog::ShaderCreateDialog() { } gc->add_child(memnew(Label(TTR("Mode:")))); gc->add_child(mode_menu); - mode_menu->connect("item_selected", callable_mp(this, &ShaderCreateDialog::_mode_changed)); + mode_menu->connect(SceneStringName(item_selected), callable_mp(this, &ShaderCreateDialog::_mode_changed)); // Templates. template_menu = memnew(OptionButton); gc->add_child(memnew(Label(TTR("Template:")))); gc->add_child(template_menu); - template_menu->connect("item_selected", callable_mp(this, &ShaderCreateDialog::_template_changed)); + template_menu->connect(SceneStringName(item_selected), callable_mp(this, &ShaderCreateDialog::_template_changed)); // Built-in Shader. diff --git a/editor/surface_upgrade_tool.cpp b/editor/surface_upgrade_tool.cpp index 6865985e43a4..f532535034da 100644 --- a/editor/surface_upgrade_tool.cpp +++ b/editor/surface_upgrade_tool.cpp @@ -190,7 +190,7 @@ void SurfaceUpgradeDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: // Can't do it in the constructor because it doesn't know that the signal exists. - connect("confirmed", callable_mp(SurfaceUpgradeTool::get_singleton(), &SurfaceUpgradeTool::prepare_upgrade)); + connect(SceneStringName(confirmed), callable_mp(SurfaceUpgradeTool::get_singleton(), &SurfaceUpgradeTool::prepare_upgrade)); break; } } diff --git a/modules/gltf/editor/editor_scene_importer_blend.cpp b/modules/gltf/editor/editor_scene_importer_blend.cpp index 4ad00c719b8c..400f51236e7d 100644 --- a/modules/gltf/editor/editor_scene_importer_blend.cpp +++ b/modules/gltf/editor/editor_scene_importer_blend.cpp @@ -517,7 +517,7 @@ bool EditorFileSystemImportFormatSupportQueryBlend::query() { configure_blender_dialog->set_ok_button_text(TTR("Confirm Path")); configure_blender_dialog->set_cancel_button_text(TTR("Disable '.blend' Import")); configure_blender_dialog->get_cancel_button()->set_tooltip_text(TTR("Disables Blender '.blend' files import for this project. Can be re-enabled in Project Settings.")); - configure_blender_dialog->connect("confirmed", callable_mp(this, &EditorFileSystemImportFormatSupportQueryBlend::_path_confirmed)); + configure_blender_dialog->connect(SceneStringName(confirmed), callable_mp(this, &EditorFileSystemImportFormatSupportQueryBlend::_path_confirmed)); browse_dialog = memnew(EditorFileDialog); browse_dialog->set_access(EditorFileDialog::ACCESS_FILESYSTEM); diff --git a/modules/gridmap/editor/grid_map_editor_plugin.cpp b/modules/gridmap/editor/grid_map_editor_plugin.cpp index 226cb48eb8ef..ff7800b4f390 100644 --- a/modules/gridmap/editor/grid_map_editor_plugin.cpp +++ b/modules/gridmap/editor/grid_map_editor_plugin.cpp @@ -1069,7 +1069,7 @@ void GridMapEditor::_update_theme() { void GridMapEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - mesh_library_palette->connect("item_selected", callable_mp(this, &GridMapEditor::_item_selected_cbk)); + mesh_library_palette->connect(SceneStringName(item_selected), callable_mp(this, &GridMapEditor::_item_selected_cbk)); for (int i = 0; i < 3; i++) { grid[i] = RS::get_singleton()->mesh_create(); grid_instance[i] = RS::get_singleton()->instance_create2(grid[i], get_tree()->get_root()->get_world_3d()->get_scenario()); diff --git a/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp b/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp index 28b875a4adec..604421c6b444 100644 --- a/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp +++ b/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp @@ -351,18 +351,18 @@ AudioStreamInteractiveTransitionEditor::AudioStreamInteractiveTransitionEditor() transition_from->add_item(TTR("Next Bar"), AudioStreamInteractive::TRANSITION_FROM_TIME_NEXT_BAR); transition_from->add_item(TTR("Clip End"), AudioStreamInteractive::TRANSITION_FROM_TIME_END); - transition_from->connect("item_selected", callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited).unbind(1)); + transition_from->connect(SceneStringName(item_selected), callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited).unbind(1)); transition_to = memnew(OptionButton); edit_vb->add_margin_child(TTR("Transition To:"), transition_to); transition_to->add_item(TTR("Same Position"), AudioStreamInteractive::TRANSITION_TO_TIME_SAME_POSITION); transition_to->add_item(TTR("Clip Start"), AudioStreamInteractive::TRANSITION_TO_TIME_START); transition_to->add_item(TTR("Prev Position"), AudioStreamInteractive::TRANSITION_TO_TIME_PREVIOUS_POSITION); - transition_to->connect("item_selected", callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited).unbind(1)); + transition_to->connect(SceneStringName(item_selected), callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited).unbind(1)); fade_mode = memnew(OptionButton); edit_vb->add_margin_child(TTR("Fade Mode:"), fade_mode); - fade_mode->connect("item_selected", callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited).unbind(1)); + fade_mode->connect(SceneStringName(item_selected), callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited).unbind(1)); fade_beats = memnew(SpinBox); edit_vb->add_margin_child(TTR("Fade Beats:"), fade_beats); @@ -373,7 +373,7 @@ AudioStreamInteractiveTransitionEditor::AudioStreamInteractiveTransitionEditor() filler_clip = memnew(OptionButton); edit_vb->add_margin_child(TTR("Filler Clip:"), filler_clip); filler_clip->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); - filler_clip->connect("item_selected", callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited).unbind(1)); + filler_clip->connect(SceneStringName(item_selected), callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited).unbind(1)); hold_previous = memnew(CheckBox); hold_previous->set_text(TTR("Enabled")); diff --git a/modules/multiplayer/editor/replication_editor.cpp b/modules/multiplayer/editor/replication_editor.cpp index b28572cf72d7..98bef48d3383 100644 --- a/modules/multiplayer/editor/replication_editor.cpp +++ b/modules/multiplayer/editor/replication_editor.cpp @@ -175,7 +175,7 @@ ReplicationEditor::ReplicationEditor() { delete_dialog = memnew(ConfirmationDialog); delete_dialog->connect("canceled", callable_mp(this, &ReplicationEditor::_dialog_closed).bind(false)); - delete_dialog->connect("confirmed", callable_mp(this, &ReplicationEditor::_dialog_closed).bind(true)); + delete_dialog->connect(SceneStringName(confirmed), callable_mp(this, &ReplicationEditor::_dialog_closed).bind(true)); add_child(delete_dialog); VBoxContainer *vb = memnew(VBoxContainer); diff --git a/modules/openxr/editor/openxr_action_editor.cpp b/modules/openxr/editor/openxr_action_editor.cpp index 06d2e8dcc9c1..31ef1f08a590 100644 --- a/modules/openxr/editor/openxr_action_editor.cpp +++ b/modules/openxr/editor/openxr_action_editor.cpp @@ -152,7 +152,7 @@ OpenXRActionEditor::OpenXRActionEditor(Ref p_action) { action_type_button->add_item("Haptic", OpenXRAction::OPENXR_ACTION_HAPTIC); action_type_button->select(int(action->get_action_type())); action_type_button->set_custom_minimum_size(Size2(100.0, 0.0)); - action_type_button->connect("item_selected", callable_mp(this, &OpenXRActionEditor::_on_item_selected)); + action_type_button->connect(SceneStringName(item_selected), callable_mp(this, &OpenXRActionEditor::_on_item_selected)); add_child(action_type_button); // maybe add dropdown to edit our toplevel paths, or do we deduce them from our suggested bindings? diff --git a/modules/openxr/editor/openxr_select_runtime.cpp b/modules/openxr/editor/openxr_select_runtime.cpp index f6aa157907d5..026797c6e012 100644 --- a/modules/openxr/editor/openxr_select_runtime.cpp +++ b/modules/openxr/editor/openxr_select_runtime.cpp @@ -98,11 +98,11 @@ void OpenXRSelectRuntime::_notification(int p_notification) { _update_items(); // Connect signal - connect("item_selected", callable_mp(this, &OpenXRSelectRuntime::_item_selected)); + connect(SceneStringName(item_selected), callable_mp(this, &OpenXRSelectRuntime::_item_selected)); } break; case NOTIFICATION_EXIT_TREE: { // Disconnect signal - disconnect("item_selected", callable_mp(this, &OpenXRSelectRuntime::_item_selected)); + disconnect(SceneStringName(item_selected), callable_mp(this, &OpenXRSelectRuntime::_item_selected)); } break; } } diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index 088c8fca26c1..7801c39ce6dc 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -134,7 +134,7 @@ void AcceptDialog::_ok_pressed() { set_visible(false); } ok_pressed(); - emit_signal(SNAME("confirmed")); + emit_signal(SceneStringName(confirmed)); set_input_as_handled(); } diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index a23ee6db7170..c9372525bd9d 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -1152,7 +1152,7 @@ void FileDialog::_update_option_controls() { } ob->select(opt.default_idx); grid_options->add_child(ob); - ob->connect("item_selected", callable_mp(this, &FileDialog::_option_changed_item_selected).bind(opt.name)); + ob->connect(SceneStringName(item_selected), callable_mp(this, &FileDialog::_option_changed_item_selected).bind(opt.name)); selected_options[opt.name] = opt.default_idx; } } @@ -1421,7 +1421,7 @@ FileDialog::FileDialog() { hbc->add_child(drives_container); drives = memnew(OptionButton); - drives->connect("item_selected", callable_mp(this, &FileDialog::_select_drive)); + drives->connect(SceneStringName(item_selected), callable_mp(this, &FileDialog::_select_drive)); hbc->add_child(drives); dir = memnew(LineEdit); @@ -1486,19 +1486,19 @@ FileDialog::FileDialog() { dir_access = DirAccess::create(DirAccess::ACCESS_RESOURCES); _update_drives(); - connect("confirmed", callable_mp(this, &FileDialog::_action_pressed)); + connect(SceneStringName(confirmed), callable_mp(this, &FileDialog::_action_pressed)); tree->connect("multi_selected", callable_mp(this, &FileDialog::_tree_multi_selected), CONNECT_DEFERRED); tree->connect("cell_selected", callable_mp(this, &FileDialog::_tree_selected), CONNECT_DEFERRED); tree->connect("item_activated", callable_mp(this, &FileDialog::_tree_item_activated)); tree->connect("nothing_selected", callable_mp(this, &FileDialog::deselect_all)); dir->connect("text_submitted", callable_mp(this, &FileDialog::_dir_submitted)); file->connect("text_submitted", callable_mp(this, &FileDialog::_file_submitted)); - filter->connect("item_selected", callable_mp(this, &FileDialog::_filter_selected)); + filter->connect(SceneStringName(item_selected), callable_mp(this, &FileDialog::_filter_selected)); confirm_save = memnew(ConfirmationDialog); add_child(confirm_save, false, INTERNAL_MODE_FRONT); - confirm_save->connect("confirmed", callable_mp(this, &FileDialog::_save_confirm_pressed)); + confirm_save->connect(SceneStringName(confirmed), callable_mp(this, &FileDialog::_save_confirm_pressed)); makedialog = memnew(ConfirmationDialog); makedialog->set_title(ETR("Create Folder")); @@ -1510,7 +1510,7 @@ FileDialog::FileDialog() { makevb->add_margin_child(ETR("Name:"), makedirname); add_child(makedialog, false, INTERNAL_MODE_FRONT); makedialog->register_text_enter(makedirname); - makedialog->connect("confirmed", callable_mp(this, &FileDialog::_make_dir_confirm)); + makedialog->connect(SceneStringName(confirmed), callable_mp(this, &FileDialog::_make_dir_confirm)); mkdirerr = memnew(AcceptDialog); mkdirerr->set_text(ETR("Could not create folder.")); add_child(mkdirerr, false, INTERNAL_MODE_FRONT); diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 40c694184c08..c6a2dd1e1087 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -733,7 +733,7 @@ void ItemList::gui_input(const Ref &p_event) { select(i, select_mode == SELECT_SINGLE || !mb->is_command_or_control_pressed()); if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected"), i); + emit_signal(SceneStringName(item_selected), i); } else { emit_signal(SNAME("multi_selected"), i, true); } @@ -775,7 +775,7 @@ void ItemList::gui_input(const Ref &p_event) { set_current(i); ensure_current_is_visible(); if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected"), current); + emit_signal(SceneStringName(item_selected), current); } break; @@ -798,7 +798,7 @@ void ItemList::gui_input(const Ref &p_event) { set_current(next); ensure_current_is_visible(); if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected"), current); + emit_signal(SceneStringName(item_selected), current); } accept_event(); } @@ -813,7 +813,7 @@ void ItemList::gui_input(const Ref &p_event) { set_current(i); ensure_current_is_visible(); if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected"), current); + emit_signal(SceneStringName(item_selected), current); } break; } @@ -835,7 +835,7 @@ void ItemList::gui_input(const Ref &p_event) { set_current(next); ensure_current_is_visible(); if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected"), current); + emit_signal(SceneStringName(item_selected), current); } accept_event(); } @@ -848,7 +848,7 @@ void ItemList::gui_input(const Ref &p_event) { set_current(index); ensure_current_is_visible(); if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected"), current); + emit_signal(SceneStringName(item_selected), current); } accept_event(); break; @@ -863,7 +863,7 @@ void ItemList::gui_input(const Ref &p_event) { set_current(index); ensure_current_is_visible(); if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected"), current); + emit_signal(SceneStringName(item_selected), current); } accept_event(); @@ -886,7 +886,7 @@ void ItemList::gui_input(const Ref &p_event) { set_current(next); ensure_current_is_visible(); if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected"), current); + emit_signal(SceneStringName(item_selected), current); } accept_event(); } @@ -906,7 +906,7 @@ void ItemList::gui_input(const Ref &p_event) { set_current(next); ensure_current_is_visible(); if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected"), current); + emit_signal(SceneStringName(item_selected), current); } accept_event(); } @@ -962,7 +962,7 @@ void ItemList::gui_input(const Ref &p_event) { set_current(i); ensure_current_is_visible(); if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected"), current); + emit_signal(SceneStringName(item_selected), current); } break; } diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp index 68e72ea99619..da15b44bdc8b 100644 --- a/scene/gui/option_button.cpp +++ b/scene/gui/option_button.cpp @@ -395,7 +395,7 @@ void OptionButton::_select(int p_which, bool p_emit) { } if (is_inside_tree() && p_emit) { - emit_signal(SNAME("item_selected"), current); + emit_signal(SceneStringName(item_selected), current); } } diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 56be6b90a28f..3f0e8a8955c7 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2693,7 +2693,7 @@ void Tree::select_single_item(TreeItem *p_selected, TreeItem *p_current, int p_c c.selected = true; selected_item = p_selected; if (!emitted_row) { - emit_signal(SNAME("item_selected")); + emit_signal(SceneStringName(item_selected)); emitted_row = true; } } else if (c.selected) { @@ -2717,7 +2717,7 @@ void Tree::select_single_item(TreeItem *p_selected, TreeItem *p_current, int p_c if (select_mode == SELECT_MULTI) { emit_signal(SNAME("multi_selected"), p_current, i, true); } else if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected")); + emit_signal(SceneStringName(item_selected)); } } else if (select_mode == SELECT_MULTI && (selected_item != p_selected || selected_col != i)) { diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp index 6a05aa78dafe..915fe58f7cf8 100644 --- a/scene/scene_string_names.cpp +++ b/scene/scene_string_names.cpp @@ -134,4 +134,8 @@ SceneStringNames::SceneStringNames() { id_pressed = StaticCString::create("id_pressed"); panel = StaticCString::create("panel"); + + item_selected = StaticCString::create("item_selected"); + + confirmed = StaticCString::create("confirmed"); } diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h index db11ec36a3e2..7e525e1a0f49 100644 --- a/scene/scene_string_names.h +++ b/scene/scene_string_names.h @@ -147,6 +147,10 @@ class SceneStringNames { StringName id_pressed; StringName panel; + + StringName item_selected; + + StringName confirmed; }; #define SceneStringName(m_name) SceneStringNames::get_singleton()->m_name