diff options
-rw-r--r-- | editor/editor_node.cpp | 24 | ||||
-rw-r--r-- | editor/editor_node.h | 2 |
2 files changed, 21 insertions, 5 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 157dd4d66f..d009ed61b5 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -3249,17 +3249,31 @@ Ref<Texture> EditorNode::get_class_icon(const String &p_class, const String &p_f void EditorNode::progress_add_task(const String &p_task, const String &p_label, int p_steps, bool p_can_cancel) { - singleton->progress_dialog->add_task(p_task, p_label, p_steps, p_can_cancel); + if (singleton->disable_progress_dialog) { + print_line(p_task + ": begin: " + p_label + " steps: " + itos(p_steps)); + } else { + singleton->progress_dialog->add_task(p_task, p_label, p_steps, p_can_cancel); + } } bool EditorNode::progress_task_step(const String &p_task, const String &p_state, int p_step, bool p_force_refresh) { - return singleton->progress_dialog->task_step(p_task, p_state, p_step, p_force_refresh); + if (singleton->disable_progress_dialog) { + print_line("\t" + p_task + ": step " + itos(p_step) + ": " + p_state); + return false; + } else { + + return singleton->progress_dialog->task_step(p_task, p_state, p_step, p_force_refresh); + } } void EditorNode::progress_end_task(const String &p_task) { - singleton->progress_dialog->end_task(p_task); + if (singleton->disable_progress_dialog) { + print_line(p_task + ": end"); + } else { + singleton->progress_dialog->end_task(p_task); + } } void EditorNode::progress_add_task_bg(const String &p_task, const String &p_label, int p_steps) { @@ -3341,7 +3355,7 @@ Error EditorNode::export_preset(const String &p_preset, const String &p_path, bo export_defer.path = p_path; export_defer.debug = p_debug; export_defer.password = p_password; - + disable_progress_dialog = true; return OK; } @@ -4731,7 +4745,7 @@ EditorNode::EditorNode() { _initializing_addons = false; docks_visible = true; restoring_scenes = false; - + disable_progress_dialog = false; scene_distraction = false; script_distraction = false; diff --git a/editor/editor_node.h b/editor/editor_node.h index 3fa762c20b..4d89d1f956 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -525,6 +525,8 @@ private: } export_defer; + bool disable_progress_dialog; + static EditorNode *singleton; static Vector<EditorNodeInitCallback> _init_callbacks; |