| 1019 | } |
| 1020 | |
| 1021 | void ScriptEditor::_queue_close_tabs() { |
| 1022 | while (!script_close_queue.is_empty()) { |
| 1023 | int idx = script_close_queue.front()->get(); |
| 1024 | script_close_queue.pop_front(); |
| 1025 | |
| 1026 | tab_container->set_current_tab(idx); |
| 1027 | ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(tab_container->get_tab_control(idx)); |
| 1028 | if (se) { |
| 1029 | // Maybe there are unsaved changes. |
| 1030 | if (se->is_unsaved()) { |
| 1031 | _ask_close_current_unsaved_tab(se); |
| 1032 | erase_tab_confirm->connect(SceneStringName(visibility_changed), callable_mp(this, &ScriptEditor::_queue_close_tabs), CONNECT_ONE_SHOT); |
| 1033 | break; |
| 1034 | } |
| 1035 | } |
| 1036 | |
| 1037 | _close_current_tab(false, false); |
| 1038 | } |
| 1039 | _update_find_replace_bar(); |
| 1040 | } |
| 1041 | |
| 1042 | void ScriptEditor::_ask_close_current_unsaved_tab(ScriptEditorBase *current) { |
| 1043 | erase_tab_confirm->set_text(TTR("Close and save changes?") + "\n\"" + current->get_name() + "\""); |
nothing calls this directly
no test coverage detected