Merge pull request #35113 from akien-mga/aint-no-peeking-for-command-lurkers
Export: Properly disable resource preview thread
This commit is contained in:
commit
2f1be121b7
3 changed files with 14 additions and 11 deletions
|
@ -673,12 +673,14 @@ void EditorNode::_sources_changed(bool p_exist) {
|
||||||
if (waiting_for_first_scan) {
|
if (waiting_for_first_scan) {
|
||||||
waiting_for_first_scan = false;
|
waiting_for_first_scan = false;
|
||||||
|
|
||||||
EditorResourcePreview::get_singleton()->start(); //start previes now that it's safe
|
// Start preview thread now that it's safe.
|
||||||
|
if (!singleton->cmdline_export_mode) {
|
||||||
|
EditorResourcePreview::get_singleton()->start();
|
||||||
|
}
|
||||||
|
|
||||||
_load_docks();
|
_load_docks();
|
||||||
|
|
||||||
if (defer_load_scene != "") {
|
if (defer_load_scene != "") {
|
||||||
|
|
||||||
load_scene(defer_load_scene);
|
load_scene(defer_load_scene);
|
||||||
defer_load_scene = "";
|
defer_load_scene = "";
|
||||||
}
|
}
|
||||||
|
@ -1168,8 +1170,11 @@ void EditorNode::_save_scene_with_preview(String p_file, int p_idx) {
|
||||||
|
|
||||||
save.step(TTR("Saving Scene"), 4);
|
save.step(TTR("Saving Scene"), 4);
|
||||||
_save_scene(p_file, p_idx);
|
_save_scene(p_file, p_idx);
|
||||||
|
|
||||||
|
if (!singleton->cmdline_export_mode) {
|
||||||
EditorResourcePreview::get_singleton()->check_for_invalidation(p_file);
|
EditorResourcePreview::get_singleton()->check_for_invalidation(p_file);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool EditorNode::_validate_scene_recursive(const String &p_filename, Node *p_node) {
|
bool EditorNode::_validate_scene_recursive(const String &p_filename, Node *p_node) {
|
||||||
|
|
||||||
|
@ -3852,7 +3857,7 @@ 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) {
|
void EditorNode::progress_add_task(const String &p_task, const String &p_label, int p_steps, bool p_can_cancel) {
|
||||||
|
|
||||||
if (singleton->disable_progress_dialog) {
|
if (singleton->cmdline_export_mode) {
|
||||||
print_line(p_task + ": begin: " + p_label + " steps: " + itos(p_steps));
|
print_line(p_task + ": begin: " + p_label + " steps: " + itos(p_steps));
|
||||||
} else {
|
} else {
|
||||||
singleton->progress_dialog->add_task(p_task, p_label, p_steps, p_can_cancel);
|
singleton->progress_dialog->add_task(p_task, p_label, p_steps, p_can_cancel);
|
||||||
|
@ -3861,7 +3866,7 @@ void EditorNode::progress_add_task(const String &p_task, const String &p_label,
|
||||||
|
|
||||||
bool EditorNode::progress_task_step(const String &p_task, const String &p_state, int p_step, bool p_force_refresh) {
|
bool EditorNode::progress_task_step(const String &p_task, const String &p_state, int p_step, bool p_force_refresh) {
|
||||||
|
|
||||||
if (singleton->disable_progress_dialog) {
|
if (singleton->cmdline_export_mode) {
|
||||||
print_line("\t" + p_task + ": step " + itos(p_step) + ": " + p_state);
|
print_line("\t" + p_task + ": step " + itos(p_step) + ": " + p_state);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
@ -3872,7 +3877,7 @@ bool EditorNode::progress_task_step(const String &p_task, const String &p_state,
|
||||||
|
|
||||||
void EditorNode::progress_end_task(const String &p_task) {
|
void EditorNode::progress_end_task(const String &p_task) {
|
||||||
|
|
||||||
if (singleton->disable_progress_dialog) {
|
if (singleton->cmdline_export_mode) {
|
||||||
print_line(p_task + ": end");
|
print_line(p_task + ": end");
|
||||||
} else {
|
} else {
|
||||||
singleton->progress_dialog->end_task(p_task);
|
singleton->progress_dialog->end_task(p_task);
|
||||||
|
@ -3958,7 +3963,7 @@ Error EditorNode::export_preset(const String &p_preset, const String &p_path, bo
|
||||||
export_defer.path = p_path;
|
export_defer.path = p_path;
|
||||||
export_defer.debug = p_debug;
|
export_defer.debug = p_debug;
|
||||||
export_defer.pack_only = p_pack_only;
|
export_defer.pack_only = p_pack_only;
|
||||||
disable_progress_dialog = true;
|
cmdline_export_mode = true;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5600,7 +5605,7 @@ EditorNode::EditorNode() {
|
||||||
_initializing_addons = false;
|
_initializing_addons = false;
|
||||||
docks_visible = true;
|
docks_visible = true;
|
||||||
restoring_scenes = false;
|
restoring_scenes = false;
|
||||||
disable_progress_dialog = false;
|
cmdline_export_mode = false;
|
||||||
scene_distraction = false;
|
scene_distraction = false;
|
||||||
script_distraction = false;
|
script_distraction = false;
|
||||||
|
|
||||||
|
|
|
@ -561,7 +561,7 @@ private:
|
||||||
bool pack_only;
|
bool pack_only;
|
||||||
} export_defer;
|
} export_defer;
|
||||||
|
|
||||||
bool disable_progress_dialog;
|
bool cmdline_export_mode;
|
||||||
|
|
||||||
static EditorNode *singleton;
|
static EditorNode *singleton;
|
||||||
|
|
||||||
|
|
|
@ -215,7 +215,6 @@ void EditorResourcePreview::_generate_preview(Ref<ImageTexture> &r_texture, Ref<
|
||||||
|
|
||||||
void EditorResourcePreview::_thread() {
|
void EditorResourcePreview::_thread() {
|
||||||
|
|
||||||
#ifndef SERVER_ENABLED
|
|
||||||
exited = false;
|
exited = false;
|
||||||
while (!exit) {
|
while (!exit) {
|
||||||
|
|
||||||
|
@ -349,7 +348,6 @@ void EditorResourcePreview::_thread() {
|
||||||
preview_mutex->unlock();
|
preview_mutex->unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
exited = true;
|
exited = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue