MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _queue_close_tabs

Method _queue_close_tabs

editor/script/script_editor_plugin.cpp:1021–1040  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1019}
1020
1021void 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
1042void ScriptEditor::_ask_close_current_unsaved_tab(ScriptEditorBase *current) {
1043 erase_tab_confirm->set_text(TTR("Close and save changes?") + "\n\"" + current->get_name() + "\"");

Callers

nothing calls this directly

Calls 8

get_tab_controlMethod · 0.80
connectMethod · 0.65
is_emptyMethod · 0.45
getMethod · 0.45
frontMethod · 0.45
pop_frontMethod · 0.45
set_current_tabMethod · 0.45
is_unsavedMethod · 0.45

Tested by

no test coverage detected