| 63 | } |
| 64 | |
| 65 | void ConnectionInfoDialog::popup_connections(const String &p_method, const Vector<Node *> &p_nodes) { |
| 66 | method->set_text(p_method); |
| 67 | |
| 68 | tree->clear(); |
| 69 | TreeItem *root = tree->create_item(); |
| 70 | |
| 71 | for (int i = 0; i < p_nodes.size(); i++) { |
| 72 | List<Connection> all_connections; |
| 73 | p_nodes[i]->get_signals_connected_to_this(&all_connections); |
| 74 | |
| 75 | for (const Connection &connection : all_connections) { |
| 76 | if (connection.callable.get_method() != p_method) { |
| 77 | continue; |
| 78 | } |
| 79 | |
| 80 | TreeItem *node_item = tree->create_item(root); |
| 81 | |
| 82 | node_item->set_text(0, Object::cast_to<Node>(connection.signal.get_object())->get_name()); |
| 83 | node_item->set_icon(0, EditorNode::get_singleton()->get_object_icon(connection.signal.get_object(), "Node")); |
| 84 | node_item->set_selectable(0, false); |
| 85 | node_item->set_editable(0, false); |
| 86 | |
| 87 | node_item->set_text(1, connection.signal.get_name()); |
| 88 | Control *p = Object::cast_to<Control>(get_parent()); |
| 89 | node_item->set_icon(1, p->get_editor_theme_icon(SNAME("Slot"))); |
| 90 | node_item->set_selectable(1, false); |
| 91 | node_item->set_editable(1, false); |
| 92 | |
| 93 | node_item->set_text(2, Object::cast_to<Node>(connection.callable.get_object())->get_name()); |
| 94 | node_item->set_icon(2, EditorNode::get_singleton()->get_object_icon(connection.callable.get_object(), "Node")); |
| 95 | node_item->set_selectable(2, false); |
| 96 | node_item->set_editable(2, false); |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | popup_centered(Size2(600, 300) * EDSCALE); |
| 101 | } |
| 102 | |
| 103 | ConnectionInfoDialog::ConnectionInfoDialog() { |
| 104 | set_title(TTRC("Connections to method:")); |
no test coverage detected