mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Fix crash in connection dialog
This commit is contained in:
parent
39cece382d
commit
ee53b17277
2 changed files with 3 additions and 7 deletions
|
@ -684,6 +684,7 @@ void ConnectionsDock::_connect(ConnectDialog::ConnectionData p_cd) {
|
|||
}
|
||||
|
||||
Callable callable = p_cd.get_callable();
|
||||
Ref<EditorUndoRedoManager> &undo_redo = EditorNode::get_undo_redo();
|
||||
undo_redo->create_action(vformat(TTR("Connect '%s' to '%s'"), String(p_cd.signal), String(p_cd.method)));
|
||||
undo_redo->add_do_method(source, "connect", p_cd.signal, callable, p_cd.flags);
|
||||
undo_redo->add_undo_method(source, "disconnect", p_cd.signal, callable);
|
||||
|
@ -704,6 +705,7 @@ void ConnectionsDock::_disconnect(TreeItem &p_item) {
|
|||
|
||||
ERR_FAIL_COND(cd.source != selected_node); // Shouldn't happen but... Bugcheck.
|
||||
|
||||
Ref<EditorUndoRedoManager> &undo_redo = EditorNode::get_undo_redo();
|
||||
undo_redo->create_action(vformat(TTR("Disconnect '%s' from '%s'"), cd.signal, cd.method));
|
||||
|
||||
Callable callable = cd.get_callable();
|
||||
|
@ -730,6 +732,7 @@ void ConnectionsDock::_disconnect_all() {
|
|||
|
||||
TreeItem *child = item->get_first_child();
|
||||
String signal_name = item->get_metadata(0).operator Dictionary()["name"];
|
||||
Ref<EditorUndoRedoManager> &undo_redo = EditorNode::get_undo_redo();
|
||||
undo_redo->create_action(vformat(TTR("Disconnect all from signal: '%s'"), signal_name));
|
||||
|
||||
while (child) {
|
||||
|
@ -991,10 +994,6 @@ void ConnectionsDock::_bind_methods() {
|
|||
ClassDB::bind_method("update_tree", &ConnectionsDock::update_tree);
|
||||
}
|
||||
|
||||
void ConnectionsDock::set_undo_redo(Ref<EditorUndoRedoManager> p_undo_redo) {
|
||||
undo_redo = p_undo_redo;
|
||||
}
|
||||
|
||||
void ConnectionsDock::set_node(Node *p_node) {
|
||||
selected_node = p_node;
|
||||
update_tree();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue