Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Scene] Add SceneStringNames::confirmed #92639

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion editor/action_map_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
16 changes: 8 additions & 8 deletions editor/animation_track_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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() {
Expand Down
6 changes: 3 additions & 3 deletions editor/connections_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.")));
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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));

Expand Down
6 changes: 3 additions & 3 deletions editor/create_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,11 @@ void CreateDialog::_sbox_input(const Ref<InputEvent> &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: {
Expand Down Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions editor/debugger/editor_profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion editor/debugger/editor_visual_profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions editor/debugger/script_editor_debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]];
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions editor/dependency_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion editor/editor_about.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion editor/editor_audio_buses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion editor/editor_build_profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions editor/editor_command_palette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions editor/editor_feature_profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions editor/editor_help_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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.
Expand All @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions editor/editor_inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion editor/editor_locale_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
{
Expand Down
Loading
Loading