From 8509c8c8fc01c227aed1edc64ab26307a1f6dbc2 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Mon, 14 Dec 2020 18:37:30 +0000 Subject: [PATCH] Rename AcceptDialog get_ok() to get_ok_button() Also renames: - AcceptDialog add_cancel() to add_cancel_button() - ConfirmationDiaglog get_cancel() to get_cancel_button() --- doc/classes/AcceptDialog.xml | 6 +- doc/classes/ConfirmationDialog.xml | 2 +- editor/animation_track_editor.cpp | 8 +- editor/connections_dialog.cpp | 10 +-- editor/create_dialog.cpp | 8 +- editor/dependency_editor.cpp | 8 +- editor/editor_asset_installer.cpp | 2 +- editor/editor_dir_dialog.cpp | 2 +- editor/editor_feature_profile.cpp | 2 +- editor/editor_file_dialog.cpp | 32 ++++---- editor/editor_help_search.cpp | 10 +-- editor/editor_node.cpp | 38 +++++----- editor/export_template_manager.cpp | 6 +- editor/filesystem_dock.cpp | 8 +- editor/find_in_files.cpp | 2 +- editor/groups_editor.cpp | 2 +- editor/import_dock.cpp | 2 +- editor/input_map_editor.cpp | 20 ++--- editor/plugin_config_dialog.cpp | 10 +-- editor/plugins/abstract_polygon_2d_editor.cpp | 2 +- .../animation_player_editor_plugin.cpp | 4 +- .../plugins/asset_library_editor_plugin.cpp | 4 +- .../gpu_particles_3d_editor_plugin.cpp | 2 +- .../mesh_instance_3d_editor_plugin.cpp | 2 +- editor/plugins/mesh_library_editor_plugin.cpp | 2 +- editor/plugins/multimesh_editor_plugin.cpp | 4 +- editor/plugins/node_3d_editor_plugin.cpp | 2 +- .../resource_preloader_editor_plugin.cpp | 4 +- editor/plugins/script_editor_plugin.cpp | 10 +-- editor/plugins/shader_editor_plugin.cpp | 2 +- editor/plugins/sprite_2d_editor_plugin.cpp | 10 +-- .../plugins/sprite_frames_editor_plugin.cpp | 12 +-- editor/plugins/theme_editor_plugin.cpp | 10 +-- .../plugins/version_control_editor_plugin.cpp | 2 +- .../plugins/visual_shader_editor_plugin.cpp | 12 +-- editor/project_export.cpp | 26 +++---- editor/project_manager.cpp | 76 +++++++++---------- editor/project_settings_editor.cpp | 2 +- editor/property_selector.cpp | 6 +- editor/quick_open.cpp | 6 +- editor/rename_dialog.cpp | 2 +- editor/reparent_dialog.cpp | 2 +- editor/scene_tree_dock.cpp | 2 +- editor/script_create_dialog.cpp | 14 ++-- editor/settings_config_dialog.cpp | 6 +- .../gdnative_library_editor_plugin.cpp | 2 +- .../visual_script/visual_script_editor.cpp | 10 +-- .../visual_script_property_selector.cpp | 6 +- scene/gui/dialogs.cpp | 14 ++-- scene/gui/dialogs.h | 6 +- scene/gui/file_dialog.cpp | 20 ++--- 51 files changed, 231 insertions(+), 231 deletions(-) diff --git a/doc/classes/AcceptDialog.xml b/doc/classes/AcceptDialog.xml index e5eb2160620e6..f4cf246713e46 100644 --- a/doc/classes/AcceptDialog.xml +++ b/doc/classes/AcceptDialog.xml @@ -23,7 +23,7 @@ If [code]true[/code], [code]right[/code] will place the button to the right of any sibling buttons. - + @@ -39,7 +39,7 @@ Returns the label used for built-in text. - + @@ -76,7 +76,7 @@ - Emitted when the dialog is closed or the button created with [method add_cancel] is pressed. + Emitted when the dialog is closed or the button created with [method add_cancel_button] is pressed. diff --git a/doc/classes/ConfirmationDialog.xml b/doc/classes/ConfirmationDialog.xml index a850afdd9fac8..9d8977cef1b0f 100644 --- a/doc/classes/ConfirmationDialog.xml +++ b/doc/classes/ConfirmationDialog.xml @@ -18,7 +18,7 @@ - + diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 7411af2280407..8933fc6e2e308 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -3360,7 +3360,7 @@ void AnimationTrackEditor::_query_insert(const InsertData &p_id) { } insert_confirm_bezier->set_visible(all_bezier); - insert_confirm->get_ok()->set_text(TTR("Create")); + insert_confirm->get_ok_button()->set_text(TTR("Create")); insert_confirm->popup_centered(); insert_query = true; } else { @@ -5789,7 +5789,7 @@ AnimationTrackEditor::AnimationTrackEditor() { optimize_max_angle->set_step(0.1); optimize_max_angle->set_value(22); - optimize_dialog->get_ok()->set_text(TTR("Optimize")); + optimize_dialog->get_ok_button()->set_text(TTR("Optimize")); optimize_dialog->connect("confirmed", callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed), varray(EDIT_CLEAN_UP_ANIMATION_CONFIRM)); // @@ -5814,7 +5814,7 @@ AnimationTrackEditor::AnimationTrackEditor() { cleanup_vb->add_child(cleanup_all); cleanup_dialog->set_title(TTR("Clean-Up Animation(s) (NO UNDO!)")); - cleanup_dialog->get_ok()->set_text(TTR("Clean-Up")); + cleanup_dialog->get_ok_button()->set_text(TTR("Clean-Up")); cleanup_dialog->connect("confirmed", callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed), varray(EDIT_CLEAN_UP_ANIMATION_CONFIRM)); @@ -5834,7 +5834,7 @@ AnimationTrackEditor::AnimationTrackEditor() { track_copy_dialog = memnew(ConfirmationDialog); add_child(track_copy_dialog); track_copy_dialog->set_title(TTR("Select Tracks to Copy")); - track_copy_dialog->get_ok()->set_text(TTR("Copy")); + track_copy_dialog->get_ok_button()->set_text(TTR("Copy")); VBoxContainer *track_vbox = memnew(VBoxContainer); track_copy_dialog->add_child(track_vbox); diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 2630589912831..473597b9b3753 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -252,16 +252,16 @@ void ConnectDialog::_update_ok_enabled() { Node *target = tree->get_selected(); if (target == nullptr) { - get_ok()->set_disabled(true); + get_ok_button()->set_disabled(true); return; } if (!advanced->is_pressed() && target->get_script().is_null()) { - get_ok()->set_disabled(true); + get_ok_button()->set_disabled(true); return; } - get_ok()->set_disabled(false); + get_ok_button()->set_disabled(false); } void ConnectDialog::_notification(int p_what) { @@ -496,8 +496,8 @@ ConnectDialog::ConnectDialog() { error = memnew(AcceptDialog); add_child(error); error->set_title(TTR("Cannot connect signal")); - error->get_ok()->set_text(TTR("Close")); - get_ok()->set_text(TTR("Connect")); + error->get_ok_button()->set_text(TTR("Close")); + get_ok_button()->set_text(TTR("Connect")); } ConnectDialog::~ConnectDialog() { diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 0f9c9bde7b909..75d57b040f197 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -57,10 +57,10 @@ void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode, const St if (p_replace_mode) { set_title(vformat(TTR("Change %s Type"), base_type)); - get_ok()->set_text(TTR("Change")); + get_ok_button()->set_text(TTR("Change")); } else { set_title(vformat(TTR("Create New %s"), base_type)); - get_ok()->set_text(TTR("Create")); + get_ok_button()->set_text(TTR("Create")); } _load_favorites_and_history(); @@ -195,7 +195,7 @@ void CreateDialog::_update_search() { } else { favorite->set_disabled(true); help_bit->set_text(""); - get_ok()->set_disabled(true); + get_ok_button()->set_disabled(true); search_options->deselect_all(); } } @@ -396,7 +396,7 @@ void CreateDialog::select_type(const String &p_type) { favorite->set_disabled(false); favorite->set_pressed(favorite_list.find(p_type) != -1); - get_ok()->set_disabled(false); + get_ok_button()->set_disabled(false); } String CreateDialog::get_selected_type() { diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp index 1a7a30ba4e162..a27f196d498f6 100644 --- a/editor/dependency_editor.cpp +++ b/editor/dependency_editor.cpp @@ -553,7 +553,7 @@ void DependencyRemoveDialog::_bind_methods() { } DependencyRemoveDialog::DependencyRemoveDialog() { - get_ok()->set_text(TTR("Remove")); + get_ok_button()->set_text(TTR("Remove")); VBoxContainer *vb = memnew(VBoxContainer); add_child(vb); @@ -619,8 +619,8 @@ DependencyErrorDialog::DependencyErrorDialog() { files->set_v_size_flags(Control::SIZE_EXPAND_FILL); set_min_size(Size2(500, 220) * EDSCALE); - get_ok()->set_text(TTR("Open Anyway")); - get_cancel()->set_text(TTR("Close")); + get_ok_button()->set_text(TTR("Open Anyway")); + get_cancel_button()->set_text(TTR("Close")); text = memnew(Label); vb->add_child(text); @@ -756,7 +756,7 @@ void OrphanResourcesDialog::_bind_methods() { OrphanResourcesDialog::OrphanResourcesDialog() { set_title(TTR("Orphan Resource Explorer")); delete_confirm = memnew(ConfirmationDialog); - get_ok()->set_text(TTR("Delete")); + get_ok_button()->set_text(TTR("Delete")); add_child(delete_confirm); dep_edit = memnew(DependencyEditor); add_child(dep_edit); diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp index 8aeeba52edcc5..aa6f7c8766cc5 100644 --- a/editor/editor_asset_installer.cpp +++ b/editor/editor_asset_installer.cpp @@ -335,7 +335,7 @@ EditorAssetInstaller::EditorAssetInstaller() { error = memnew(AcceptDialog); add_child(error); - get_ok()->set_text(TTR("Install")); + get_ok_button()->set_text(TTR("Install")); set_title(TTR("Package Installer")); updating = false; diff --git a/editor/editor_dir_dialog.cpp b/editor/editor_dir_dialog.cpp index 206fdef7c9ada..17e0fd0fae462 100644 --- a/editor/editor_dir_dialog.cpp +++ b/editor/editor_dir_dialog.cpp @@ -202,7 +202,7 @@ EditorDirDialog::EditorDirDialog() { mkdirerr->set_text(TTR("Could not create folder.")); add_child(mkdirerr); - get_ok()->set_text(TTR("Choose")); + get_ok_button()->set_text(TTR("Choose")); must_reload = false; } diff --git a/editor/editor_feature_profile.cpp b/editor/editor_feature_profile.cpp index 7335563dd9f5d..05bc2edefbbf2 100644 --- a/editor/editor_feature_profile.cpp +++ b/editor/editor_feature_profile.cpp @@ -890,7 +890,7 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { add_child(new_profile_dialog); new_profile_dialog->connect("confirmed", callable_mp(this, &EditorFeatureProfileManager::_create_new_profile)); new_profile_dialog->register_text_enter(new_profile_name); - new_profile_dialog->get_ok()->set_text(TTR("Create")); + new_profile_dialog->get_ok_button()->set_text(TTR("Create")); erase_profile_dialog = memnew(ConfirmationDialog); add_child(erase_profile_dialog); diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index ffdd7c7fa847c..8ded47605c49a 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -212,14 +212,14 @@ void EditorFileDialog::update_dir() { dir->set_text(dir_access->get_current_dir(false)); // Disable "Open" button only when selecting file(s) mode. - get_ok()->set_disabled(_is_open_should_be_disabled()); + get_ok_button()->set_disabled(_is_open_should_be_disabled()); switch (mode) { case FILE_MODE_OPEN_FILE: case FILE_MODE_OPEN_FILES: - get_ok()->set_text(TTR("Open")); + get_ok_button()->set_text(TTR("Open")); break; case FILE_MODE_OPEN_DIR: - get_ok()->set_text(TTR("Select Current Folder")); + get_ok_button()->set_text(TTR("Select Current Folder")); break; case FILE_MODE_OPEN_ANY: case FILE_MODE_SAVE_FILE: @@ -476,10 +476,10 @@ void EditorFileDialog::_item_selected(int p_item) { file->set_text(d["name"]); _request_single_thumbnail(get_current_dir().plus_file(get_current_file())); } else if (mode == FILE_MODE_OPEN_DIR) { - get_ok()->set_text(TTR("Select This Folder")); + get_ok_button()->set_text(TTR("Select This Folder")); } - get_ok()->set_disabled(_is_open_should_be_disabled()); + get_ok_button()->set_disabled(_is_open_should_be_disabled()); } void EditorFileDialog::_multi_selected(int p_item, bool p_selected) { @@ -495,7 +495,7 @@ void EditorFileDialog::_multi_selected(int p_item, bool p_selected) { _request_single_thumbnail(get_current_dir().plus_file(get_current_file())); } - get_ok()->set_disabled(_is_open_should_be_disabled()); + get_ok_button()->set_disabled(_is_open_should_be_disabled()); } void EditorFileDialog::_items_clear_selection() { @@ -505,13 +505,13 @@ void EditorFileDialog::_items_clear_selection() { switch (mode) { case FILE_MODE_OPEN_FILE: case FILE_MODE_OPEN_FILES: - get_ok()->set_text(TTR("Open")); - get_ok()->set_disabled(!item_list->is_anything_selected()); + get_ok_button()->set_text(TTR("Open")); + get_ok_button()->set_disabled(!item_list->is_anything_selected()); break; case FILE_MODE_OPEN_DIR: - get_ok()->set_disabled(false); - get_ok()->set_text(TTR("Select Current Folder")); + get_ok_button()->set_disabled(false); + get_ok_button()->set_text(TTR("Select Current Folder")); break; case FILE_MODE_OPEN_ANY: @@ -855,7 +855,7 @@ void EditorFileDialog::update_file_list() { favorite->set_pressed(false); fav_up->set_disabled(true); fav_down->set_disabled(true); - get_ok()->set_disabled(_is_open_should_be_disabled()); + get_ok_button()->set_disabled(_is_open_should_be_disabled()); for (int i = 0; i < favorites->get_item_count(); i++) { if (favorites->get_item_metadata(i) == cdir || favorites->get_item_metadata(i) == cdir + "/") { favorites->select(i); @@ -978,27 +978,27 @@ void EditorFileDialog::set_file_mode(FileMode p_mode) { mode = p_mode; switch (mode) { case FILE_MODE_OPEN_FILE: - get_ok()->set_text(TTR("Open")); + get_ok_button()->set_text(TTR("Open")); set_title(TTR("Open a File")); can_create_dir = false; break; case FILE_MODE_OPEN_FILES: - get_ok()->set_text(TTR("Open")); + get_ok_button()->set_text(TTR("Open")); set_title(TTR("Open File(s)")); can_create_dir = false; break; case FILE_MODE_OPEN_DIR: - get_ok()->set_text(TTR("Open")); + get_ok_button()->set_text(TTR("Open")); set_title(TTR("Open a Directory")); can_create_dir = true; break; case FILE_MODE_OPEN_ANY: - get_ok()->set_text(TTR("Open")); + get_ok_button()->set_text(TTR("Open")); set_title(TTR("Open a File or Directory")); can_create_dir = true; break; case FILE_MODE_SAVE_FILE: - get_ok()->set_text(TTR("Save")); + get_ok_button()->set_text(TTR("Save")); set_title(TTR("Save a File")); can_create_dir = true; break; diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index 4392538737cfa..c5d89b713c16d 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -105,7 +105,7 @@ void EditorHelpSearch::_notification(int p_what) { case NOTIFICATION_VISIBILITY_CHANGED: { if (!is_visible()) { results_tree->call_deferred("clear"); // Wait for the Tree's mouse event propagation. - get_ok()->set_disabled(true); + get_ok_button()->set_disabled(true); EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "search_help", Rect2(get_position(), get_size())); } } break; @@ -130,7 +130,7 @@ void EditorHelpSearch::_notification(int p_what) { old_search = false; } - get_ok()->set_disabled(!results_tree->get_selected()); + get_ok_button()->set_disabled(!results_tree->get_selected()); search = Ref(); set_process(false); @@ -182,8 +182,8 @@ EditorHelpSearch::EditorHelpSearch() { set_title(TTR("Search Help")); - get_ok()->set_disabled(true); - get_ok()->set_text(TTR("Open")); + get_ok_button()->set_disabled(true); + get_ok_button()->set_text(TTR("Open")); // Split search and results area. VBoxContainer *vbox = memnew(VBoxContainer); @@ -244,7 +244,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(), &BaseButton::set_disabled), varray(false)); + results_tree->connect("item_selected", callable_mp((BaseButton *)get_ok_button(), &BaseButton::set_disabled), varray(false)); vbox->add_child(results_tree, true); } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 8cdb86593703b..5fec3fbf53ccc 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2271,7 +2271,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { if (unsaved_cache || p_option == FILE_CLOSE_ALL_AND_QUIT || p_option == FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER) { String scene_filename = editor_data.get_edited_scene_root(tab_closing)->get_filename(); - save_confirmation->get_ok()->set_text(TTR("Save & Close")); + save_confirmation->get_ok_button()->set_text(TTR("Save & Close")); save_confirmation->set_text(vformat(TTR("Save changes to '%s' before closing?"), scene_filename != "" ? scene_filename : "unsaved scene")); save_confirmation->popup_centered(); break; @@ -2362,8 +2362,8 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { } break; case FILE_SAVE_BEFORE_RUN: { if (!p_confirmed) { - confirmation->get_cancel()->set_text(TTR("No")); - confirmation->get_ok()->set_text(TTR("Yes")); + confirmation->get_cancel_button()->set_text(TTR("No")); + confirmation->get_ok_button()->set_text(TTR("Yes")); confirmation->set_text(TTR("This scene has never been saved. Save before running?")); confirmation->popup_centered(); break; @@ -2427,7 +2427,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { case FILE_EXTERNAL_OPEN_SCENE: { if (unsaved_cache && !p_confirmed) { - confirmation->get_ok()->set_text(TTR("Open")); + confirmation->get_ok_button()->set_text(TTR("Open")); confirmation->set_text(TTR("Current scene not saved. Open anyway?")); confirmation->popup_centered(); break; @@ -2483,7 +2483,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { } if (unsaved_cache && !p_confirmed) { - confirmation->get_ok()->set_text(TTR("Reload Saved Scene")); + confirmation->get_ok_button()->set_text(TTR("Reload Saved Scene")); confirmation->set_text( TTR("The current scene has unsaved changes.\nReload the saved scene anyway? This action cannot be undone.")); confirmation->popup_centered(); @@ -2587,7 +2587,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { if (_next_unsaved_scene(!save_each) == -1) { bool confirm = EDITOR_GET("interface/editor/quit_confirmation"); if (confirm) { - confirmation->get_ok()->set_text(p_option == FILE_QUIT ? TTR("Quit") : TTR("Yes")); + confirmation->get_ok_button()->set_text(p_option == FILE_QUIT ? TTR("Quit") : TTR("Yes")); confirmation->set_text(p_option == FILE_QUIT ? TTR("Exit the editor?") : TTR("Open Project Manager?")); confirmation->popup_centered(); } else { @@ -2605,7 +2605,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { i = _next_unsaved_scene(true, ++i); } - save_confirmation->get_ok()->set_text(TTR("Save & Quit")); + save_confirmation->get_ok_button()->set_text(TTR("Save & Quit")); save_confirmation->set_text((p_option == FILE_QUIT ? TTR("Save changes to the following scene(s) before quitting?") : TTR("Save changes the following scene(s) before opening Project Manager?")) + unsaved_scenes); save_confirmation->popup_centered(); } @@ -3948,7 +3948,7 @@ Error EditorNode::export_preset(const String &p_preset, const String &p_path, bo void EditorNode::show_accept(const String &p_text, const String &p_title) { current_option = -1; - accept->get_ok()->set_text(p_title); + accept->get_ok_button()->set_text(p_title); accept->set_text(p_text); accept->popup_centered(); } @@ -4647,14 +4647,14 @@ void EditorNode::_layout_menu_option(int p_id) { case SETTINGS_LAYOUT_SAVE: { current_option = p_id; layout_dialog->set_title(TTR("Save Layout")); - layout_dialog->get_ok()->set_text(TTR("Save")); + layout_dialog->get_ok_button()->set_text(TTR("Save")); layout_dialog->popup_centered(); layout_dialog->set_name_line_enabled(true); } break; case SETTINGS_LAYOUT_DELETE: { current_option = p_id; layout_dialog->set_title(TTR("Delete Layout")); - layout_dialog->get_ok()->set_text(TTR("Delete")); + layout_dialog->get_ok_button()->set_text(TTR("Delete")); layout_dialog->popup_centered(); layout_dialog->set_name_line_enabled(false); } break; @@ -4696,7 +4696,7 @@ void EditorNode::_scene_tab_closed(int p_tab, int option) { saved_version != editor_data.get_undo_redo().get_version() : editor_data.get_scene_version(p_tab) != 0; if (unsaved) { - save_confirmation->get_ok()->set_text(TTR("Save & Close")); + save_confirmation->get_ok_button()->set_text(TTR("Save & Close")); save_confirmation->set_text(vformat(TTR("Save changes to '%s' before closing?"), scene->get_filename() != "" ? scene->get_filename() : "unsaved scene")); save_confirmation->popup_centered(); } else { @@ -5475,7 +5475,7 @@ static void _execute_thread(void *p_ud) { int EditorNode::execute_and_show_output(const String &p_title, const String &p_path, const List &p_arguments, bool p_close_on_ok, bool p_close_on_errors) { execute_output_dialog->set_title(p_title); - execute_output_dialog->get_ok()->set_disabled(true); + execute_output_dialog->get_ok_button()->set_disabled(true); execute_outputs->clear(); execute_outputs->set_scroll_follow(true); execute_output_dialog->popup_centered_ratio(); @@ -5516,7 +5516,7 @@ int EditorNode::execute_and_show_output(const String &p_title, const String &p_p execute_output_dialog->hide(); } - execute_output_dialog->get_ok()->set_disabled(false); + execute_output_dialog->get_ok_button()->set_disabled(false); return eta.exitcode; } @@ -6388,7 +6388,7 @@ EditorNode::EditorNode() { #endif video_restart_dialog = memnew(ConfirmationDialog); video_restart_dialog->set_text(TTR("Changing the video driver requires restarting the editor.")); - video_restart_dialog->get_ok()->set_text(TTR("Save & Restart")); + video_restart_dialog->get_ok_button()->set_text(TTR("Save & Restart")); video_restart_dialog->connect("confirmed", callable_mp(this, &EditorNode::_menu_option), varray(SET_VIDEO_DRIVER_SAVE_AND_RESTART)); gui_base->add_child(video_restart_dialog); @@ -6535,19 +6535,19 @@ EditorNode::EditorNode() { custom_build_manage_templates = memnew(ConfirmationDialog); custom_build_manage_templates->set_text(TTR("Android build template is missing, please install relevant templates.")); - custom_build_manage_templates->get_ok()->set_text(TTR("Manage Templates")); + custom_build_manage_templates->get_ok_button()->set_text(TTR("Manage Templates")); custom_build_manage_templates->connect("confirmed", callable_mp(this, &EditorNode::_menu_option), varray(SETTINGS_MANAGE_EXPORT_TEMPLATES)); gui_base->add_child(custom_build_manage_templates); install_android_build_template = memnew(ConfirmationDialog); install_android_build_template->set_text(TTR("This will set up your project for custom Android builds by installing the source template to \"res://android/build\".\nYou can then apply modifications and build your own custom APK on export (adding modules, changing the AndroidManifest.xml, etc.).\nNote that in order to make custom builds instead of using pre-built APKs, the \"Use Custom Build\" option should be enabled in the Android export preset.")); - install_android_build_template->get_ok()->set_text(TTR("Install")); + install_android_build_template->get_ok_button()->set_text(TTR("Install")); install_android_build_template->connect("confirmed", callable_mp(this, &EditorNode::_menu_confirm_current)); gui_base->add_child(install_android_build_template); remove_android_build_template = memnew(ConfirmationDialog); remove_android_build_template->set_text(TTR("The Android build template is already installed in this project and it won't be overwritten.\nRemove the \"res://android/build\" directory manually before attempting this operation again.")); - remove_android_build_template->get_ok()->set_text(TTR("Show in File Manager")); + remove_android_build_template->get_ok_button()->set_text(TTR("Show in File Manager")); remove_android_build_template->connect("confirmed", callable_mp(this, &EditorNode::_menu_option), varray(FILE_EXPLORE_ANDROID_BUILD_TEMPLATES)); gui_base->add_child(remove_android_build_template); @@ -6750,7 +6750,7 @@ EditorNode::EditorNode() { set_process(true); open_imported = memnew(ConfirmationDialog); - open_imported->get_ok()->set_text(TTR("Open Anyway")); + open_imported->get_ok_button()->set_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("custom_action", callable_mp(this, &EditorNode::_inherit_imported)); @@ -6800,7 +6800,7 @@ EditorNode::EditorNode() { pick_main_scene = memnew(ConfirmationDialog); gui_base->add_child(pick_main_scene); - pick_main_scene->get_ok()->set_text(TTR("Select")); + pick_main_scene->get_ok_button()->set_text(TTR("Select")); pick_main_scene->connect("confirmed", callable_mp(this, &EditorNode::_menu_option), varray(SETTINGS_PICK_MAIN_SCENE)); for (int i = 0; i < _init_callbacks.size(); i++) { diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index 84517f36ea417..e9b6f6b5e95c4 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -661,8 +661,8 @@ ExportTemplateManager::ExportTemplateManager() { installed_scroll->set_enable_h_scroll(false); installed_vb->set_h_size_flags(Control::SIZE_EXPAND_FILL); - get_cancel()->set_text(TTR("Close")); - get_ok()->set_text(TTR("Install From File")); + get_cancel_button()->set_text(TTR("Close")); + get_ok_button()->set_text(TTR("Install From File")); remove_confirm = memnew(ConfirmationDialog); remove_confirm->set_title(TTR("Remove Template")); @@ -690,7 +690,7 @@ ExportTemplateManager::ExportTemplateManager() { template_downloader = memnew(AcceptDialog); template_downloader->set_title(TTR("Download Templates")); - template_downloader->get_ok()->set_text(TTR("Close")); + template_downloader->get_ok_button()->set_text(TTR("Close")); template_downloader->set_exclusive(true); add_child(template_downloader); template_downloader->connect("cancelled", callable_mp(this, &ExportTemplateManager::_window_template_downloader_closed)); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 364c52d633331..6c8bd1901e009 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -2837,7 +2837,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { add_child(remove_dialog); move_dialog = memnew(EditorDirDialog); - move_dialog->get_ok()->set_text(TTR("Move")); + move_dialog->get_ok_button()->set_text(TTR("Move")); add_child(move_dialog); move_dialog->connect("dir_selected", callable_mp(this, &FileSystemDock::_move_operation_confirm), make_binds(false)); @@ -2847,13 +2847,13 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { rename_dialog_text = memnew(LineEdit); rename_dialog_vb->add_margin_child(TTR("Name:"), rename_dialog_text); - rename_dialog->get_ok()->set_text(TTR("Rename")); + rename_dialog->get_ok_button()->set_text(TTR("Rename")); add_child(rename_dialog); rename_dialog->register_text_enter(rename_dialog_text); rename_dialog->connect("confirmed", callable_mp(this, &FileSystemDock::_rename_operation_confirm)); overwrite_dialog = memnew(ConfirmationDialog); - overwrite_dialog->get_ok()->set_text(TTR("Overwrite")); + overwrite_dialog->get_ok_button()->set_text(TTR("Overwrite")); add_child(overwrite_dialog); overwrite_dialog->connect("confirmed", callable_mp(this, &FileSystemDock::_move_with_overwrite)); @@ -2863,7 +2863,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { duplicate_dialog_text = memnew(LineEdit); duplicate_dialog_vb->add_margin_child(TTR("Name:"), duplicate_dialog_text); - duplicate_dialog->get_ok()->set_text(TTR("Duplicate")); + duplicate_dialog->get_ok_button()->set_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)); diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index abcb7bbd930a4..8c82eca45278f 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -383,7 +383,7 @@ FindInFilesDialog::FindInFilesDialog() { _replace_button = add_button(TTR("Replace..."), false, "replace"); _replace_button->set_disabled(true); - Button *cancel_button = get_ok(); + Button *cancel_button = get_ok_button(); cancel_button->set_text(TTR("Cancel")); _mode = SEARCH_MODE; diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp index f3bad8d86d748..32c50321d7809 100644 --- a/editor/groups_editor.cpp +++ b/editor/groups_editor.cpp @@ -540,7 +540,7 @@ GroupDialog::GroupDialog() { error = memnew(ConfirmationDialog); add_child(error); - error->get_ok()->set_text(TTR("Close")); + error->get_ok_button()->set_text(TTR("Close")); } //////////////////////////////////////////////////////////////////////////////// diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp index 8ab2e0aef1dd8..5582f9f5f0e4c 100644 --- a/editor/import_dock.cpp +++ b/editor/import_dock.cpp @@ -536,7 +536,7 @@ ImportDock::ImportDock() { hb->add_spacer(); reimport_confirm = memnew(ConfirmationDialog); - reimport_confirm->get_ok()->set_text(TTR("Save Scenes, Re-Import, and Restart")); + reimport_confirm->get_ok_button()->set_text(TTR("Save Scenes, Re-Import, and Restart")); add_child(reimport_confirm); reimport_confirm->connect("confirmed", callable_mp(this, &ImportDock::_reimport_and_restart)); diff --git a/editor/input_map_editor.cpp b/editor/input_map_editor.cpp index 686fd4c08b718..83adccb752d87 100644 --- a/editor/input_map_editor.cpp +++ b/editor/input_map_editor.cpp @@ -398,7 +398,7 @@ void InputMapEditor::_wait_for_key(const Ref &p_event) { const String str = (press_a_key_physical) ? keycode_get_string(k->get_physical_keycode_with_modifiers()) + TTR(" (Physical)") : keycode_get_string(k->get_keycode_with_modifiers()); press_a_key_label->set_text(str); - press_a_key->get_ok()->set_disabled(false); + press_a_key->get_ok_button()->set_disabled(false); press_a_key->set_input_as_handled(); } } @@ -432,7 +432,7 @@ void InputMapEditor::_add_item(int p_item, Ref p_exiting_event) { case INPUT_KEY: { press_a_key_physical = false; press_a_key_label->set_text(TTR("Press a Key...")); - press_a_key->get_ok()->set_disabled(true); + press_a_key->get_ok_button()->set_disabled(true); last_wait_for_key = Ref(); press_a_key->popup_centered(Size2(250, 80) * EDSCALE); //press_a_key->grab_focus(); @@ -465,10 +465,10 @@ void InputMapEditor::_add_item(int p_item, Ref p_exiting_event) { if (mb.is_valid()) { device_index->select(mb->get_button_index() - 1); _set_current_device(mb->get_device()); - device_input->get_ok()->set_text(TTR("Change")); + device_input->get_ok_button()->set_text(TTR("Change")); } else { _set_current_device(0); - device_input->get_ok()->set_text(TTR("Add")); + device_input->get_ok_button()->set_text(TTR("Add")); } } break; @@ -488,10 +488,10 @@ void InputMapEditor::_add_item(int p_item, Ref p_exiting_event) { if (jm.is_valid()) { device_index->select(jm->get_axis() * 2 + (jm->get_axis_value() > 0 ? 1 : 0)); _set_current_device(jm->get_device()); - device_input->get_ok()->set_text(TTR("Change")); + device_input->get_ok_button()->set_text(TTR("Change")); } else { _set_current_device(0); - device_input->get_ok()->set_text(TTR("Add")); + device_input->get_ok_button()->set_text(TTR("Add")); } } break; @@ -510,10 +510,10 @@ void InputMapEditor::_add_item(int p_item, Ref p_exiting_event) { if (jb.is_valid()) { device_index->select(jb->get_button_index()); _set_current_device(jb->get_device()); - device_input->get_ok()->set_text(TTR("Change")); + device_input->get_ok_button()->set_text(TTR("Change")); } else { _set_current_device(0); - device_input->get_ok()->set_text(TTR("Add")); + device_input->get_ok_button()->set_text(TTR("Add")); } } break; @@ -978,7 +978,7 @@ InputMapEditor::InputMapEditor() { add_child(popup_add); press_a_key = memnew(ConfirmationDialog); - press_a_key->get_ok()->set_disabled(true); + press_a_key->get_ok_button()->set_disabled(true); //press_a_key->set_focus_mode(Control::FOCUS_ALL); press_a_key->connect("window_input", callable_mp(this, &InputMapEditor::_wait_for_key)); press_a_key->connect("confirmed", callable_mp(this, &InputMapEditor::_press_a_key_confirm)); @@ -994,7 +994,7 @@ InputMapEditor::InputMapEditor() { press_a_key_label = l; device_input = memnew(ConfirmationDialog); - device_input->get_ok()->set_text(TTR("Add")); + device_input->get_ok_button()->set_text(TTR("Add")); device_input->connect("confirmed", callable_mp(this, &InputMapEditor::_device_input_add)); add_child(device_input); diff --git a/editor/plugin_config_dialog.cpp b/editor/plugin_config_dialog.cpp index 3ad69384980aa..a780750633060 100644 --- a/editor/plugin_config_dialog.cpp +++ b/editor/plugin_config_dialog.cpp @@ -126,7 +126,7 @@ void PluginConfigDialog::_on_cancelled() { void PluginConfigDialog::_on_required_text_changed(const String &) { int lang_idx = script_option_edit->get_selected(); String ext = ScriptServer::get_language(lang_idx)->get_extension(); - get_ok()->set_disabled(script_edit->get_text().get_basename().empty() || script_edit->get_text().get_extension() != ext || name_edit->get_text().empty()); + get_ok_button()->set_disabled(script_edit->get_text().get_basename().empty() || script_edit->get_text().get_extension() != ext || name_edit->get_text().empty()); } void PluginConfigDialog::_notification(int p_what) { @@ -138,7 +138,7 @@ void PluginConfigDialog::_notification(int p_what) { } break; case NOTIFICATION_READY: { connect("confirmed", callable_mp(this, &PluginConfigDialog::_on_confirmed)); - get_cancel()->connect("pressed", callable_mp(this, &PluginConfigDialog::_on_cancelled)); + get_cancel_button()->connect("pressed", callable_mp(this, &PluginConfigDialog::_on_cancelled)); } break; } } @@ -171,8 +171,8 @@ void PluginConfigDialog::config(const String &p_config_path) { Object::cast_to